@pob/eslint-config 56.0.0 → 57.0.0
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/CHANGELOG.md +24 -1
- package/lib/_base.js +39 -15
- package/lib/base/commonjs.js +8 -4
- package/lib/base/module.js +22 -4
- package/lib/index.js +67 -13
- package/lib/node/_base.js +10 -18
- package/lib/node/commonjs.js +13 -23
- package/lib/node/module.js +21 -30
- package/lib/plugins/import/import-base.js +105 -72
- package/lib/plugins/import/import-commonjs.js +1 -3
- package/lib/plugins/import/import-module.js +1 -3
- package/lib/plugins/unicorn.js +238 -239
- package/lib/rules/best-practices.js +11 -5
- package/lib/rules/code-quality.js +1 -3
- package/lib/rules/dev-only.js +3 -3
- package/lib/rules/errors.js +1 -3
- package/lib/rules/style.js +1 -3
- package/package.json +9 -8
- package/utils.js +1 -3
- package/lib/.eslintrc.json +0 -4
- package/lib/node-commonjs.js +0 -25
- package/lib/node-module.js +0 -25
- package/lib/root-commonjs.js +0 -6
- package/lib/root-module.js +0 -6
- package/lib/rules/modules/base.js +0 -8
- package/lib/rules/modules/commonjs.js +0 -11
- package/lib/rules/modules/esm.js +0 -25
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,29 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [57.0.0](https://github.com/christophehurpeau/eslint-config-pob/compare/v56.1.0...v57.0.0) (2024-08-11)
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
* use flat config
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* add baseModule ([c1e7cef](https://github.com/christophehurpeau/eslint-config-pob/commit/c1e7cef19d835b3ab0333b4588d1810e09874d53))
|
|
15
|
+
* use flat config ([b0bda47](https://github.com/christophehurpeau/eslint-config-pob/commit/b0bda47976ec40a30679988c603d425f9b75346f))
|
|
16
|
+
|
|
17
|
+
Version bump for dependency: @pob/eslint-plugin
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## [56.1.0](https://github.com/christophehurpeau/eslint-config-pob/compare/v56.0.0...v56.1.0) (2024-07-27)
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* pob plugin ([fd99ec8](https://github.com/christophehurpeau/eslint-config-pob/commit/fd99ec8711409b3bc9b960f7eb2e0b2e67984381))
|
|
25
|
+
|
|
26
|
+
Version bump for dependency: @pob/eslint-plugin
|
|
27
|
+
|
|
28
|
+
|
|
6
29
|
## [56.0.0](https://github.com/christophehurpeau/eslint-config-pob/compare/v55.3.0...v56.0.0) (2024-05-05)
|
|
7
30
|
|
|
8
31
|
|
|
@@ -505,7 +528,7 @@ Note: no notable changes
|
|
|
505
528
|
|
|
506
529
|
### BREAKING CHANGES
|
|
507
530
|
|
|
508
|
-
* **deps:** requires eslint-plugin-unicorn 34 and enable new rules
|
|
531
|
+
* **deps:** requires eslint-plugin-unicorn 34 and enable new rules
|
|
509
532
|
* requires new min supported node versions
|
|
510
533
|
|
|
511
534
|
|
package/lib/_base.js
CHANGED
|
@@ -1,16 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import pobPlugin from "@pob/eslint-plugin";
|
|
3
|
+
import unicornPluginConfigs from "./plugins/unicorn.js";
|
|
4
|
+
import bestPracticesConfig from "./rules/best-practices.js";
|
|
5
|
+
import codeQualityConfig from "./rules/code-quality.js";
|
|
6
|
+
import devOnlyConfig from "./rules/dev-only.js";
|
|
7
|
+
import errorsConfig from "./rules/errors.js";
|
|
8
|
+
import styleConfig from "./rules/style.js";
|
|
2
9
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
export default [
|
|
11
|
+
{
|
|
12
|
+
linterOptions: {
|
|
13
|
+
// todo noInlineConfig: true,
|
|
14
|
+
reportUnusedDisableDirectives: "error",
|
|
15
|
+
},
|
|
16
|
+
plugins: {
|
|
17
|
+
"@pob": pobPlugin,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
ignores: [".yarn", "**/dist/", "**/build/", "**/coverage/"],
|
|
22
|
+
},
|
|
23
|
+
js.configs.recommended,
|
|
24
|
+
pobPlugin.configs.base,
|
|
25
|
+
...unicornPluginConfigs,
|
|
26
|
+
bestPracticesConfig,
|
|
27
|
+
codeQualityConfig,
|
|
28
|
+
errorsConfig,
|
|
29
|
+
styleConfig,
|
|
30
|
+
devOnlyConfig,
|
|
31
|
+
|
|
32
|
+
// TODO
|
|
33
|
+
// {
|
|
34
|
+
// files: ["*.json"],
|
|
35
|
+
// languageOptions: {
|
|
36
|
+
// parser: jsoncParser,
|
|
37
|
+
// },
|
|
38
|
+
// rules: {},
|
|
39
|
+
// },
|
|
40
|
+
];
|
package/lib/base/commonjs.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
parserOptions: {
|
|
1
|
+
export default {
|
|
2
|
+
languageOptions: {
|
|
5
3
|
sourceType: "script",
|
|
6
4
|
},
|
|
7
5
|
rules: {
|
|
8
6
|
strict: ["error", "safe"],
|
|
7
|
+
|
|
8
|
+
// https://eslint.org/docs/rules/global-require
|
|
9
|
+
"global-require": "error",
|
|
10
|
+
|
|
11
|
+
// disallow use of new operator with the require function
|
|
12
|
+
"no-new-require": "error",
|
|
9
13
|
},
|
|
10
14
|
};
|
package/lib/base/module.js
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
parserOptions: {
|
|
1
|
+
export default {
|
|
2
|
+
languageOptions: {
|
|
5
3
|
sourceType: "module",
|
|
6
4
|
},
|
|
7
5
|
rules: {
|
|
8
6
|
strict: "off",
|
|
7
|
+
|
|
8
|
+
// replaced by import/no-duplicates
|
|
9
|
+
"no-duplicate-imports": "off",
|
|
10
|
+
|
|
11
|
+
// https://eslint.org/docs/rules/no-restricted-exports
|
|
12
|
+
"no-restricted-exports": [
|
|
13
|
+
"error",
|
|
14
|
+
{
|
|
15
|
+
restrictDefaultExports: {
|
|
16
|
+
direct: false, // permits `export default` declarations
|
|
17
|
+
named: true, // restricts `export { foo as default };` declarations
|
|
18
|
+
defaultFrom: false, // permits `export { default } from 'foo';` declarations
|
|
19
|
+
namedFrom: false, // permits `export { foo as default } from 'foo';` declarations
|
|
20
|
+
namespaceFrom: true, // restricts `export * as default from 'foo';` declarations
|
|
21
|
+
},
|
|
22
|
+
restrictedNamedExports: [
|
|
23
|
+
"then", // this will cause tons of confusion when your module is dynamically `import()`ed, and will break in most node ESM versions
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
],
|
|
9
27
|
},
|
|
10
28
|
};
|
package/lib/index.js
CHANGED
|
@@ -1,20 +1,74 @@
|
|
|
1
|
-
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { FlatCompat } from "@eslint/eslintrc";
|
|
4
|
+
import baseConfigs from "./_base.js";
|
|
5
|
+
import baseCommonjsConfig from "./base/commonjs.js";
|
|
6
|
+
import baseModuleConfig from "./base/module.js";
|
|
7
|
+
import nodePluginCommonjsConfigs from "./node/commonjs.js";
|
|
8
|
+
import nodePluginModuleConfigs from "./node/module.js";
|
|
9
|
+
import importPluginBaseConfigs from "./plugins/import/import-base.js";
|
|
10
|
+
import importPluginCommonjsConfig from "./plugins/import/import-commonjs.js";
|
|
11
|
+
import importPluginModuleConfig from "./plugins/import/import-module.js";
|
|
2
12
|
|
|
3
|
-
|
|
4
|
-
|
|
13
|
+
export default (url) => {
|
|
14
|
+
const __filename = fileURLToPath(url);
|
|
15
|
+
const __dirname = path.dirname(__filename);
|
|
5
16
|
|
|
6
|
-
|
|
17
|
+
const compat = new FlatCompat({
|
|
18
|
+
baseDirectory: __dirname,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const nodeCommonjs = [
|
|
22
|
+
...baseConfigs,
|
|
23
|
+
baseCommonjsConfig,
|
|
24
|
+
...importPluginBaseConfigs(compat),
|
|
25
|
+
importPluginCommonjsConfig,
|
|
26
|
+
...nodePluginCommonjsConfigs,
|
|
27
|
+
|
|
28
|
+
{
|
|
29
|
+
files: ["**/*.mjs"],
|
|
30
|
+
...baseModuleConfig,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
files: ["**/*.mjs"],
|
|
34
|
+
...importPluginModuleConfig,
|
|
35
|
+
},
|
|
36
|
+
...nodePluginModuleConfigs.map((config) => ({
|
|
37
|
+
...config,
|
|
38
|
+
files: ["**/*.mjs"],
|
|
39
|
+
})),
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
const baseModule = [
|
|
43
|
+
...baseConfigs,
|
|
44
|
+
baseModuleConfig,
|
|
45
|
+
...importPluginBaseConfigs(compat),
|
|
46
|
+
importPluginModuleConfig,
|
|
7
47
|
{
|
|
8
|
-
files: ["
|
|
9
|
-
|
|
10
|
-
require.resolve
|
|
11
|
-
),
|
|
48
|
+
files: ["**/*.cjs"],
|
|
49
|
+
...baseCommonjsConfig,
|
|
12
50
|
},
|
|
13
51
|
{
|
|
14
|
-
files: ["
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
52
|
+
files: ["**/*.cjs"],
|
|
53
|
+
...importPluginCommonjsConfig,
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
const nodeModule = [
|
|
58
|
+
...baseModule,
|
|
59
|
+
...nodePluginModuleConfigs,
|
|
60
|
+
...nodePluginCommonjsConfigs.map((config) => ({
|
|
61
|
+
...config,
|
|
62
|
+
files: ["**/*.cjs"],
|
|
63
|
+
})),
|
|
64
|
+
];
|
|
65
|
+
|
|
66
|
+
return {
|
|
67
|
+
compat,
|
|
68
|
+
configs: {
|
|
69
|
+
baseModule,
|
|
70
|
+
nodeModule,
|
|
71
|
+
nodeCommonjs,
|
|
18
72
|
},
|
|
19
|
-
|
|
73
|
+
};
|
|
20
74
|
};
|
package/lib/node/_base.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.overrideRules = {
|
|
1
|
+
export const overrideRules = {
|
|
4
2
|
// Disable rules already checked by import plugin
|
|
5
3
|
"n/no-unpublished-require": "off",
|
|
6
4
|
"n/no-extraneous-require": "off",
|
|
@@ -25,19 +23,13 @@ exports.overrideRules = {
|
|
|
25
23
|
"no-sync": "off",
|
|
26
24
|
|
|
27
25
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/import/extensions.md
|
|
28
|
-
"import/extensions": [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
],
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
exports.env = {
|
|
40
|
-
browser: false,
|
|
41
|
-
node: true,
|
|
42
|
-
es6: true,
|
|
26
|
+
// "import/extensions": [
|
|
27
|
+
// "error",
|
|
28
|
+
// "ignorePackages",
|
|
29
|
+
// {
|
|
30
|
+
// mjs: "always",
|
|
31
|
+
// cjs: "always",
|
|
32
|
+
// js: "never",
|
|
33
|
+
// },
|
|
34
|
+
// ],
|
|
43
35
|
};
|
package/lib/node/commonjs.js
CHANGED
|
@@ -1,24 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// top level await is introduced in 2022
|
|
14
|
-
// current ecmaVersion in eslint-plugin-node is 2019
|
|
15
|
-
ecmaVersion: 2022,
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
rules: {
|
|
19
|
-
...overrideRules,
|
|
20
|
-
"unicorn/prefer-module": "off",
|
|
21
|
-
"n/no-new-require": "error",
|
|
22
|
-
"n/no-path-concat": "error",
|
|
1
|
+
import nodePlugin from "eslint-plugin-n";
|
|
2
|
+
import { overrideRules } from "./_base.js";
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
nodePlugin.configs["flat/recommended-script"],
|
|
6
|
+
{
|
|
7
|
+
rules: {
|
|
8
|
+
...overrideRules,
|
|
9
|
+
// "unicorn/prefer-module": "off",
|
|
10
|
+
"n/no-new-require": "error",
|
|
11
|
+
"n/no-path-concat": "error",
|
|
12
|
+
},
|
|
23
13
|
},
|
|
24
|
-
|
|
14
|
+
];
|
package/lib/node/module.js
CHANGED
|
@@ -1,33 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
import nodePlugin from "eslint-plugin-n";
|
|
2
|
+
import { overrideRules } from "./_base.js";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
export default [
|
|
5
|
+
nodePlugin.configs["flat/recommended-module"],
|
|
6
|
+
{
|
|
7
|
+
rules: {
|
|
8
|
+
...overrideRules,
|
|
9
|
+
"unicorn/prefer-module": "error",
|
|
10
|
+
"unicorn/import-index": "off",
|
|
4
11
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/import/extensions.md
|
|
13
|
+
"import/extensions": [
|
|
14
|
+
"error",
|
|
15
|
+
"ignorePackages",
|
|
16
|
+
{
|
|
17
|
+
mjs: "always",
|
|
18
|
+
cjs: "always",
|
|
19
|
+
js: "always",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
},
|
|
15
23
|
},
|
|
16
|
-
|
|
17
|
-
rules: {
|
|
18
|
-
...overrideRules,
|
|
19
|
-
"unicorn/prefer-module": "error",
|
|
20
|
-
"unicorn/import-index": "off",
|
|
21
|
-
|
|
22
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/import/extensions.md
|
|
23
|
-
"import/extensions": [
|
|
24
|
-
"error",
|
|
25
|
-
"ignorePackages",
|
|
26
|
-
{
|
|
27
|
-
mjs: "always",
|
|
28
|
-
cjs: "always",
|
|
29
|
-
js: "always",
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
},
|
|
33
|
-
};
|
|
24
|
+
];
|
|
@@ -1,99 +1,132 @@
|
|
|
1
|
-
|
|
1
|
+
import { fixupPluginRules } from "@eslint/compat";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
plugins
|
|
3
|
+
function legacyPlugin(compat, name, alias = name) {
|
|
4
|
+
const plugin = compat.plugins(name)[0]?.plugins?.[alias];
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
if (!plugin) {
|
|
7
|
+
throw new Error(`Unable to resolve plugin ${name} and/or alias ${alias}`);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return fixupPluginRules(plugin);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default (compat) => [
|
|
14
|
+
{
|
|
15
|
+
//
|
|
16
|
+
languageOptions: {
|
|
17
|
+
parserOptions: {
|
|
18
|
+
ecmaVersion: 2022,
|
|
19
|
+
sourceType: "module",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
plugins: {
|
|
23
|
+
import: legacyPlugin(compat, "eslint-plugin-import", "import"),
|
|
24
|
+
},
|
|
25
|
+
settings: {
|
|
26
|
+
"import/parsers": {
|
|
27
|
+
// https://github.com/import-js/eslint-plugin-import/issues/2556#issuecomment-1419518561
|
|
28
|
+
espree: [".js", ".cjs", ".mjs"],
|
|
29
|
+
},
|
|
30
|
+
"import/resolver": {
|
|
31
|
+
node: true,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
10
34
|
},
|
|
35
|
+
...compat.config({
|
|
36
|
+
settings: {
|
|
37
|
+
"import/extensions": [".js", ".mjs"],
|
|
38
|
+
"import/ignore": ["node_modules"],
|
|
39
|
+
},
|
|
11
40
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
41
|
+
rules: {
|
|
42
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md
|
|
43
|
+
"import/no-unresolved": [
|
|
44
|
+
"error",
|
|
45
|
+
{ commonjs: true, caseSensitive: true },
|
|
46
|
+
],
|
|
15
47
|
|
|
16
|
-
|
|
17
|
-
|
|
48
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/named.md
|
|
49
|
+
"import/named": "error",
|
|
18
50
|
|
|
19
|
-
|
|
20
|
-
|
|
51
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/export.md
|
|
52
|
+
"import/export": "error",
|
|
21
53
|
|
|
22
|
-
|
|
23
|
-
|
|
54
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-named-as-default.md
|
|
55
|
+
"import/no-named-as-default": "error",
|
|
24
56
|
|
|
25
|
-
|
|
26
|
-
|
|
57
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-named-as-default-member.md
|
|
58
|
+
"import/no-named-as-default-member": "error",
|
|
27
59
|
|
|
28
|
-
|
|
29
|
-
|
|
60
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-deprecated.md
|
|
61
|
+
"import/no-deprecated": "off",
|
|
30
62
|
|
|
31
|
-
|
|
32
|
-
|
|
63
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md
|
|
64
|
+
"import/no-extraneous-dependencies": "error",
|
|
33
65
|
|
|
34
|
-
|
|
35
|
-
|
|
66
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-mutable-exports.md
|
|
67
|
+
"import/no-mutable-exports": "error",
|
|
36
68
|
|
|
37
|
-
|
|
38
|
-
|
|
69
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-amd.md
|
|
70
|
+
"import/no-amd": "error",
|
|
39
71
|
|
|
40
|
-
|
|
41
|
-
|
|
72
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/first.md
|
|
73
|
+
"import/first": "error",
|
|
42
74
|
|
|
43
|
-
|
|
44
|
-
|
|
75
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md
|
|
76
|
+
"import/no-duplicates": "error",
|
|
45
77
|
|
|
46
|
-
|
|
47
|
-
|
|
78
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/newline-after-import.md
|
|
79
|
+
"import/newline-after-import": "error",
|
|
48
80
|
|
|
49
|
-
|
|
50
|
-
|
|
81
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/prefer-default-export.md
|
|
82
|
+
"import/prefer-default-export": "off",
|
|
51
83
|
|
|
52
|
-
|
|
53
|
-
|
|
84
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-absolute-path.md
|
|
85
|
+
"import/no-absolute-path": "error",
|
|
54
86
|
|
|
55
|
-
|
|
56
|
-
|
|
87
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-dynamic-require.md
|
|
88
|
+
"import/no-dynamic-require": "error",
|
|
57
89
|
|
|
58
|
-
|
|
59
|
-
|
|
90
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-webpack-loader-syntax.md
|
|
91
|
+
"import/no-webpack-loader-syntax": "error",
|
|
60
92
|
|
|
61
|
-
|
|
62
|
-
|
|
93
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-named-default.md
|
|
94
|
+
"import/no-named-default": "error",
|
|
63
95
|
|
|
64
|
-
|
|
65
|
-
|
|
96
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-self-import.md
|
|
97
|
+
"import/no-self-import": "error",
|
|
66
98
|
|
|
67
|
-
|
|
68
|
-
|
|
99
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-cycle.md
|
|
100
|
+
"import/no-cycle": ["error", { maxDepth: "∞" }],
|
|
69
101
|
|
|
70
|
-
|
|
71
|
-
|
|
102
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-useless-path-segments.md
|
|
103
|
+
"import/no-useless-path-segments": ["error", { commonjs: true }],
|
|
72
104
|
|
|
73
|
-
|
|
74
|
-
|
|
105
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-import-module-exports.md
|
|
106
|
+
"import/no-import-module-exports": "error",
|
|
75
107
|
|
|
76
|
-
|
|
77
|
-
|
|
108
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-relative-packages.md
|
|
109
|
+
"import/no-relative-packages": "error",
|
|
78
110
|
|
|
79
|
-
|
|
80
|
-
|
|
111
|
+
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-empty-named-blocks.md
|
|
112
|
+
"import/no-empty-named-blocks": "error",
|
|
81
113
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
114
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md
|
|
115
|
+
"import/order": [
|
|
116
|
+
"error",
|
|
117
|
+
{
|
|
118
|
+
groups: [
|
|
119
|
+
"builtin",
|
|
120
|
+
"external",
|
|
121
|
+
"internal",
|
|
122
|
+
"parent",
|
|
123
|
+
"sibling",
|
|
124
|
+
"index",
|
|
125
|
+
],
|
|
126
|
+
alphabetize: { order: "asc", caseInsensitive: false },
|
|
127
|
+
"newlines-between": "never",
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
}),
|
|
132
|
+
];
|