@viclafouch/eslint-config-viclafouch 3.3.1 → 3.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc-base.js +62 -0
- package/.eslintrc.js +3 -63
- package/package.json +1 -1
- package/typescript.js +5 -2
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
plugins: ['react', 'simple-import-sort'],
|
|
3
|
+
env: {
|
|
4
|
+
browser: true,
|
|
5
|
+
es6: true,
|
|
6
|
+
node: true
|
|
7
|
+
},
|
|
8
|
+
settings: {
|
|
9
|
+
react: {
|
|
10
|
+
version: 'detect'
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
rules: {
|
|
14
|
+
'react/prop-types': 'off',
|
|
15
|
+
'simple-import-sort/imports': 'error',
|
|
16
|
+
'react/jsx-props-no-spreading': 0,
|
|
17
|
+
'import/prefer-default-export': 0,
|
|
18
|
+
'arrow-body-style': ['error', 'always'],
|
|
19
|
+
'react/function-component-definition': [
|
|
20
|
+
2,
|
|
21
|
+
{ namedComponents: 'arrow-function' }
|
|
22
|
+
],
|
|
23
|
+
'prettier/prettier': [
|
|
24
|
+
'error',
|
|
25
|
+
{
|
|
26
|
+
semi: false,
|
|
27
|
+
singleQuote: true,
|
|
28
|
+
printWidth: 80,
|
|
29
|
+
tabWidth: 2,
|
|
30
|
+
jsxSingleQuote: false,
|
|
31
|
+
trailingComma: 'none',
|
|
32
|
+
endOfLine: 'auto',
|
|
33
|
+
bracketSameLine: false,
|
|
34
|
+
arrowParens: 'always'
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
overrides: [
|
|
39
|
+
{
|
|
40
|
+
files: ['*.jsx', '*.js', '*.ts', '*.tsx'],
|
|
41
|
+
rules: {
|
|
42
|
+
'simple-import-sort/imports': [
|
|
43
|
+
'error',
|
|
44
|
+
{
|
|
45
|
+
groups: [
|
|
46
|
+
// Packages. `react` related packages come first.
|
|
47
|
+
// Things that start with a letter (or digit or underscore), or `@` followed by a letter.
|
|
48
|
+
['^react', '^next', '^@mui(/.*|$)', '^@?\\w'],
|
|
49
|
+
// Absolute imports and Relative imports.
|
|
50
|
+
[
|
|
51
|
+
'^(utils|services|hooks|hoc|types|contexts|dictionary|components)(/.*|$)',
|
|
52
|
+
'^\\.'
|
|
53
|
+
],
|
|
54
|
+
// for scss imports.
|
|
55
|
+
['^[^.]']
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
package/.eslintrc.js
CHANGED
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
plugins: ['react', 'simple-import-sort'],
|
|
3
2
|
extends: [
|
|
4
|
-
'eslint:recommended',
|
|
5
3
|
'airbnb',
|
|
6
4
|
'airbnb/hooks',
|
|
7
|
-
'plugin:prettier/recommended'
|
|
5
|
+
'plugin:prettier/recommended',
|
|
6
|
+
'./.eslintrc-base.js'
|
|
8
7
|
],
|
|
9
|
-
env: {
|
|
10
|
-
browser: true,
|
|
11
|
-
es6: true,
|
|
12
|
-
node: true
|
|
13
|
-
},
|
|
14
8
|
parser: '@babel/eslint-parser',
|
|
15
|
-
settings: {
|
|
16
|
-
react: {
|
|
17
|
-
version: 'detect'
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
9
|
parserOptions: {
|
|
21
10
|
requireConfigFile: false,
|
|
22
11
|
ecmaVersion: 'latest',
|
|
@@ -24,54 +13,5 @@ module.exports = {
|
|
|
24
13
|
ecmaFeatures: {
|
|
25
14
|
jsx: true
|
|
26
15
|
}
|
|
27
|
-
}
|
|
28
|
-
rules: {
|
|
29
|
-
'react/prop-types': 'off',
|
|
30
|
-
'simple-import-sort/imports': 'error',
|
|
31
|
-
'react/jsx-props-no-spreading': 0,
|
|
32
|
-
'import/prefer-default-export': 0,
|
|
33
|
-
'arrow-body-style': ['error', 'always'],
|
|
34
|
-
'react/function-component-definition': [
|
|
35
|
-
2,
|
|
36
|
-
{ namedComponents: 'arrow-function' }
|
|
37
|
-
],
|
|
38
|
-
'prettier/prettier': [
|
|
39
|
-
'error',
|
|
40
|
-
{
|
|
41
|
-
semi: false,
|
|
42
|
-
singleQuote: true,
|
|
43
|
-
printWidth: 80,
|
|
44
|
-
tabWidth: 2,
|
|
45
|
-
jsxSingleQuote: false,
|
|
46
|
-
trailingComma: 'none',
|
|
47
|
-
endOfLine: 'auto',
|
|
48
|
-
bracketSameLine: false,
|
|
49
|
-
arrowParens: 'always'
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
},
|
|
53
|
-
overrides: [
|
|
54
|
-
{
|
|
55
|
-
files: ['*.jsx', '*.js', '*.ts', '*.tsx'],
|
|
56
|
-
rules: {
|
|
57
|
-
'simple-import-sort/imports': [
|
|
58
|
-
'error',
|
|
59
|
-
{
|
|
60
|
-
groups: [
|
|
61
|
-
// Packages. `react` related packages come first.
|
|
62
|
-
// Things that start with a letter (or digit or underscore), or `@` followed by a letter.
|
|
63
|
-
['^react', '^next', '^@mui(/.*|$)', '^@?\\w'],
|
|
64
|
-
// Absolute imports and Relative imports.
|
|
65
|
-
[
|
|
66
|
-
'^(utils|services|hooks|hoc|types|contexts|dictionary|components)(/.*|$)',
|
|
67
|
-
'^\\.'
|
|
68
|
-
],
|
|
69
|
-
// for scss imports.
|
|
70
|
-
['^[^.]']
|
|
71
|
-
]
|
|
72
|
-
}
|
|
73
|
-
]
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
]
|
|
16
|
+
}
|
|
77
17
|
}
|
package/package.json
CHANGED
package/typescript.js
CHANGED
|
@@ -2,12 +2,15 @@ module.exports = {
|
|
|
2
2
|
extends: [
|
|
3
3
|
'airbnb',
|
|
4
4
|
'airbnb-typescript',
|
|
5
|
+
'airbnb/hooks',
|
|
5
6
|
'plugin:@typescript-eslint/recommended',
|
|
6
|
-
'
|
|
7
|
+
'plugin:prettier/recommended',
|
|
8
|
+
'./.eslintrc-base.js'
|
|
7
9
|
],
|
|
8
10
|
parser: '@typescript-eslint/parser',
|
|
9
11
|
plugins: ['react', '@typescript-eslint', 'simple-import-sort'],
|
|
10
12
|
rules: {
|
|
11
|
-
'@typescript-eslint/ban-ts-comment': 'off'
|
|
13
|
+
'@typescript-eslint/ban-ts-comment': 'off',
|
|
14
|
+
'react/jsx-filename-extension': [1, { extensions: ['.ts', '.tsx'] }]
|
|
12
15
|
}
|
|
13
16
|
}
|