-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy patheslint.config.mjs
More file actions
109 lines (108 loc) · 2.91 KB
/
eslint.config.mjs
File metadata and controls
109 lines (108 loc) · 2.91 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import { defineConfig } from 'eslint/config';
import js from '@eslint/js';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import importPlugin from 'eslint-plugin-import';
import jsxA11y from 'eslint-plugin-jsx-a11y';
import sonarjs from 'eslint-plugin-sonarjs';
import prettier from 'eslint-plugin-prettier';
import vitestGlobals from 'eslint-config-vitest-globals/flat';
import globals from 'globals';
import typescriptParser from '@typescript-eslint/parser';
import typescriptEslint from '@typescript-eslint/eslint-plugin';
export default defineConfig([
js.configs.recommended,
react.configs.flat.recommended,
react.configs.flat['jsx-runtime'],
importPlugin.flatConfigs.recommended,
jsxA11y.flatConfigs.recommended,
sonarjs.configs.recommended,
vitestGlobals(),
{
files: ['**/*.{js,jsx,mjs}'],
ignores: [
'**/*.scss',
'**/*.css',
'**/*.module.css',
'coverage/**',
'node_modules/**',
],
plugins: {
'react-hooks': reactHooks,
prettier,
'@typescript-eslint': typescriptEslint,
},
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
parser: typescriptParser,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
globals: {
...globals.browser,
...globals.node,
JSX: true,
},
},
settings: {
react: {
version: 'detect',
},
'import/resolver': {
node: {
extensions: ['.js', '.jsx'],
},
},
},
rules: {
...reactHooks.configs.recommended.rules,
'prettier/prettier': 'error',
'react/jsx-uses-react': 1,
'react/forbid-prop-types': 0,
'react/function-component-definition': 0,
'react/default-props-match-prop-types': 0,
'react/destructuring-assignment': 0,
'react/jsx-props-no-spreading': 0,
'react/jsx-no-constructed-context-values': 0,
'react/jsx-filename-extension': 0,
'react/no-unstable-nested-components': 0,
'react/require-default-props': 0,
'react/no-danger': 1,
'react/display-name': 0,
'import/extensions': 0,
'import/order': [
'error',
{
groups: [
'builtin',
'external',
'internal',
['parent', 'sibling', 'index'],
],
'newlines-between': 'always',
},
],
'import/no-named-as-default': 0,
'import/no-named-as-default-member': 0,
'jsx-a11y/label-has-associated-control': [
'error',
{
components: ['Label'],
required: {
some: ['nesting', 'id'],
},
allowChildren: false,
},
],
'jsx-a11y/no-autofocus': 0,
camelcase: 0,
'no-underscore-dangle': 1,
'no-console': 1,
'no-param-reassign': 1,
'max-len': ['warn', { code: 120 }],
},
},
]);