diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 21df2e4..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,28 +0,0 @@ -module.exports = { - extends: ["plugin:react/recommended", "plugin:@typescript-eslint/recommended", "plugin:prettier/recommended", "plugin:css-modules/recommended", "plugin:storybook/recommended", "plugin:storybook/recommended", "plugin:storybook/recommended", "plugin:storybook/recommended"], - parser: "@typescript-eslint/parser", - parserOptions: { - sourceType: "module", - ecmaVersion: 2020, - ecmaFeatures: { - jsx: true // Allows for the parsing of JSX - } - }, - - plugins: ["@typescript-eslint", "css-modules"], - settings: { - "import/resolver": { - node: { - extensions: [".js", ".jsx", ".ts", ".tsx"] - } - }, - react: { - version: "detect" // Tells eslint-plugin-react to automatically detect the version of React to use - } - }, - - // Fine tune rules - rules: { - "@typescript-eslint/no-var-requires": 0 - } -}; \ No newline at end of file diff --git a/.prettierrc.js b/.prettierrc.js index 8f86ed0..060845c 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,4 +1,4 @@ -module.exports = { - semi: true, - trailingComma: "all", +export default { + semi: true, + trailingComma: "all", }; diff --git a/__mocks__/fileMock.js b/__mocks__/fileMock.cjs similarity index 100% rename from __mocks__/fileMock.js rename to __mocks__/fileMock.cjs diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..8e373a2 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,59 @@ +import js from "@eslint/js"; +import typescript from "@typescript-eslint/eslint-plugin"; +import typescriptParser from "@typescript-eslint/parser"; +import react from "eslint-plugin-react"; +import prettier from "eslint-plugin-prettier"; +import cssModules from "eslint-plugin-css-modules"; +import storybook from "eslint-plugin-storybook"; + +export default [ + js.configs.recommended, + { + files: ["**/*.{js,jsx,ts,tsx}"], + languageOptions: { + parser: typescriptParser, + parserOptions: { + sourceType: "module", + ecmaVersion: 2020, + ecmaFeatures: { + jsx: true, + }, + }, + }, + plugins: { + "@typescript-eslint": typescript, + react, + prettier, + "css-modules": cssModules, + storybook, + }, + settings: { + "import/resolver": { + node: { + extensions: [".js", ".jsx", ".ts", ".tsx"], + }, + }, + react: { + version: "detect", + }, + }, + rules: { + ...typescript.configs.recommended.rules, + ...react.configs.recommended.rules, + ...prettier.configs.recommended.rules, + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/no-explicit-any": "off", + "react/react-in-jsx-scope": "off", + "no-undef": "off", + }, + }, + { + files: ["**/*.stories.{js,jsx,ts,tsx}"], + rules: { + ...storybook.configs.recommended.rules, + }, + }, + { + ignores: ["dist/**", "node_modules/**", "build/**"], + }, +]; diff --git a/jest.config.js b/jest.config.cjs similarity index 92% rename from jest.config.js rename to jest.config.cjs index 0328008..6826de3 100644 --- a/jest.config.js +++ b/jest.config.cjs @@ -1,10 +1,10 @@ module.exports = { preset: 'ts-jest', testEnvironment: 'jsdom', - setupFilesAfterEnv: ['/jest.setup.js'], + setupFilesAfterEnv: ['/jest.setup.cjs'], moduleNameMapper: { '\\.(css|less|scss|sass)$': 'identity-obj-proxy', - '\\.(jpg|jpeg|png|gif|svg)$': '/__mocks__/fileMock.js', + '\\.(jpg|jpeg|png|gif|svg)$': '/__mocks__/fileMock.cjs', }, testMatch: [ '**/__tests__/**/*.+(ts|tsx|js)', diff --git a/jest.setup.js b/jest.setup.cjs similarity index 100% rename from jest.setup.js rename to jest.setup.cjs diff --git a/package.json b/package.json index 40070c0..27bb578 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "threetwo", "version": "0.1.0", + "type": "module", "description": "ThreeTwo! A good comic book curator.", "scripts": { "build": "vite build", @@ -117,6 +118,7 @@ "@types/react-redux": "^7.1.34", "autoprefixer": "^10.4.27", "docdash": "^2.0.2", + "@eslint/js": "^10.0.0", "eslint": "^10.0.2", "eslint-config-prettier": "^10.1.8", "eslint-plugin-css-modules": "^2.12.0", diff --git a/postcss.config.js b/postcss.config.js index 782f14f..a5367d7 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,4 +1,4 @@ -module.exports = { +export default { plugins: { "postcss-import": {}, "@tailwindcss/postcss": {}, diff --git a/src/app.css b/src/app.css new file mode 100644 index 0000000..35a4a9b --- /dev/null +++ b/src/app.css @@ -0,0 +1,43 @@ +@import "tailwindcss"; +@config "../tailwind.config.ts"; + +/* Custom Project Fonts */ +@font-face { + font-family: "PP Object Sans Regular"; + src: url("/fonts/PPObjectSans-Regular.otf") format("opentype"); + font-weight: 400; + font-style: normal; + font-display: swap; +} + +@font-face { + font-family: "PP Object Sans Heavy"; + src: url("/fonts/PPObjectSans-Heavy.otf") format("opentype"); + font-weight: 700; + font-style: normal; + font-display: swap; +} + +@font-face { + font-family: "PP Object Sans Slanted"; + src: url("/fonts/PPObjectSans-Slanted.otf") format("opentype"); + font-weight: 400; + font-style: italic; + font-display: swap; +} + +@font-face { + font-family: "PP Object Sans HeavySlanted"; + src: url("/fonts/PPObjectSans-HeavySlanted.otf") format("opentype"); + font-weight: 700; + font-style: italic; + font-display: swap; +} + +@font-face { + font-family: "Hasklig Regular"; + src: url("/fonts/Hasklig-Regular.otf") format("opentype"); + font-weight: 400; + font-style: normal; + font-display: swap; +} diff --git a/src/client/components/App.tsx b/src/client/components/App.tsx index a8d5f7d..bbce6c2 100644 --- a/src/client/components/App.tsx +++ b/src/client/components/App.tsx @@ -2,7 +2,7 @@ import React, { ReactElement, useEffect } from "react"; import { Outlet } from "react-router-dom"; import { Navbar2 } from "./shared/Navbar2"; import { ToastContainer } from "react-toastify"; -import "../assets/scss/App.css"; +import "../../app.css"; import { useStore } from "../store"; export const App = (): ReactElement => { diff --git a/tailwind.config.ts b/tailwind.config.ts index b6902a2..22dde8d 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -1,7 +1,7 @@ import { addDynamicIconSelectors } from "@iconify/tailwind"; +import type { Config } from "tailwindcss"; -/** @type {import('tailwindcss').Config} */ -module.exports = { +const config: Config = { content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"], darkMode: "class", theme: { @@ -43,3 +43,5 @@ module.exports = { plugins: [addDynamicIconSelectors()], }; + +export default config;