-
-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy patheslint.config.mjs
More file actions
86 lines (85 loc) · 2.31 KB
/
eslint.config.mjs
File metadata and controls
86 lines (85 loc) · 2.31 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
import requireMetricsFlag from './eslint-rules/require-metrics-flag.mjs'
import js from '@eslint/js'
import tsPlugin from '@typescript-eslint/eslint-plugin'
import tsParser from '@typescript-eslint/parser'
import eslintConfigPrettier from 'eslint-config-prettier'
import reactHookPlugin from 'eslint-plugin-react-hooks'
import globals from 'globals'
import tseslint from 'typescript-eslint'
export default tseslint.config(
{
ignores: [
'**/build/**/*',
'**/dist/**',
'**/node_modules/**',
'**/coverage/**',
'webpack/loaders/**',
'bdd-gen/**',
],
},
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx,js,jsx,cjs,mjs}'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.browser,
...globals.node,
...globals.jest,
},
parser: tsParser,
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
tsconfigRootDir: import.meta.dirname,
},
},
plugins: {
'@typescript-eslint': tsPlugin,
'react-hooks': reactHookPlugin,
'require-metrics-flag': {
rules: { 'require-metrics-flag': requireMetricsFlag },
},
},
rules: {
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
semi: ['error', 'never'],
eqeqeq: ['error', 'always'],
'no-console': 'warn',
'require-metrics-flag/require-metrics-flag': 'error',
'sort-imports': [
'error',
{
ignoreCase: false,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'single', 'multiple'],
allowSeparatedGroups: true,
},
],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
},
},
{
files: ['**/utils/**/*.{js,mjs}'],
rules: {
'no-console': 'off',
},
},
eslintConfigPrettier
)