|
1 | | -import { defineConfig } from 'eslint/config'; |
2 | | -import react from 'eslint-plugin-react'; |
| 1 | +import { defineConfig } from "eslint/config"; |
| 2 | +import react from "eslint-plugin-react"; |
3 | 3 |
|
4 | | -import reactHooks from 'eslint-plugin-react-hooks'; |
5 | | -import reactRefresh from 'eslint-plugin-react-refresh'; |
| 4 | +import reactHooks from "eslint-plugin-react-hooks"; |
| 5 | +import reactRefresh from "eslint-plugin-react-refresh"; |
6 | 6 |
|
7 | | -import { javascriptConfig } from '@ni/eslint-config-javascript'; |
8 | | -import { typescriptConfig } from '@ni/eslint-config-typescript'; |
| 7 | +import { javascriptConfig } from "@ni/eslint-config-javascript"; |
| 8 | +import { typescriptConfig } from "@ni/eslint-config-typescript"; |
9 | 9 |
|
10 | 10 | export default defineConfig([ |
11 | | - { |
12 | | - ignores: ['dist/**'], |
| 11 | + { |
| 12 | + ignores: ["dist/**"], |
| 13 | + }, |
| 14 | + { |
| 15 | + files: ["**/*.ts", "**/*.tsx"], |
| 16 | + plugins: { |
| 17 | + react, |
| 18 | + "react-refresh": reactRefresh, |
| 19 | + "react-hooks": reactHooks, |
13 | 20 | }, |
14 | | - { |
15 | | - files: ['**/*.ts', '**/*.tsx'], |
16 | | - plugins: { |
17 | | - react, |
18 | | - 'react-refresh': reactRefresh, |
19 | | - 'react-hooks': reactHooks, |
20 | | - }, |
21 | | - extends: [ |
22 | | - typescriptConfig, |
23 | | - react.configs.flat.recommended, |
24 | | - react.configs.flat['jsx-runtime'], |
25 | | - reactHooks.configs.flat.recommended, |
26 | | - ], |
27 | | - languageOptions: { |
28 | | - parserOptions: { |
29 | | - project: './tsconfig.app.json', |
30 | | - tsconfigRootDir: import.meta.dirname, |
31 | | - ecmaFeatures: { |
32 | | - jsx: true, |
33 | | - }, |
34 | | - }, |
35 | | - }, |
36 | | - settings: { |
37 | | - react: { |
38 | | - version: 'detect', |
39 | | - }, |
40 | | - }, |
41 | | - rules: { |
42 | | - // The React components should use PascalCase |
43 | | - '@typescript-eslint/naming-convention': [ |
44 | | - 'error', |
45 | | - { |
46 | | - selector: 'variable', |
47 | | - format: ['camelCase', 'PascalCase'], |
48 | | - }, |
49 | | - ], |
50 | | - 'react-refresh/only-export-components': [ |
51 | | - 'error', |
52 | | - { allowConstantExport: true }, |
53 | | - ], |
54 | | - // "@typescript-eslint/strict-boolean-expressions": "off", |
55 | | - // "no-alert": "off", |
| 21 | + extends: [ |
| 22 | + typescriptConfig, |
| 23 | + react.configs.flat.recommended, |
| 24 | + react.configs.flat["jsx-runtime"], |
| 25 | + reactHooks.configs.flat.recommended, |
| 26 | + ], |
| 27 | + languageOptions: { |
| 28 | + parserOptions: { |
| 29 | + project: "./tsconfig.app.json", |
| 30 | + tsconfigRootDir: import.meta.dirname, |
| 31 | + ecmaFeatures: { |
| 32 | + jsx: true, |
56 | 33 | }, |
| 34 | + }, |
57 | 35 | }, |
58 | | - |
59 | | - { |
60 | | - files: ['vite.config.ts'], |
61 | | - extends: [typescriptConfig], |
62 | | - languageOptions: { |
63 | | - parserOptions: { |
64 | | - project: './tsconfig.node.json', |
65 | | - tsconfigRootDir: import.meta.dirname.pathname, |
66 | | - }, |
67 | | - }, |
68 | | - rules: { |
69 | | - // Configuration scripts will not be in published package and are allowed to use devDependencies |
70 | | - 'import/no-extraneous-dependencies': ['error', { devDependencies: true }], |
71 | | - // Build scripts should give verbose logging |
72 | | - 'no-console': 'off', |
73 | | - // Rollup config files use default exports |
74 | | - 'import/no-default-export': 'off', |
| 36 | + settings: { |
| 37 | + react: { |
| 38 | + version: "detect", |
| 39 | + }, |
| 40 | + }, |
| 41 | + rules: { |
| 42 | + // The React components should use PascalCase |
| 43 | + "@typescript-eslint/naming-convention": [ |
| 44 | + "error", |
| 45 | + { |
| 46 | + selector: "variable", |
| 47 | + format: ["camelCase", "PascalCase"], |
75 | 48 | }, |
| 49 | + ], |
| 50 | + "react-refresh/only-export-components": [ |
| 51 | + "error", |
| 52 | + { allowConstantExport: true }, |
| 53 | + ], |
| 54 | + // "@typescript-eslint/strict-boolean-expressions": "off", |
| 55 | + // "no-alert": "off", |
76 | 56 | }, |
| 57 | + }, |
77 | 58 |
|
78 | | - { |
79 | | - files: ['**/*.js'], |
80 | | - extends: [javascriptConfig], |
| 59 | + { |
| 60 | + files: ["vite.config.ts"], |
| 61 | + extends: [typescriptConfig], |
| 62 | + languageOptions: { |
| 63 | + parserOptions: { |
| 64 | + project: "./tsconfig.node.json", |
| 65 | + tsconfigRootDir: import.meta.dirname.pathname, |
| 66 | + }, |
81 | 67 | }, |
| 68 | + rules: { |
| 69 | + // Configuration scripts will not be in published package and are allowed to use devDependencies |
| 70 | + "import/no-extraneous-dependencies": ["error", { devDependencies: true }], |
| 71 | + // Build scripts should give verbose logging |
| 72 | + "no-console": "off", |
| 73 | + // Rollup config files use default exports |
| 74 | + "import/no-default-export": "off", |
| 75 | + }, |
| 76 | + }, |
| 77 | + |
| 78 | + { |
| 79 | + files: ["**/*.js"], |
| 80 | + extends: [javascriptConfig], |
| 81 | + }, |
82 | 82 | ]); |
0 commit comments