diff --git a/.gitignore b/.gitignore index 80672b93..30c357ef 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,9 @@ yarn-error.log* pnpm-debug.log* lerna-debug.log* +# NPM +.npmrc + node_modules dist dist-ssr diff --git a/eslint.config.js b/eslint.config.js index 092408a9..6a4c2802 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,28 +1,61 @@ -import js from '@eslint/js' -import globals from 'globals' -import reactHooks from 'eslint-plugin-react-hooks' -import reactRefresh from 'eslint-plugin-react-refresh' -import tseslint from 'typescript-eslint' +import js from "@eslint/js"; +import globals from "globals"; +import reactHooks from "eslint-plugin-react-hooks"; +import reactRefresh from "eslint-plugin-react-refresh"; +import tseslint from "typescript-eslint"; +import tailwindPlugin from 'eslint-plugin-tailwindcss' export default tseslint.config( - { ignores: ['dist'] }, + { ignores: ["dist"] }, { - extends: [js.configs.recommended, ...tseslint.configs.recommended], - files: ['**/*.{ts,tsx}'], + extends: [ + js.configs.recommended, + ...tseslint.configs.recommended, + ...tailwindPlugin.configs["flat/recommended"], + ], + files: ["**/*.{ts,tsx}"], languageOptions: { ecmaVersion: 2020, globals: globals.browser, }, plugins: { - 'react-hooks': reactHooks, - 'react-refresh': reactRefresh, + "react-hooks": reactHooks, + "react-refresh": reactRefresh, + }, + + settings: { + tailwindcss: { + callees: ["tv", "twMerge"], + config: "./tailwind.config.ts", + }, }, rules: { ...reactHooks.configs.recommended.rules, - 'react-refresh/only-export-components': [ - 'warn', + "react-refresh/only-export-components": [ + "warn", { allowConstantExport: true }, ], + "tailwindcss/enforces-negative-arbitrary-values": "error", + "tailwindcss/enforces-shorthand": "error", + "tailwindcss/classnames-order": "off", // handled by prettier + "tailwindcss/no-contradicting-classname": "error", + "tailwindcss/no-custom-classname": [ + "error", + { + callees: ["tv", "twMerge"], + whitelist: [ + "theme\\-(minder|trusty)", + "light", + "dark", + "scrollbar-thin", + "font-default", + "font-title", + "font-code", + "subhead-bold", + "subhead-regular", + ], + }, + ], }, - }, -) + } +); diff --git a/index.html b/index.html index df1cb2ba..bdfff95b 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@