|
1 | | -import {dirname} from 'path'; |
2 | | -import {fileURLToPath} from 'url'; |
3 | | -import {FlatCompat} from '@eslint/eslintrc'; |
| 1 | +import { dirname } from 'path'; |
| 2 | +import { fileURLToPath } from 'url'; |
| 3 | +import { FlatCompat } from '@eslint/eslintrc'; |
4 | 4 | import js from '@eslint/js'; |
5 | 5 | import tseslint from 'typescript-eslint'; |
6 | 6 | import eslintPluginPrettier from 'eslint-plugin-prettier'; |
@@ -50,26 +50,28 @@ export default tseslint.config( |
50 | 50 | message: 'Do not use `as any`, types must be explicit and safe.', |
51 | 51 | }, |
52 | 52 | { |
53 | | - selector: "JSXOpeningElement[name.type='JSXIdentifier'][name.name=/^[a-z]/]", |
| 53 | + selector: |
| 54 | + "JSXOpeningElement[name.type='JSXIdentifier'][name.name=/^[a-z]/]", |
54 | 55 | message: |
55 | 56 | 'Do not use native HTML elements: use an MUI component (PascalCase) instead.', |
56 | 57 | }, |
57 | 58 | ], |
58 | 59 |
|
59 | 60 | /* Code structure and clarity */ |
60 | 61 | // 'max-params': ['warn', 1], |
| 62 | + |
61 | 63 | 'default-case': 'warn', |
62 | 64 | 'import/no-unresolved': 'error', |
63 | 65 | 'no-inline-comments': 'warn', |
64 | 66 | 'no-undefined': 'warn', |
65 | 67 | 'no-var': 'error', |
66 | | - 'prefer-const': ['error', {destructuring: 'all'}], |
| 68 | + 'prefer-const': ['error', { destructuring: 'all' }], |
67 | 69 | 'require-await': 'error', |
68 | 70 | 'require-object-destructuring': 'off', |
69 | | - |
| 71 | + 'arrow-parens': ['error', 'as-needed'], |
70 | 72 | /* Formatting */ |
71 | | - 'max-len': ['warn', {code: 300, ignoreUrls: true}], |
72 | | - 'prettier/prettier': ['warn', {semi: true}], |
| 73 | + 'max-len': ['warn', { code: 300, ignoreUrls: true }], |
| 74 | + 'prettier/prettier': ['warn', { semi: true }], |
73 | 75 | semi: ['error', 'always'], |
74 | 76 |
|
75 | 77 | /* Naming conventions */ |
@@ -120,29 +122,29 @@ export default tseslint.config( |
120 | 122 | ], |
121 | 123 | '@typescript-eslint/explicit-function-return-type': [ |
122 | 124 | 'error', |
123 | | - {allowExpressions: false}, |
| 125 | + { allowExpressions: false }, |
124 | 126 | ], |
125 | 127 | '@typescript-eslint/explicit-member-accessibility': [ |
126 | 128 | 'error', |
127 | | - {accessibility: 'explicit'}, |
| 129 | + { accessibility: 'explicit' }, |
128 | 130 | ], |
129 | 131 | '@typescript-eslint/explicit-module-boundary-types': 'error', |
130 | 132 | '@typescript-eslint/no-empty-function': ['warn'], |
131 | 133 | '@typescript-eslint/no-extraneous-class': [ |
132 | 134 | 'error', |
133 | | - {allowConstructorOnly: false}, |
| 135 | + { allowConstructorOnly: false }, |
134 | 136 | ], |
135 | 137 | '@typescript-eslint/no-explicit-any': 'error', |
136 | 138 | '@typescript-eslint/no-inferrable-types': 'off', |
137 | 139 | '@typescript-eslint/no-magic-numbers': [ |
138 | 140 | 'warn', |
139 | | - {ignoreEnums: true, ignore: [0, 1], enforceConst: true}, |
| 141 | + { ignoreEnums: true, ignore: [0, 1], enforceConst: true }, |
140 | 142 | ], |
141 | 143 | '@typescript-eslint/no-namespace': 'off', |
142 | 144 | '@typescript-eslint/no-unsafe-member-access': 'warn', |
143 | 145 | '@typescript-eslint/no-unused-vars': [ |
144 | 146 | 'error', |
145 | | - {argsIgnorePattern: '^_'}, |
| 147 | + { argsIgnorePattern: '^_' }, |
146 | 148 | ], |
147 | 149 | '@typescript-eslint/prefer-function-type': 'warn', |
148 | 150 | '@typescript-eslint/prefer-readonly': 'warn', |
@@ -187,9 +189,9 @@ export default tseslint.config( |
187 | 189 |
|
188 | 190 | { |
189 | 191 | files: ['**/*.test.ts', '**/*.spec.ts', '**/*.test.tsx', '**/*.spec.tsx'], |
190 | | - plugins: {jest: eslintPluginJest}, |
| 192 | + plugins: { jest: eslintPluginJest }, |
191 | 193 | settings: { |
192 | | - jest: {version: 29}, |
| 194 | + jest: { version: 29 }, |
193 | 195 | }, |
194 | 196 | }, |
195 | 197 | ], |
|
0 commit comments