Skip to content

Commit

Permalink
feat(linter): update eslint-import-plugin to a version that supports …
Browse files Browse the repository at this point in the history
…eslint v9 (#28273)

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
  • Loading branch information
leosvelperez authored Oct 3, 2024
1 parent 7ff387d commit 0d70866
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 39 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
"eslint-config-next": "14.2.3",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-cypress": "2.14.0",
"eslint-plugin-import": "2.30.0",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-jsx-a11y": "6.7.1",
"eslint-plugin-playwright": "^1.6.2",
"eslint-plugin-react": "7.35.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/eslint-plugin/src/flat-configs/react-base.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { fixupPluginRules } from '@eslint/compat';
import * as importPlugin from 'eslint-plugin-import';
import globals from 'globals';
import tseslint from 'typescript-eslint';
Expand All @@ -19,7 +18,7 @@ import tseslint from 'typescript-eslint';
* https://github.com/facebook/create-react-app/blob/567f36c9235f1e1fd4a76dc6d1ae00be754ca047/packages/eslint-config-react-app/index.js
*/
export default tseslint.config({
plugins: { import: fixupPluginRules(importPlugin) },
plugins: { import: importPlugin },
languageOptions: {
globals: {
...globals.browser,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,21 +150,6 @@ export function convertEslintJsonToFlatConfig(
isFlatCompatNeeded = true;
}
exportElements.push(generateFlatOverride(override));

// eslint-plugin-import cannot be used with ESLint v9 yet
// TODO(jack): Once v9 support is released, remove this block.
// See: https://github.com/import-js/eslint-plugin-import/pull/2996
if (override.extends === 'plugin:@nx/react') {
exportElements.push(
generateFlatOverride({
rules: {
'import/first': 'off',
'import/no-amd': 'off',
'import/no-webpack-loader-syntax': 'off',
},
})
);
}
});
}

Expand Down
9 changes: 9 additions & 0 deletions packages/react/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@
"alwaysAddToPackageJson": false
}
}
},
"20.0.0": {
"version": "20.0.0-beta.8",
"packages": {
"eslint-plugin-import": {
"version": "2.31.0",
"alwaysAddToPackageJson": false
}
}
}
}
}
2 changes: 1 addition & 1 deletion packages/react/src/utils/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const testingLibraryReactVersion = '15.0.6';
export const reduxjsToolkitVersion = '1.9.3';
export const reactReduxVersion = '8.0.5';

export const eslintPluginImportVersion = '2.30.0';
export const eslintPluginImportVersion = '2.31.0';
export const eslintPluginJsxA11yVersion = '6.7.1';
export const eslintPluginReactVersion = '7.35.0';
export const eslintPluginReactHooksVersion = '4.6.0';
Expand Down
74 changes: 54 additions & 20 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0d70866

Please sign in to comment.