-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
feat: check imports and class names in no-shadow-restricted-names
#19272
Conversation
✅ Deploy Preview for docs-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
LGTM, thanks.
Would like another team member to review this.
Thanks! It looks like the rule was never updated to report on imports and classes. The documentation even refers to a paragraph of the ES5 spec, where imports and classes were not yet defined. As for reporting on all defs, that seems to ensure that the report locations for I think this is a useful change. |
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.
LGTM, thanks!
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@eslint/js](https://eslint.org) ([source](https://github.com/eslint/eslint/tree/HEAD/packages/js)) | devDependencies | minor | [`9.17.0` -> `9.18.0`](https://renovatebot.com/diffs/npm/@eslint%2fjs/9.17.0/9.18.0) | | [eslint](https://eslint.org) ([source](https://github.com/eslint/eslint)) | devDependencies | minor | [`9.17.0` -> `9.18.0`](https://renovatebot.com/diffs/npm/eslint/9.17.0/9.18.0) | --- ### Release Notes <details> <summary>eslint/eslint (@​eslint/js)</summary> ### [`v9.18.0`](https://github.com/eslint/eslint/releases/tag/v9.18.0) [Compare Source](eslint/eslint@v9.17.0...v9.18.0) ##### Features - [`e84e6e2`](eslint/eslint@e84e6e2) feat: Report allowed methods for `no-console` rule ([#​19306](eslint/eslint#19306)) (Anna Bocharova) - [`8efc2d0`](eslint/eslint@8efc2d0) feat: unflag TypeScript config files ([#​19266](eslint/eslint#19266)) (Francesco Trotta) - [`87a9352`](eslint/eslint@87a9352) feat: check imports and class names in `no-shadow-restricted-names` ([#​19272](eslint/eslint#19272)) (Milos Djermanovic) ##### Bug Fixes - [`da768d4`](eslint/eslint@da768d4) fix: correct `overrideConfigFile` type ([#​19289](eslint/eslint#19289)) (Francesco Trotta) ##### Documentation - [`d9c23c5`](eslint/eslint@d9c23c5) docs: replace `var` with `const` in rule examples ([#​19325](eslint/eslint#19325)) (Tanuj Kanti) - [`8e1a898`](eslint/eslint@8e1a898) docs: add tabs to cli code blocks ([#​18784](eslint/eslint#18784)) (Jay) - [`f3aeefb`](eslint/eslint@f3aeefb) docs: rewrite using let and const in rule examples ([#​19320](eslint/eslint#19320)) (PoloSpark) - [`0b680b3`](eslint/eslint@0b680b3) docs: Update README (GitHub Actions Bot) - [`98c86a9`](eslint/eslint@98c86a9) docs: `Edit this page` button link to different branches ([#​19228](eslint/eslint#19228)) (Tanuj Kanti) - [`6947901`](eslint/eslint@6947901) docs: remove hardcoded edit link ([#​19323](eslint/eslint#19323)) (Milos Djermanovic) - [`03f2f44`](eslint/eslint@03f2f44) docs: rewrite var with const in rules examples ([#​19317](eslint/eslint#19317)) (Thiago) - [`26c3003`](eslint/eslint@26c3003) docs: Clarify dangers of eslint:all ([#​19318](eslint/eslint#19318)) (Nicholas C. Zakas) - [`c038257`](eslint/eslint@c038257) docs: add `eqeqeq` in related rules to `no-eq-null` ([#​19310](eslint/eslint#19310)) (루밀LuMir) - [`89c8fc5`](eslint/eslint@89c8fc5) docs: rewrite examples with var using let and const ([#​19315](eslint/eslint#19315)) (Amaresh S M) - [`db574c4`](eslint/eslint@db574c4) docs: add missing backticks to `no-void` ([#​19313](eslint/eslint#19313)) (루밀LuMir) - [`8d943c3`](eslint/eslint@8d943c3) docs: add missing backticks to `default-case-last` ([#​19311](eslint/eslint#19311)) (루밀LuMir) - [`36ef8bb`](eslint/eslint@36ef8bb) docs: rewrite examples with var using let and const ([#​19298](eslint/eslint#19298)) (Amaresh S M) - [`1610c9e`](eslint/eslint@1610c9e) docs: add missing backticks to `no-else-return` ([#​19309](eslint/eslint#19309)) (루밀LuMir) - [`df409d8`](eslint/eslint@df409d8) docs: Update README (GitHub Actions Bot) - [`2e84213`](eslint/eslint@2e84213) docs: Fix Horizontal Scroll Overflow in Rule Description on Mobile View ([#​19304](eslint/eslint#19304)) (Amaresh S M) - [`6e7361b`](eslint/eslint@6e7361b) docs: replace `var` with `let` and `const` in rule example ([#​19302](eslint/eslint#19302)) (Tanuj Kanti) - [`069af5e`](eslint/eslint@069af5e) docs: rewrite `var` using `const` in rule examples ([#​19303](eslint/eslint#19303)) (Kim GyeonWon) - [`064e35d`](eslint/eslint@064e35d) docs: remove 'I hope to' comments from scope-manager-interface ([#​19300](eslint/eslint#19300)) (Josh Goldberg ✨) - [`8e00305`](eslint/eslint@8e00305) docs: replace `var` with `const` in rule examples ([#​19299](eslint/eslint#19299)) (Tanuj Kanti) - [`a559009`](eslint/eslint@a559009) docs: Add warning about extending core rules ([#​19295](eslint/eslint#19295)) (Nicholas C. Zakas) - [`0bfdf6c`](eslint/eslint@0bfdf6c) docs: Update README (GitHub Actions Bot) - [`ce0b9ff`](eslint/eslint@ce0b9ff) docs: add navigation link for `code explorer` ([#​19285](eslint/eslint#19285)) (Tanuj Kanti) - [`e255cc9`](eslint/eslint@e255cc9) docs: add bluesky icon to footer ([#​19290](eslint/eslint#19290)) (Tanuj Kanti) - [`5d64851`](eslint/eslint@5d64851) docs: remove outdated info about environments ([#​19296](eslint/eslint#19296)) (Francesco Trotta) - [`eec01f0`](eslint/eslint@eec01f0) docs: switch rule examples config format to `languageOptions` ([#​19277](eslint/eslint#19277)) (Milos Djermanovic) - [`b36ca0a`](eslint/eslint@b36ca0a) docs: Fixing Focus Order by Rearranging Element Sequence ([#​19241](eslint/eslint#19241)) (Amaresh S M) - [`d122c8a`](eslint/eslint@d122c8a) docs: add missing backticks to `sort-imports` ([#​19282](eslint/eslint#19282)) (루밀LuMir) - [`0367a70`](eslint/eslint@0367a70) docs: update custom parser docs ([#​19288](eslint/eslint#19288)) (Francesco Trotta) - [`8c07ebb`](eslint/eslint@8c07ebb) docs: add `border-radius` to `hX:target` selector styles ([#​19270](eslint/eslint#19270)) (루밀LuMir) - [`eff7c57`](eslint/eslint@eff7c57) docs: add limitation section in `no-loop-func` ([#​19287](eslint/eslint#19287)) (Tanuj Kanti) - [`5db226f`](eslint/eslint@5db226f) docs: add missing backticks in various parts of the documentation ([#​19269](eslint/eslint#19269)) (루밀LuMir) - [`789edbb`](eslint/eslint@789edbb) docs: Update README (GitHub Actions Bot) - [`613c06a`](eslint/eslint@613c06a) docs: mark rules that are frozen with ❄️ ([#​19231](eslint/eslint#19231)) (Amaresh S M) - [`43172ec`](eslint/eslint@43172ec) docs: Update README (GitHub Actions Bot) - [`ac8b3c4`](eslint/eslint@ac8b3c4) docs: fix description of `overrideConfigFile` option ([#​19262](eslint/eslint#19262)) (Milos Djermanovic) - [`bbb9b46`](eslint/eslint@bbb9b46) docs: Update README (GitHub Actions Bot) - [`995b492`](eslint/eslint@995b492) docs: fix inconsistent divider in rule categories box ([#​19249](eslint/eslint#19249)) (Tanuj Kanti) - [`f76d05d`](eslint/eslint@f76d05d) docs: Refactor search result handling with better event listener cleanup ([#​19252](eslint/eslint#19252)) (Amaresh S M) - [`c5f3d7d`](eslint/eslint@c5f3d7d) docs: Update README (GitHub Actions Bot) ##### Chores - [`c52be85`](eslint/eslint@c52be85) chore: upgrade to `@eslint/js@9.18.0` ([#​19330](eslint/eslint#19330)) (Francesco Trotta) - [`362099c`](eslint/eslint@362099c) chore: package.json update for [@​eslint/js](https://github.com/eslint/js) release (Jenkins) - [`495aa49`](eslint/eslint@495aa49) chore: extract package `name` from `package.json` for public interface ([#​19314](eslint/eslint#19314)) (루밀LuMir) - [`6fe0e72`](eslint/eslint@6fe0e72) chore: update dependency [@​eslint/json](https://github.com/eslint/json) to ^0.9.0 ([#​19263](eslint/eslint#19263)) (renovate\[bot]) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS44Ny4wIiwidXBkYXRlZEluVmVyIjoiMzkuODcuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Reviewed-on: https://www.coastalcommits.com/cswimr/gauntlet-cswimr-plugins/pulls/21 Reviewed-by: cswimr <seaswimmerthefsh@gmail.com> Co-authored-by: Renovate <renovate@coastalcommits.com> Co-committed-by: Renovate <renovate@coastalcommits.com>
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[ ] Documentation update
[x] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
Fixes #19271
What changes did you make? (Give an overview)
Updated
no-shadow-restricted-names
rule to also check imports and class names.Also updated it to report on all defs as that seems to have been the intention according to the tests.
Is there anything you'd like reviewers to focus on?