-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
59 lines (58 loc) · 1.79 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import globals from 'globals';
import pluginJs from '@eslint/js';
import { configs as tseslint } from 'typescript-eslint';
import pluginReact from 'eslint-plugin-react';
import pluginJest from 'eslint-plugin-jest';
import pluginJestDom from 'eslint-plugin-jest-dom';
import pluginTest from 'eslint-plugin-testing-library';
import pluginPrettier from 'eslint-plugin-prettier/recommended';
import configPrettier from 'eslint-config-prettier';
import pluginImport from 'eslint-plugin-import';
/** @type {import('eslint').Linter.Config[]} */
export default [
{ files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'] },
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
React: true,
NodeJS: true,
},
},
},
...tseslint.strict,
...tseslint.recommended,
pluginJs.configs.recommended,
pluginReact.configs.flat.recommended,
pluginJest.configs['flat/recommended'],
pluginJestDom.configs['flat/recommended'],
pluginTest.configs['flat/react'],
pluginPrettier,
configPrettier,
pluginImport.flatConfigs.recommended,
{
rules: {
'import/order': [
'error',
{ groups: ['builtin', 'external', 'internal'] },
],
'react/react-in-jsx-scope': 'off',
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'no-restricted-imports': ['error', { patterns: ['..*'] }],
},
languageOptions: {
parserOptions: { project: true, tsconfigRootDir: import.meta.dirname },
},
settings: {
'import/resolver': {
typescript: true,
node: true,
},
'import/extensions': ['.js', '.jsx', '.ts', '.tsx'],
},
},
];