Skip to content

Commit

Permalink
fix: import plugin with flat config
Browse files Browse the repository at this point in the history
- Use `eslint-plugin-import-x` fork for now
- Remove rules that are incompatible with flat config
  They're not critical and mostly useless if we use TypeScript and unit testing.
  • Loading branch information
targos committed Jul 2, 2024
1 parent b400381 commit 0b9d723
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
9 changes: 2 additions & 7 deletions base.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import _import from 'eslint-plugin-import';
import importPlugin from 'eslint-plugin-import-x';
import noLookaheadLookbehindRegexp from 'eslint-plugin-no-lookahead-lookbehind-regexp';
import { fixupPluginRules } from '@eslint/compat';
import globals from 'globals';

export default [
{
plugins: {
import: fixupPluginRules(_import),
import: importPlugin,
'no-lookahead-lookbehind-regexp': noLookaheadLookbehindRegexp,
},

Expand Down Expand Up @@ -239,17 +238,13 @@ export default [
//#region Import plugin (https://github.com/import-js/eslint-plugin-import#rules)
// Static analysis
'import/named': 'error',
'import/default': 'warn',
'import/namespace': 'error',
'import/no-absolute-path': 'error',
'import/no-webpack-loader-syntax': 'error',
'import/no-self-import': 'error',
'import/no-useless-path-segments': 'error',

// Helpful warnings
'import/export': 'error',
'import/no-named-as-default-member': 'error',
'import/no-deprecated': 'warn',

// Module systems
'import/no-amd': 'error',
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
},
"homepage": "https://github.com/cheminfo/eslint-config#readme",
"dependencies": {
"@eslint/compat": "^1.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-import-x": "^0.5.3",
"eslint-plugin-jsdoc": "^48.5.0",
"eslint-plugin-no-lookahead-lookbehind-regexp": "^0.3.0",
"eslint-plugin-unicorn": "^54.0.0",
Expand Down

0 comments on commit 0b9d723

Please sign in to comment.