Skip to content
This repository was archived by the owner on Feb 9, 2025. It is now read-only.

Commit 273e139

Browse files
committed
feat: Configure new rules
- import/no-cycle warn BREAKING CHANGE: - import/no-self-import error - import/no-useless-path-segments error
1 parent b6a12f7 commit 273e139

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

base.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,14 @@ module.exports = {
7878
"id-match": "off", // http://eslint.org/docs/rules/id-match
7979
"import/default": "error", // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/default.md
8080
"import/export": "error", // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/export.md
81+
"import/exports-last": "off", // https://github.com/benmosher/eslint-plugin-import/blob/HEAD/docs/rules/exports-last.md
8182
"import/extensions": ["error", "always", {
8283
"js": "never",
8384
"json": "never",
8485
"jsx": "never"
8586
}], // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/extensions.md
8687
"import/first": ["error", "absolute-first"], // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/first.md
88+
"import/group-exports": "off", // https://github.com/benmosher/eslint-plugin-import/blob/HEAD/docs/rules/group-exports.md
8789
// Using more than 15 dependencies in one module is a sign that this module is doing too much.
8890
// You should consider splitting that module into different parts.
8991
"import/max-dependencies": ["warn", { max: 15 }], // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/max-dependencies.md
@@ -95,6 +97,12 @@ module.exports = {
9597
"import/no-amd": "error", // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-amd.md
9698
"import/no-anonymous-default-export": "off", // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-anonymous-default-export.md
9799
"import/no-commonjs": "off", // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-commonjs.md
100+
// Dependency cycles are usually the sign of a problematic architecture and may also
101+
// have odd execution behavior where values are unexpectedly undefined.
102+
// There are rare situations where dependency cycles are wanted or necessary.
103+
// Disable this rule if you're sure that the cyclic dependency is a good idea.
104+
"import/no-cycle": "warn", // https://github.com/benmosher/eslint-plugin-import/blob/HEAD/docs/rules/no-cycle.md
105+
"import/no-default-export": "off", // https://github.com/benmosher/eslint-plugin-import/blob/HEAD/docs/rules/no-default-export.md
98106
"import/no-deprecated": "warn", // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-deprecated.md
99107
"import/no-duplicates": "error", // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md
100108
"import/no-dynamic-require": "warn", // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-dynamic-require.md
@@ -123,8 +131,10 @@ module.exports = {
123131
{ from: "./client", target: "./server" }
124132
]
125133
}], // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-restricted-paths.md
134+
"import/no-self-import": "error", // https://github.com/benmosher/eslint-plugin-import/blob/HEAD/docs/rules/no-self-import.md
126135
"import/no-unassigned-import": "warn", // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unassigned-import.md
127136
"import/no-unresolved": ["error", { commonjs: true }], // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md
137+
"import/no-useless-path-segments": "error", // currently undocumented :(, see https://github.com/benmosher/eslint-plugin-import/issues/1032
128138
"import/no-webpack-loader-syntax": "warn", // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-webpack-loader-syntax.md
129139
"import/order": "off", // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md
130140
// While default exports are better most of the time, there may be cases where you just have one named export
@@ -158,9 +168,11 @@ module.exports = {
158168
"jsdoc/check-types": "error",
159169
"jsdoc/newline-after-description": "error",
160170
"jsdoc/require-description-complete-sentence": "off",
171+
"jsdoc/require-example": "off",
161172
"jsdoc/require-hyphen-before-param-description": "error",
162173
"jsdoc/require-param": "error",
163174
"jsdoc/require-param-description": "off",
175+
"jsdoc/require-param-name": "off",
164176
"jsdoc/require-param-type": "error",
165177
"jsdoc/require-returns-description": "off",
166178
"jsdoc/require-returns-type": "error",

0 commit comments

Comments
 (0)