Skip to content

Commit

Permalink
refactor(eslint): migrate to eslint-plugin-import-x
Browse files Browse the repository at this point in the history
Looks like the original author is no longer as interested in maintaining the plugin: import-js/eslint-plugin-import#2948

Signed-off-by: Fernando Fernández <ferferga@hotmail.com>
  • Loading branch information
ferferga committed Jun 13, 2024
1 parent ad817a3 commit 48c8c7b
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 1,289 deletions.
18 changes: 9 additions & 9 deletions frontend/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import jsdoc from 'eslint-plugin-jsdoc';
import unicorn from 'eslint-plugin-unicorn';
import eslintImport from 'eslint-plugin-import';
import eslintImportX from 'eslint-plugin-import-x';
import fileProgress from 'eslint-plugin-file-progress';
import js from '@eslint/js';
import globals from 'globals';
Expand Down Expand Up @@ -139,10 +139,10 @@ export default tseslint.config(
name: '(import) Custom rule configs',
files: vueAndTsFiles,
plugins: {
import: eslintImport
'import-x': eslintImportX
},
rules: {
'import/no-extraneous-dependencies': [
'import-x/no-extraneous-dependencies': [
'error',
{
devDependencies: ['*.config.ts', 'scripts/**/*.ts'],
Expand All @@ -151,13 +151,13 @@ export default tseslint.config(
bundledDependencies: false
}
],
'import/order': 'error',
'import/no-cycle': 'error',
'import/no-nodejs-modules': 'error',
'import/no-duplicates': ['error', { 'prefer-inline': true, 'considerQueryString': true }],
'import-x/order': 'error',
'import-x/no-cycle': 'error',
'import-x/no-nodejs-modules': 'error',
'import-x/no-duplicates': ['error', { 'prefer-inline': true, 'considerQueryString': true }],
// From the recommended preset
'import/named': 'error',
'import/export': 'error'
'import-x/named': 'error',
'import-x/export': 'error'
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"eslint-config-flat-gitignore": "0.1.5",
"eslint-plugin-css": "0.9.2",
"eslint-plugin-file-progress": "1.4.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-import-x": "0.5.1",
"eslint-plugin-jsdoc": "48.2.9",
"eslint-plugin-jsonc": "2.16.0",
"eslint-plugin-optimize-regex": "1.2.1",
Expand Down
Loading

0 comments on commit 48c8c7b

Please sign in to comment.