|
1 |
| -import js from '@eslint/js' |
2 |
| -import globals from 'globals' |
3 |
| -import reactHooks from 'eslint-plugin-react-hooks' |
4 |
| -import reactRefresh from 'eslint-plugin-react-refresh' |
5 |
| -import tseslint from 'typescript-eslint' |
| 1 | +import js from "@eslint/js"; |
| 2 | +import globals from "globals"; |
| 3 | +import reactHooks from "eslint-plugin-react-hooks"; |
| 4 | +import reactRefresh from "eslint-plugin-react-refresh"; |
| 5 | +import tseslint from "typescript-eslint"; |
| 6 | +import tailwindPlugin from 'eslint-plugin-tailwindcss' |
6 | 7 |
|
7 | 8 | export default tseslint.config(
|
8 |
| - { ignores: ['dist'] }, |
| 9 | + { ignores: ["dist"] }, |
9 | 10 | {
|
10 |
| - extends: [js.configs.recommended, ...tseslint.configs.recommended], |
11 |
| - files: ['**/*.{ts,tsx}'], |
| 11 | + extends: [ |
| 12 | + js.configs.recommended, |
| 13 | + ...tseslint.configs.recommended, |
| 14 | + ...tailwindPlugin.configs["flat/recommended"], |
| 15 | + ], |
| 16 | + files: ["**/*.{ts,tsx}"], |
12 | 17 | languageOptions: {
|
13 | 18 | ecmaVersion: 2020,
|
14 | 19 | globals: globals.browser,
|
15 | 20 | },
|
16 | 21 | plugins: {
|
17 |
| - 'react-hooks': reactHooks, |
18 |
| - 'react-refresh': reactRefresh, |
| 22 | + "react-hooks": reactHooks, |
| 23 | + "react-refresh": reactRefresh, |
| 24 | + }, |
| 25 | + |
| 26 | + settings: { |
| 27 | + tailwindcss: { |
| 28 | + callees: ["tv", "twMerge"], |
| 29 | + config: "./tailwind.config.ts", |
| 30 | + }, |
19 | 31 | },
|
20 | 32 | rules: {
|
21 | 33 | ...reactHooks.configs.recommended.rules,
|
22 |
| - 'react-refresh/only-export-components': [ |
23 |
| - 'warn', |
| 34 | + "react-refresh/only-export-components": [ |
| 35 | + "warn", |
24 | 36 | { allowConstantExport: true },
|
25 | 37 | ],
|
| 38 | + "tailwindcss/enforces-negative-arbitrary-values": "error", |
| 39 | + "tailwindcss/enforces-shorthand": "error", |
| 40 | + "tailwindcss/classnames-order": "off", // handled by prettier |
| 41 | + "tailwindcss/no-contradicting-classname": "error", |
| 42 | + "tailwindcss/no-custom-classname": [ |
| 43 | + "error", |
| 44 | + { |
| 45 | + callees: ["tv", "twMerge"], |
| 46 | + whitelist: [ |
| 47 | + "theme\\-(minder|trusty)", |
| 48 | + "light", |
| 49 | + "dark", |
| 50 | + "scrollbar-thin", |
| 51 | + "font-default", |
| 52 | + "font-title", |
| 53 | + "font-code", |
| 54 | + "subhead-bold", |
| 55 | + "subhead-regular", |
| 56 | + ], |
| 57 | + }, |
| 58 | + ], |
26 | 59 | },
|
27 |
| - }, |
28 |
| -) |
| 60 | + } |
| 61 | +); |
0 commit comments