Skip to content

Commit e265315

Browse files
committed
fix: Update import/no-useless-path-segments rule and eslint dependency versions
Updated the rule for no-useless-path-segments in import.ts, enabling commonjs option instead of disabling it. This change was made in alignment with the updated version of eslint dependency. Also, upgraded the versions of eslint-import resolver, eslint-patch, and eslint-plugin-security in package.json. This change resolves potential security risks and ensures compatibility with the new rules. Signed-off-by: prisis <[email protected]>
1 parent e884c4d commit e265315

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env node
2-
// eslint-disable-next-line import/extensions
2+
33
require("../dist/postinstall");

packages/eslint-config/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@
131131
"@anolilab/package-json-utils": "3.0.6",
132132
"@babel/eslint-parser": "^7.22.15",
133133
"@babel/plugin-syntax-import-assertions": "^7.22.5",
134-
"@jsenv/eslint-import-resolver": "^8.0.2",
134+
"@jsenv/eslint-import-resolver": ">=8.0.3",
135135
"@eslint/js": "^8.50.0",
136136
"@html-eslint/eslint-plugin": "^0.19.1",
137137
"@html-eslint/parser": "^0.19.1",
138-
"@rushstack/eslint-patch": "^1.4.0",
139-
"@rushstack/eslint-plugin-security": "^0.7.0",
138+
"@rushstack/eslint-patch": "^1.5.0",
139+
"@rushstack/eslint-plugin-security": "^0.7.1",
140140
"@typescript-eslint/eslint-plugin": ">=6.7.3",
141141
"@typescript-eslint/parser": "^6.7.3",
142142
"confusing-browser-globals": "^1.0.11",

packages/eslint-config/src/config/plugins/import.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,8 @@ const config: Linter.Config = createConfigs([
289289
"import/no-relative-packages": "error",
290290

291291
// Ensures that there are no useless path segments
292-
// TODO: Create a PR to fix commonjs option, when eslint --fix is run, it throws an error on the no-useless-path-segments.js:118
293-
// @see https://github.com/import-js/eslint-plugin-import/pull/2886
294292
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-useless-path-segments.md
295-
"import/no-useless-path-segments": ["error", { commonjs: false, noUselessIndex: true }],
293+
"import/no-useless-path-segments": ["error", { commonjs: true, noUselessIndex: true }],
296294

297295
// Forbid Webpack loader syntax in imports
298296
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-webpack-loader-syntax.md

0 commit comments

Comments
 (0)