@nfq/eslint-config 1.2.7 → 1.2.8
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 +1 -1
- package/rules/imports.js +40 -40
package/package.json
CHANGED
package/rules/imports.js
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
module.exports = {
|
|
5
5
|
rules: {
|
|
6
|
-
'import/default':
|
|
7
|
-
'import/named':
|
|
8
|
-
'import/namespace': [
|
|
6
|
+
'import/default': 2, // ensure default import coupled with default export https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/default.md#when-not-to-use-it
|
|
7
|
+
'import/named': 2, // ensure named imports coupled with named exports https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/named.md#when-not-to-use-it
|
|
8
|
+
'import/namespace': [2, {allowComputed: true}], // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/namespace.md
|
|
9
9
|
'import/no-unresolved': [
|
|
10
|
-
|
|
10
|
+
2,
|
|
11
11
|
{
|
|
12
12
|
caseSensitive: true,
|
|
13
13
|
commonjs: true,
|
|
@@ -16,10 +16,10 @@ module.exports = {
|
|
|
16
16
|
], // ensure imports point to files/modules that can be resolved https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md
|
|
17
17
|
|
|
18
18
|
// Helpful warnings:
|
|
19
|
-
'import/export':
|
|
20
|
-
'import/no-deprecated':
|
|
19
|
+
'import/export': 2, // disallow invalid exports, e.g. multiple defaults https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/export.md
|
|
20
|
+
'import/no-deprecated': 1, // disallow use of jsdoc-marked-deprecated imports https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-deprecated.md
|
|
21
21
|
'import/no-extraneous-dependencies': [
|
|
22
|
-
|
|
22
|
+
0,
|
|
23
23
|
{
|
|
24
24
|
devDependencies: [
|
|
25
25
|
'test/**', // tape, common npm pattern
|
|
@@ -47,24 +47,24 @@ module.exports = {
|
|
|
47
47
|
optionalDependencies: false
|
|
48
48
|
}
|
|
49
49
|
], // Forbid the use of extraneous packages https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md paths are treated both as absolute paths, and relative to process.cwd()
|
|
50
|
-
'import/no-mutable-exports':
|
|
51
|
-
'import/no-named-as-default':
|
|
52
|
-
'import/no-named-as-default-member':
|
|
50
|
+
'import/no-mutable-exports': 2, // Forbid mutable exports https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-mutable-exports.md
|
|
51
|
+
'import/no-named-as-default': 2, // do not allow a default import name to match a named export https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-named-as-default.md
|
|
52
|
+
'import/no-named-as-default-member': 2, // warn on accessing default export property names that are also named exports https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-named-as-default-member.md
|
|
53
53
|
// Module systems:
|
|
54
|
-
'import/no-amd':
|
|
55
|
-
'import/no-commonjs':
|
|
56
|
-
'import/no-nodejs-modules':
|
|
54
|
+
'import/no-amd': 2, // disallow AMD require/define https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-amd.md
|
|
55
|
+
'import/no-commonjs': 0, // disallow require() https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-commonjs.md
|
|
56
|
+
'import/no-nodejs-modules': 0, // No Node.js builtin modules https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-nodejs-modules.md
|
|
57
57
|
// Style guide:
|
|
58
58
|
'import/dynamic-import-chunkname': [
|
|
59
|
-
|
|
59
|
+
2,
|
|
60
60
|
{
|
|
61
61
|
importFunctions: [],
|
|
62
62
|
webpackChunknameFormat: '[0-9a-zA-Z-_/.]+'
|
|
63
63
|
}
|
|
64
64
|
], // dynamic imports require a leading comment with a webpackChunkName https://github.com/benmosher/eslint-plugin-import/blob/ebafcbf59ec9f653b2ac2a0156ca3bcba0a7cf57/docs/rules/dynamic-import-chunkname.md
|
|
65
|
-
'import/exports-last':
|
|
65
|
+
'import/exports-last': 0, // This rule enforces that all exports are declared at the bottom of the file. https://github.com/benmosher/eslint-plugin-import/blob/98acd6afd04dcb6920b81330114e146dc8532ea4/docs/rules/exports-last.md
|
|
66
66
|
'import/extensions': [
|
|
67
|
-
|
|
67
|
+
2,
|
|
68
68
|
'never',
|
|
69
69
|
{
|
|
70
70
|
woff: 'always',
|
|
@@ -74,13 +74,13 @@ module.exports = {
|
|
|
74
74
|
otf: 'always'
|
|
75
75
|
}
|
|
76
76
|
], // Ensure consistent use of file extension within the import path https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/extensions.md
|
|
77
|
-
'import/first':
|
|
78
|
-
'import/group-exports':
|
|
79
|
-
'import/max-dependencies': [
|
|
80
|
-
'import/newline-after-import':
|
|
81
|
-
'import/no-absolute-path':
|
|
77
|
+
'import/first': 2, // disallow non-import statements appearing before import statements https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/first.md
|
|
78
|
+
'import/group-exports': 0, // Reports when named exports are not grouped together in a single export declaration or when multiple assignments to CommonJS module.exports or exports object are present in a single file. https://github.com/benmosher/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/group-exports.md
|
|
79
|
+
'import/max-dependencies': [1, {max: 20}], // Forbid modules to have too many dependencies https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/max-dependencies.md
|
|
80
|
+
'import/newline-after-import': 2, // Require a newline after the last import/require in a group https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/newline-after-import.md
|
|
81
|
+
'import/no-absolute-path': 2, // Forbid import of modules using absolute paths https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-absolute-path.md
|
|
82
82
|
'import/no-anonymous-default-export': [
|
|
83
|
-
|
|
83
|
+
0,
|
|
84
84
|
{
|
|
85
85
|
allowAnonymousClass: false,
|
|
86
86
|
allowAnonymousFunction: false,
|
|
@@ -91,32 +91,32 @@ module.exports = {
|
|
|
91
91
|
}
|
|
92
92
|
], // Reports if a module's default export is unnamed https://github.com/benmosher/eslint-plugin-import/blob/d9b712ac7fd1fddc391f7b234827925c160d956f/docs/rules/no-anonymous-default-export.md
|
|
93
93
|
'import/no-cycle': [
|
|
94
|
-
|
|
94
|
+
0,
|
|
95
95
|
{maxDepth: Infinity}
|
|
96
96
|
], // Forbid cyclical dependencies between modules https://github.com/benmosher/eslint-plugin-import/blob/d81f48a2506182738409805f5272eff4d77c9348/docs/rules/no-cycle.md
|
|
97
|
-
'import/no-default-export':
|
|
98
|
-
'import/no-duplicates':
|
|
99
|
-
'import/no-dynamic-require':
|
|
100
|
-
'import/no-internal-modules': [
|
|
101
|
-
'import/no-named-default':
|
|
102
|
-
'import/no-named-export':
|
|
103
|
-
'import/no-namespace':
|
|
104
|
-
'import/no-relative-parent-imports':
|
|
105
|
-
'import/no-restricted-paths':
|
|
106
|
-
'import/no-self-import':
|
|
107
|
-
'import/no-unassigned-import':
|
|
97
|
+
'import/no-default-export': 0, // forbid default exports. this is a terrible rule, do not use it. https://github.com/benmosher/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/no-default-export.md
|
|
98
|
+
'import/no-duplicates': 2, // disallow duplicate imports https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md
|
|
99
|
+
'import/no-dynamic-require': 0, // Forbid require() calls with expressions https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-dynamic-require.md
|
|
100
|
+
'import/no-internal-modules': [0, {allow: []}], // prevent importing the submodules of other modules https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-internal-modules.md
|
|
101
|
+
'import/no-named-default': 2, // Prevent importing the default as if it were named https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-named-default.md
|
|
102
|
+
'import/no-named-export': 0, // Prohibit named exports. this is a terrible rule, do not use it. https://github.com/benmosher/eslint-plugin-import/blob/1ec80fa35fa1819e2d35a70e68fb6a149fb57c5e/docs/rules/no-named-export.md
|
|
103
|
+
'import/no-namespace': 0, // disallow namespace imports https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-namespace.md
|
|
104
|
+
'import/no-relative-parent-imports': 0, // Use this rule to prevent imports to folders in relative parent paths. https://github.com/benmosher/eslint-plugin-import/blob/c34f14f67f077acd5a61b3da9c0b0de298d20059/docs/rules/no-relative-parent-imports.md
|
|
105
|
+
'import/no-restricted-paths': 0, // Restrict which files can be imported in a given folder https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-restricted-paths.md
|
|
106
|
+
'import/no-self-import': 2, // Forbid a module from importing itself https://github.com/benmosher/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/no-self-import.md
|
|
107
|
+
'import/no-unassigned-import': 0, // Prevent unassigned imports https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unassigned-import.md importing for side effects is perfectly acceptable, if you need side effects.
|
|
108
108
|
'import/no-unused-modules': [
|
|
109
|
-
|
|
109
|
+
0,
|
|
110
110
|
{
|
|
111
111
|
ignoreExports: [],
|
|
112
112
|
missingExports: true,
|
|
113
113
|
unusedExports: true
|
|
114
114
|
}
|
|
115
115
|
], // Reports modules without any exports, or with unused exports https://github.com/benmosher/eslint-plugin-import/blob/f63dd261809de6883b13b6b5b960e6d7f42a7813/docs/rules/no-unused-modules.md
|
|
116
|
-
'import/no-useless-path-segments': [
|
|
117
|
-
'import/no-webpack-loader-syntax':
|
|
116
|
+
'import/no-useless-path-segments': [2, {commonjs: true}], // Ensures that there are no useless path segments https://github.com/benmosher/eslint-plugin-import/blob/ebafcbf59ec9f653b2ac2a0156ca3bcba0a7cf57/docs/rules/no-useless-path-segments.md
|
|
117
|
+
'import/no-webpack-loader-syntax': 2, // Forbid Webpack loader syntax in imports https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-webpack-loader-syntax.md
|
|
118
118
|
'import/order': [
|
|
119
|
-
|
|
119
|
+
2,
|
|
120
120
|
{
|
|
121
121
|
alphabetize: {
|
|
122
122
|
caseInsensitive: true,
|
|
@@ -211,7 +211,7 @@ module.exports = {
|
|
|
211
211
|
pathGroupsExcludedImportTypes: ['react', 'react-dom']
|
|
212
212
|
}
|
|
213
213
|
], // ensure absolute imports are above relative imports and that unassigned imports are ignored https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md
|
|
214
|
-
'import/prefer-default-export':
|
|
215
|
-
'import/unambiguous':
|
|
214
|
+
'import/prefer-default-export': 0, // Require modules with a single export to use a default export https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/prefer-default-export.md
|
|
215
|
+
'import/unambiguous': 0 // Warn if a module could be mistakenly parsed as a script by a consumer leveraging Unambiguous JavaScript Grammar https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/unambiguous.md At the moment, it's not a thing.
|
|
216
216
|
}
|
|
217
217
|
};
|