-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
78 lines (76 loc) · 2.05 KB
/
eslint.config.js
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
import cspellPlugin from '@cspell/eslint-plugin'
import js from '@eslint/js'
import perfectionist from 'eslint-plugin-perfectionist'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import globals from 'globals'
import tseslint from 'typescript-eslint'
const perf = ['warn', { type: 'natural' }]
export default tseslint.config({
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{js,jsx,ts,tsx}'],
ignores: ['**/dist/**', '**/coverage/**'],
languageOptions: {
ecmaVersion: 2022,
globals: globals.browser,
},
plugins: {
'@cspell': cspellPlugin,
perfectionist,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'@cspell/spellchecker': [
'warn',
{
cspell: {
words: [
'constellar',
'elems',
'Lamarche',
'prncss',
'rambda',
'removables',
'tseslint',
],
},
},
],
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'no-console': 'warn',
'no-constant-condition': 'off',
'no-else-return': 'warn',
'no-empty': 'warn',
'perfectionist/sort-array-includes': perf,
'perfectionist/sort-classes': perf,
'perfectionist/sort-enums': perf,
'perfectionist/sort-exports': perf,
'perfectionist/sort-imports': perf,
'perfectionist/sort-interfaces': perf,
'perfectionist/sort-intersection-types': perf,
'perfectionist/sort-jsx-props': perf,
'perfectionist/sort-maps': perf,
'perfectionist/sort-named-exports': perf,
'perfectionist/sort-named-imports': perf,
'perfectionist/sort-object-types': perf,
'perfectionist/sort-objects': perf,
'perfectionist/sort-sets': perf,
'perfectionist/sort-switch-case': perf,
'perfectionist/sort-union-types': perf,
'perfectionist/sort-variable-declarations': perf,
'prefer-const': 'warn',
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
})