eslint-plugin: Disable redundant import rules for TypeScript files#72884
eslint-plugin: Disable redundant import rules for TypeScript files#72884
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: 0 B Total Size: 2.38 MB ℹ️ View Unchanged
|
|
Flaky tests detected in 465e010. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/18977573269
|
What?
Updates the default ESLint configuration to avoid running various redundant rules from
eslint-plugin-importfor TypeScript files:import/no-unresolvedimport/defaultimport/namedTangentially related to #72136
Why?
Makes the lint check more performant by avoiding redundant checks.
See: https://typescript-eslint.io/troubleshooting/typed-linting/performance/
Furthermore, the default resolver with
eslint-plugin-importlacks support for modern package semantics, so this helps avoid these issues in TypeScript files. This is a workaround, as we should ideally update the configuration to use a better resolver (see #72136).How?
Overrides default rules to disable, specific to files matching
*.tsor*.tsx.Default rules configured here:
gutenberg/packages/eslint-plugin/configs/recommended-with-formatting.js
Lines 33 to 40 in 234e7b1
Testing Instructions
Verify lint passes:
npm run lint:jsFor bonus points, introduce a change which would cause a real issue and verify that TypeScript will catch it: