-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
78 lines (76 loc) · 2.58 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
// @ts-check
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import stylistic from '@stylistic/eslint-plugin';
import reactlint from 'eslint-plugin-react';
import tailwindlint from 'eslint-plugin-tailwindcss';
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
languageOptions: {
globals: {
'browser': true,
'process': true,
'document': true,
'localStorage': true,
'window': true,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
'@stylistic': stylistic,
'react': reactlint,
'tailwindcss': tailwindlint,
},
settings: {
'react': {
'version': 'detect',
},
},
// @ts-expect-error reactlint typing is wrong
rules: {
'@stylistic/quotes': [ 'error', 'single' ],
'@stylistic/indent': [ 'error', 4 ],
'@stylistic/array-bracket-spacing': [ 'error', 'always', {
'arraysInArrays': false,
'objectsInArrays': false,
}],
'@stylistic/semi': [ 'error', 'always' ],
'@stylistic/comma-dangle': [ 'error', {
'arrays': 'always-multiline',
'objects': 'always-multiline',
'imports': 'always-multiline',
'exports': 'always-multiline',
'functions': 'always-multiline',
'enums': 'always-multiline',
}],
'@typescript-eslint/member-delimiter-style': [ 'error', {
'multiline': {
'delimiter': 'semi',
'requireLast': true,
},
}],
'react/jsx-curly-spacing': [ 'error', {
'when': 'always',
'children': {
'when': 'always',
},
}],
'react/jsx-first-prop-new-line': [ 'error', 'multiline-multiprop' ],
'react/jsx-max-props-per-line': [ 'error', {
'maximum': 1,
'when': 'multiline',
}],
'react/jsx-closing-tag-location': [ 'error' ],
'react/jsx-closing-bracket-location': [ 'error' ],
'react/self-closing-comp': [ 'error' ],
...reactlint.configs.recommended.rules,
...tailwindlint.configs.recommended.rules,
},
},
);