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
Breaking: Update ignore
to v5
#14889
Conversation
As a breaking change, it seems an enjoyable time to upgrade it as eslint v8.0.0. |
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.
Can you provide an overview of breaking changes for ESLint users? This wasn't announced for v8.0.0, so it seems like the change would have to wait until v9.0.0.
@mdjermanovic It looks like the potential breaking change is that ignore v5 will throw an exception if an invalid path is passed to our |
If the change just affects a couple of rules, I think we can include this in v8.0.0. We don't announce all changes to all rules ahead of time, and we can add this into the release notes. |
I'm moving this PR back to draft since I've identified some missing test cases that it breaks for the
I'm going to add the missing test cases to the rules in #14910 to ensure they aren't mistakenly broken going forward. After that, we can reevaluate if it's possible to pull off this upgrade. |
Note that |
Should we upgrade eslintrc and/or not upgrade here? |
* master: Chore: Add rel/abs path tests in `no-restricted-{imports/modules}` rules (eslint#14910) Upgrade: Debug 4.0.1 > 4.3.2 (eslint#14892) Chore: add assertions on reporting location in `semi` (eslint#14899) Fix: no-useless-computed-key edge cases with class fields (refs eslint#14857) (eslint#14903) Upgrade: `js-yaml` to v4 (eslint#14890) Fix: prefer-destructuring PrivateIdentifier false positive (refs eslint#14857) (eslint#14897) Fix: dot-notation false positive with private identifier (refs eslint#14857) (eslint#14898) Sponsors: Sync README with website Sponsors: Sync README with website Docs: improve rule details for `no-console` (fixes eslint#14793) (eslint#14901) Update: check class fields in no-extra-parens (refs eslint#14857) (eslint#14906) Docs: add class fields in no-multi-assign documentation (refs eslint#14857) (eslint#14907) Docs: add class fields in func-names documentation (refs eslint#14857) (eslint#14908) Upgrade: `eslint-visitor-keys` to v3 (eslint#14902) Upgrade: `markdownlint` dev dependencies (eslint#14883) Upgrade: @humanwhocodes/config-array to 0.6 (eslint#14891) Chore: Specify Node 14.x for Verify Files CI job (eslint#14896)
Ideally, we would upgrade in both places of course, but I haven't yet found a way to upgrade here without breaking important test cases for these two rules. If we don't find a safe upgrade path in the coming days, it should be okay to have a different version in each package. |
Given these cases are very edge (not well tested and documented), I was wondering how many users were really using the "feature". What do you think just removing the cases and document the limitation (in eslint v8.0.0)? |
I don't think they're edge cases at all. I've used relative imports/requires extensively in many projects. ESLint itself has them everywhere as well. For example, this line from inside ESLint causes
So these are indeed important test cases that were missing. |
oh yes, you are right! I just misread the failing tests. |
a solution is to skip checking abs/rel path: aladdin-add@994b661. its dark side is patterns cannot be |
I don't think it's acceptable to skip checking absolute / relative import paths. That unnecessarily cripples the rule for what is likely to be a common use case for many people, for little to no tangible benefit. Instead, I just pushed a WIP workaround where we simply strip the |
Without the leading dot it means something very different tho - if i have one import from |
Correct, my workaround doesn't allow people to configure the rule to treat them differently. So overall I'm not happy with the options we have for using ignore v5 and would rather not upgrade than reduce the rule's functionality. The v5 version of ignore is no longer perfectly suited to our use case. CC: @kaelzhang |
Just a note: if the upgrade isn’t straight forward, we don’t need to upgrade. The amount of effort should be in line with the value we are getting. If the effort is too great and the value is low, let’s just skip the upgrade. (This is what happened with the Ajv upgrade — too many issues and we were fine with the current version, so we opted not to upgrade.) |
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[X] Other, please explain:
What changes did you make? (Give an overview)
Update dependency.
https://github.com/kaelzhang/node-ignore/releases/tag/5.0.0
Fixes #13294.
Is there anything you'd like reviewers to focus on?
No.