-
Notifications
You must be signed in to change notification settings - Fork 557
build(eslint-config-fluid): migrate from eslint-plugin-import to eslint-plugin-import-x #25661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build(eslint-config-fluid): migrate from eslint-plugin-import to eslint-plugin-import-x #25661
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates the eslint-config-fluid package from the unmaintained eslint-plugin-import
to its actively maintained successor eslint-plugin-import-x
. The migration involves updating the package dependency and systematically replacing all rule names and configuration references throughout the ESLint configuration files.
- Updated package.json to replace
eslint-plugin-import
dependency witheslint-plugin-import-x
- Migrated all ESLint rule names from
import/*
toimport-x/*
namespace - Updated plugin references, settings, and documentation URLs to use the new plugin
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
common/build/eslint-config-fluid/package.json | Updates dependency from eslint-plugin-import to eslint-plugin-import-x |
common/build/eslint-config-fluid/minimal-deprecated.js | Migrates all import plugin references to import-x throughout the configuration |
common/build/eslint-config-fluid/base.js | Updates base configuration to use import-x plugin and rule names |
Files not reviewed (1)
- common/build/eslint-config-fluid/pnpm-lock.yaml: Language not supported
…nt-plugin-import-x Migrate to eslint-plugin-import-x as eslint-plugin-import is no longer maintained. Updated all references in config files and dependencies.
b168acc
to
8afcc54
Compare
".cts", | ||
".mts", | ||
".tsx", | ||
".d.ts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes to node.extensions
seem to match what the base.js file says they should be... but before they were something different. We should understand the implications here and decide if maybe the extensions for the node case (I also don't get why it's separate from the "typescript" case) need adjustments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll look into this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think resolvers work differently in import-x, and I have updated the entries to omit node entirely. I'll see if that works.
".tsx", | ||
".d.ts", | ||
".tsx" | ||
".mts" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another one I'd like to understand. I get .tsx
was duplicated so cleaning up seems fine, but what introduced .mts
? And why just that and not cts
too?
".jsx", | ||
".cjs", | ||
".mjs" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the two above, but this one seems more straightforward.
"sortTypesGroup": false, | ||
"named": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like a good candidate to swap to true as a separate change. https://github.com/un-ts/eslint-plugin-import-x/blob/27b175f86849a970a4118543348b6a1d335d3169/docs/rules/order.md#named
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Keeping this pr series focused on getting us current as a priority though. My hope is that once we are on eslint 9 it will be easier to use in-repo config inheritance to manage our shared config like we do for tscobfig and api extractor. That will make it easier to roll out changes to the config without this crazy release dance. 🤞🤞🤞
}, | ||
}, | ||
], | ||
settings: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to base.js
🔗 Found some broken links! 💔 Run a link check locally to find them. See linkcheck output
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll admit I don't really follow everything that's happening in the printed configs, particularly under import-x/resolver
, but seems to be just how it works since we didn't do any of that by hand... I think moving forward with this is fine and if we're missing any issues introduced here, fix them as we find them.
@microsoft-github-policy-service rerun |
More context: #25628
Migrate to eslint-plugin-import-x as eslint-plugin-import is no longer maintained.
Updated all references in config files and dependencies.
Once this is released, integration into main will require renaming comments and overrides, but the changes will be mechanical.
This is technically a breaking change, so I bumped it to a major. Regardless, I want to integrate this change alone, so I want to release once this is merged. The only question is if this needs to be a major release. If so, that's fine, but several of the subsequent changes will also be "breaking" so we'll be releasing several majors in short succession. I think that's fine.
Blocking