@paratco/eslint-config 0.7.1 → 0.7.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/package.json +2 -1
- package/src/lints/import/index.js +171 -159
- package/src/lints/stylistic/index.js +529 -529
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paratco/eslint-config",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Paratco",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"@stylistic/eslint-plugin": "^2.3.0",
|
|
30
30
|
"@types/eslint__js": "^8.42.3",
|
|
31
31
|
"eslint-config-prettier": "^9.1.0",
|
|
32
|
+
"eslint-import-resolver-typescript": "^3.6.1",
|
|
32
33
|
"eslint-plugin-import": "^2.29.1",
|
|
33
34
|
"eslint-plugin-react": "^7.34.3",
|
|
34
35
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
@@ -1,159 +1,171 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-deprecated.md
|
|
3
|
-
// Forbid imported names marked with @deprecated documentation tag.
|
|
4
|
-
"import/no-deprecated": ["error"],
|
|
5
|
-
|
|
6
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-empty-named-blocks.md
|
|
7
|
-
// Forbid empty named import blocks.
|
|
8
|
-
"import/no-empty-named-blocks": ["warn"],
|
|
9
|
-
|
|
10
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md
|
|
11
|
-
// Forbid the use of extraneous packages.
|
|
12
|
-
"import/no-extraneous-dependencies": [
|
|
13
|
-
"error",
|
|
14
|
-
{ devDependencies: false, optionalDependencies: false, peerDependencies: false }
|
|
15
|
-
],
|
|
16
|
-
|
|
17
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-mutable-exports.md
|
|
18
|
-
// Forbid the use of mutable exports with var or let.
|
|
19
|
-
"import/no-mutable-exports": ["error"],
|
|
20
|
-
|
|
21
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-unused-modules.md
|
|
22
|
-
// Forbid modules without exports, or exports without matching import in another module.
|
|
23
|
-
// TODO: Can be enabled
|
|
24
|
-
"import/no-unused-modules": ["off", { missingExports: true }],
|
|
25
|
-
|
|
26
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-amd.md
|
|
27
|
-
// Forbid AMD require and define calls.
|
|
28
|
-
"import/no-amd": ["error"],
|
|
29
|
-
|
|
30
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-commonjs.md
|
|
31
|
-
// Forbid CommonJS require calls and module.exports or exports.*.
|
|
32
|
-
"import/no-commonjs": ["error"],
|
|
33
|
-
|
|
34
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-import-module-exports.md
|
|
35
|
-
// Forbid import statements with CommonJS module.exports.
|
|
36
|
-
"import/no-import-module-exports": ["warn"],
|
|
37
|
-
|
|
38
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-nodejs-modules.md
|
|
39
|
-
// Forbid Node.js builtin modules.
|
|
40
|
-
// TODO: Can enable for front-end
|
|
41
|
-
"import/no-nodejs-modules": ["off"],
|
|
42
|
-
|
|
43
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/unambiguous.md
|
|
44
|
-
// Forbid potentially ambiguous parse goal (script vs. module).
|
|
45
|
-
"import/unambiguous": ["error"],
|
|
46
|
-
|
|
47
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-absolute-path.md
|
|
48
|
-
// Forbid import of modules using absolute paths.
|
|
49
|
-
"import/no-absolute-path": ["warn"],
|
|
50
|
-
|
|
51
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-cycle.md
|
|
52
|
-
// Forbid a module from importing a module with a dependency path back to itself.
|
|
53
|
-
"import/no-cycle": ["error"],
|
|
54
|
-
|
|
55
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-dynamic-require.md
|
|
56
|
-
// Forbid require() calls with expressions.
|
|
57
|
-
"import/no-dynamic-require": ["off"],
|
|
58
|
-
|
|
59
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-internal-modules.md
|
|
60
|
-
// Forbid importing the submodules of other modules.
|
|
61
|
-
// TODO: Must define in the project
|
|
62
|
-
"import/no-internal-modules": ["off"],
|
|
63
|
-
|
|
64
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-relative-packages.md
|
|
65
|
-
// Forbid importing packages through relative paths.
|
|
66
|
-
"import/no-relative-packages": ["warn"],
|
|
67
|
-
|
|
68
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-relative-parent-imports.md
|
|
69
|
-
// Forbid importing modules from parent directories.
|
|
70
|
-
"import/no-relative-parent-imports": ["off"],
|
|
71
|
-
|
|
72
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-restricted-paths.md
|
|
73
|
-
// Enforce which files can be imported in a given folder.
|
|
74
|
-
// TODO: Can be customized
|
|
75
|
-
// "import/no-restricted-paths": ["off"],
|
|
76
|
-
|
|
77
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-self-import.md
|
|
78
|
-
// Forbid a module from importing itself.
|
|
79
|
-
"import/no-self-import": ["error"],
|
|
80
|
-
|
|
81
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-useless-path-segments.md
|
|
82
|
-
// Forbid unnecessary path segments in import and require statements.
|
|
83
|
-
"import/no-useless-path-segments": [
|
|
84
|
-
"warn",
|
|
85
|
-
{
|
|
86
|
-
noUselessIndex: true
|
|
87
|
-
}
|
|
88
|
-
],
|
|
89
|
-
|
|
90
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-webpack-loader-syntax.md
|
|
91
|
-
// Forbid webpack loader syntax in imports.
|
|
92
|
-
"import/no-webpack-loader-syntax": ["error"],
|
|
93
|
-
|
|
94
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/consistent-type-specifier-style.md
|
|
95
|
-
// Enforce or ban the use of inline type-only markers for named imports.
|
|
96
|
-
"import/consistent-type-specifier-style": ["warn", "prefer-top-level"],
|
|
97
|
-
|
|
98
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/dynamic-import-chunkname.md
|
|
99
|
-
// Enforce a leading comment with the webpackChunkName for dynamic imports.
|
|
100
|
-
"import/dynamic-import-chunkname": ["error"],
|
|
101
|
-
|
|
102
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/exports-last.md
|
|
103
|
-
// Ensure all exports appear after other statements.
|
|
104
|
-
// TODO: Can be enabled
|
|
105
|
-
"import/exports-last": ["off"],
|
|
106
|
-
|
|
107
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/extensions.md
|
|
108
|
-
// Ensure consistent use of file extension within the import path.
|
|
109
|
-
"import/extensions": ["error", "never"],
|
|
110
|
-
|
|
111
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/first.md
|
|
112
|
-
// Ensure all imports appear before other statements.
|
|
113
|
-
"import/first": ["warn"],
|
|
114
|
-
|
|
115
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/group-exports.md
|
|
116
|
-
// Prefer named exports to be grouped together in a single export declaration
|
|
117
|
-
// TODO: Can be enabled
|
|
118
|
-
"import/group-exports": ["off"],
|
|
119
|
-
|
|
120
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/max-dependencies.md
|
|
121
|
-
// Enforce the maximum number of dependencies a module can have.
|
|
122
|
-
"import/max-dependencies": ["off"],
|
|
123
|
-
|
|
124
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/newline-after-import.md
|
|
125
|
-
// Enforce a newline after import statements.
|
|
126
|
-
"import/newline-after-import": ["warn"],
|
|
127
|
-
|
|
128
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-anonymous-default-export.md
|
|
129
|
-
// Forbid anonymous values as default exports.
|
|
130
|
-
"import/no-anonymous-default-export": [
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-
|
|
145
|
-
// Forbid
|
|
146
|
-
"import/no-
|
|
147
|
-
|
|
148
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-
|
|
149
|
-
// Forbid
|
|
150
|
-
"import/no-
|
|
151
|
-
|
|
152
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/
|
|
153
|
-
//
|
|
154
|
-
"import/
|
|
155
|
-
|
|
156
|
-
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/
|
|
157
|
-
//
|
|
158
|
-
"import/
|
|
159
|
-
|
|
1
|
+
export default {
|
|
2
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-deprecated.md
|
|
3
|
+
// Forbid imported names marked with @deprecated documentation tag.
|
|
4
|
+
"import/no-deprecated": ["error"],
|
|
5
|
+
|
|
6
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-empty-named-blocks.md
|
|
7
|
+
// Forbid empty named import blocks.
|
|
8
|
+
"import/no-empty-named-blocks": ["warn"],
|
|
9
|
+
|
|
10
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md
|
|
11
|
+
// Forbid the use of extraneous packages.
|
|
12
|
+
"import/no-extraneous-dependencies": [
|
|
13
|
+
"error",
|
|
14
|
+
{ devDependencies: false, optionalDependencies: false, peerDependencies: false }
|
|
15
|
+
],
|
|
16
|
+
|
|
17
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-mutable-exports.md
|
|
18
|
+
// Forbid the use of mutable exports with var or let.
|
|
19
|
+
"import/no-mutable-exports": ["error"],
|
|
20
|
+
|
|
21
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-unused-modules.md
|
|
22
|
+
// Forbid modules without exports, or exports without matching import in another module.
|
|
23
|
+
// TODO: Can be enabled
|
|
24
|
+
"import/no-unused-modules": ["off", { missingExports: true }],
|
|
25
|
+
|
|
26
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-amd.md
|
|
27
|
+
// Forbid AMD require and define calls.
|
|
28
|
+
"import/no-amd": ["error"],
|
|
29
|
+
|
|
30
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-commonjs.md
|
|
31
|
+
// Forbid CommonJS require calls and module.exports or exports.*.
|
|
32
|
+
"import/no-commonjs": ["error"],
|
|
33
|
+
|
|
34
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-import-module-exports.md
|
|
35
|
+
// Forbid import statements with CommonJS module.exports.
|
|
36
|
+
"import/no-import-module-exports": ["warn"],
|
|
37
|
+
|
|
38
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-nodejs-modules.md
|
|
39
|
+
// Forbid Node.js builtin modules.
|
|
40
|
+
// TODO: Can enable for front-end
|
|
41
|
+
"import/no-nodejs-modules": ["off"],
|
|
42
|
+
|
|
43
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/unambiguous.md
|
|
44
|
+
// Forbid potentially ambiguous parse goal (script vs. module).
|
|
45
|
+
"import/unambiguous": ["error"],
|
|
46
|
+
|
|
47
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-absolute-path.md
|
|
48
|
+
// Forbid import of modules using absolute paths.
|
|
49
|
+
"import/no-absolute-path": ["warn"],
|
|
50
|
+
|
|
51
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-cycle.md
|
|
52
|
+
// Forbid a module from importing a module with a dependency path back to itself.
|
|
53
|
+
"import/no-cycle": ["error"],
|
|
54
|
+
|
|
55
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-dynamic-require.md
|
|
56
|
+
// Forbid require() calls with expressions.
|
|
57
|
+
"import/no-dynamic-require": ["off"],
|
|
58
|
+
|
|
59
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-internal-modules.md
|
|
60
|
+
// Forbid importing the submodules of other modules.
|
|
61
|
+
// TODO: Must define in the project
|
|
62
|
+
"import/no-internal-modules": ["off"],
|
|
63
|
+
|
|
64
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-relative-packages.md
|
|
65
|
+
// Forbid importing packages through relative paths.
|
|
66
|
+
"import/no-relative-packages": ["warn"],
|
|
67
|
+
|
|
68
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-relative-parent-imports.md
|
|
69
|
+
// Forbid importing modules from parent directories.
|
|
70
|
+
"import/no-relative-parent-imports": ["off"],
|
|
71
|
+
|
|
72
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-restricted-paths.md
|
|
73
|
+
// Enforce which files can be imported in a given folder.
|
|
74
|
+
// TODO: Can be customized
|
|
75
|
+
// "import/no-restricted-paths": ["off"],
|
|
76
|
+
|
|
77
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-self-import.md
|
|
78
|
+
// Forbid a module from importing itself.
|
|
79
|
+
"import/no-self-import": ["error"],
|
|
80
|
+
|
|
81
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-useless-path-segments.md
|
|
82
|
+
// Forbid unnecessary path segments in import and require statements.
|
|
83
|
+
"import/no-useless-path-segments": [
|
|
84
|
+
"warn",
|
|
85
|
+
{
|
|
86
|
+
noUselessIndex: true
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
|
|
90
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-webpack-loader-syntax.md
|
|
91
|
+
// Forbid webpack loader syntax in imports.
|
|
92
|
+
"import/no-webpack-loader-syntax": ["error"],
|
|
93
|
+
|
|
94
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/consistent-type-specifier-style.md
|
|
95
|
+
// Enforce or ban the use of inline type-only markers for named imports.
|
|
96
|
+
"import/consistent-type-specifier-style": ["warn", "prefer-top-level"],
|
|
97
|
+
|
|
98
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/dynamic-import-chunkname.md
|
|
99
|
+
// Enforce a leading comment with the webpackChunkName for dynamic imports.
|
|
100
|
+
"import/dynamic-import-chunkname": ["error"],
|
|
101
|
+
|
|
102
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/exports-last.md
|
|
103
|
+
// Ensure all exports appear after other statements.
|
|
104
|
+
// TODO: Can be enabled
|
|
105
|
+
"import/exports-last": ["off"],
|
|
106
|
+
|
|
107
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/extensions.md
|
|
108
|
+
// Ensure consistent use of file extension within the import path.
|
|
109
|
+
"import/extensions": ["error", "never"],
|
|
110
|
+
|
|
111
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/first.md
|
|
112
|
+
// Ensure all imports appear before other statements.
|
|
113
|
+
"import/first": ["warn"],
|
|
114
|
+
|
|
115
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/group-exports.md
|
|
116
|
+
// Prefer named exports to be grouped together in a single export declaration
|
|
117
|
+
// TODO: Can be enabled
|
|
118
|
+
"import/group-exports": ["off"],
|
|
119
|
+
|
|
120
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/max-dependencies.md
|
|
121
|
+
// Enforce the maximum number of dependencies a module can have.
|
|
122
|
+
"import/max-dependencies": ["off"],
|
|
123
|
+
|
|
124
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/newline-after-import.md
|
|
125
|
+
// Enforce a newline after import statements.
|
|
126
|
+
"import/newline-after-import": ["warn"],
|
|
127
|
+
|
|
128
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-anonymous-default-export.md
|
|
129
|
+
// Forbid anonymous values as default exports.
|
|
130
|
+
"import/no-anonymous-default-export": [
|
|
131
|
+
"error",
|
|
132
|
+
{
|
|
133
|
+
allowArray: false,
|
|
134
|
+
allowArrowFunction: true,
|
|
135
|
+
allowAnonymousClass: false,
|
|
136
|
+
allowAnonymousFunction: false,
|
|
137
|
+
allowCallExpression: true, // The true value here is for backward compatibility
|
|
138
|
+
allowNew: false,
|
|
139
|
+
allowLiteral: false,
|
|
140
|
+
allowObject: false
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
|
|
144
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-default-export.md
|
|
145
|
+
// Forbid default exports.
|
|
146
|
+
"import/no-default-export": ["off"],
|
|
147
|
+
|
|
148
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-default.md
|
|
149
|
+
// Forbid named default exports.
|
|
150
|
+
"import/no-named-default": ["off"],
|
|
151
|
+
|
|
152
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-export.md
|
|
153
|
+
// Forbid named exports.
|
|
154
|
+
"import/no-named-export": ["off"],
|
|
155
|
+
|
|
156
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-namespace.md
|
|
157
|
+
// Forbid namespace (a.k.a. "wildcard" *) imports.
|
|
158
|
+
"import/no-namespace": ["warn"],
|
|
159
|
+
|
|
160
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-unassigned-import.md
|
|
161
|
+
// Forbid unassigned imports
|
|
162
|
+
"import/no-unassigned-import": ["error", { allow: ["**/*.css"] }],
|
|
163
|
+
|
|
164
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
|
|
165
|
+
// Enforce a convention in module import order.
|
|
166
|
+
"import/order": ["warn"],
|
|
167
|
+
|
|
168
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/prefer-default-export.md
|
|
169
|
+
// Prefer a default export if module exports a single name or multiple names.
|
|
170
|
+
"import/prefer-default-export": ["off"]
|
|
171
|
+
};
|