-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
fix: references of Object.assign in prefer-object-spread
#18148
Closed
Closed
Changes from 1 commit
Commits
Show all changes
167 commits
Select commit
Hold shift + click to select a range
769f997
feat: limit the references of Object.assign
Tanujkanti4441 11144a2
feat: `no-restricted-imports` option added `allowImportNames` (#16196)
MichielPater 450d0f0
docs: fix `ignore` option docs (#18154)
fasttime af6e170
fix: stop linting files after an error (#18155)
fasttime e5ef3cd
docs: add inline cases condition in `no-fallthrough` (#18158)
Tanujkanti4441 c49ed63
feat: update complexity rule for optional chaining & default values (…
lo1tuma e37153f
fix: improve error message for invalid rule config (#18147)
snitin315 79a95eb
feat!: disallow multiple configuration comments for same rule (#18157)
mdjermanovic 1f1260e
docs: replace HackerOne link with GitHub advisory (#18165)
fasttime 972ef15
chore: remove invalid type in @eslint/js (#18164)
snitin315 a451b32
feat: make `no-misleading-character-class` report more granular error…
fasttime 2908b9b
docs: Update release documentation (#18174)
nzakas 558274a
docs: Update README
d961eeb
docs: show red underlines in examples in rules docs (#18041)
ota-meshi 1c173dc
feat: add `ignoreClassWithStaticInitBlock` option to `no-unused-vars`…
Tanujkanti4441 925afa2
chore: Remove some uses of `lodash.merge` (#18179)
mdjermanovic c7abd89
docs: Explain Node.js version support (#18176)
nzakas 337cdf9
docs: Explain limitations of RuleTester fix testing (#18175)
nzakas ba1c1bb
docs: Update README
96087b3
chore: package.json update for @eslint/js release
7509276
chore: upgrade @eslint/js@9.0.0-beta.2 (#18180)
mdjermanovic d7ec0d1
Build: changelog update for 9.0.0-beta.2
ba89c73
9.0.0-beta.2
acc2e06
chore: Introduce Knip (#18005)
webpro 1dc8618
docs: Update README
29c3595
chore: remove repetitive words (#18193)
cuithon 5251327
docs: Update README
ae8103d
fix: load plugins in the CLI in flat config mode (#18185)
fasttime b8fb572
feat: add `reportUnusedFallthroughComment` option to no-fallthrough r…
kirkwaiblinger 1b841bb
chore: fix some comments (#18213)
avoidaway 4769c86
docs: fix incorrect example in `no-lone-blocks` (#18215)
Tanujkanti4441 b91f9dc
build: fix TypeError in prism-eslint-hooks.js (#18209)
fasttime 09bd7fe
feat!: move AST traversal into SourceCode (#18167)
nzakas 239a7e2
docs: Clarify the description of `sort-imports` options (#18198)
gwBear1 d363c51
chore: package.json update for @eslint/js release
297416d
chore: package.json update for eslint-9.0.0-rc.0 (#18223)
fasttime 26010c2
Build: changelog update for 9.0.0-rc.0
b185eb9
9.0.0-rc.0
d85c436
feat: use-isnan report NaN in `indexOf` and `lastIndexOf` with fromIn…
Tanujkanti4441 de40874
feat: Rule Performance Statistics for flat ESLint (#17850)
mnkiefer dadc5bf
fix: `constructor-super` false positives with loops (#18226)
mdjermanovic 778082d
docs: add Glossary page (#18187)
JoshuaKGoldberg 9b7bd3b
chore: update dependency markdownlint to ^0.34.0 (#18237)
renovate[bot] a98babc
chore: add npm script to run WebdriverIO test (#18238)
fasttime b07d427
docs: fix typo (#18246)
gavvvr 7747097
docs: Update PR review process (#18233)
nzakas 26384d3
docs: fix `ecmaVersion` in one example, add checks (#18241)
mdjermanovic b93f408
docs: update shared settings example (#18251)
Tanujkanti4441 12f5746
docs: add info about dot files and dir in flat config (#18239)
Tanujkanti4441 b7cf3bd
fix!: correct `camelcase` rule schema for `allow` option (#18232)
eMerzh 3e9fcea
feat: Show config names in error messages (#18256)
nzakas 950c4f1
docs: Update README
651ec91
docs: remove `/* eslint-env */` comments from rule examples (#18249)
mdjermanovic 97ce45b
feat: Add `reportUsedIgnorePattern` option to `no-unused-vars` rule (…
Pearce-Ropion a129acb
fix: flat config name on ignores object (#18258)
nzakas e508800
fix: rule tester ignore irrelevant test case properties (#18235)
DMartens 96607d0
docs: version selectors synchronization (#18260)
mdjermanovic e80b60c
chore: remove code for testing version selectors (#18266)
mdjermanovic 1765c24
docs: add Troubleshooting page (#18181)
JoshuaKGoldberg 94178ad
docs: mention about `name` field in flat config (#18252)
antfu 44a81c6
chore: upgrade knip (#18272)
webpro 610c148
fix: Support `using` declarations in no-lone-blocks (#18269)
kirkwaiblinger e151050
docs: update get-started to the new `@eslint/create-config` (#18217)
aladdin-add d54a412
feat: Add --inspect-config CLI flag (#18270)
nzakas d73a33c
chore: ignore `/docs/v8.x` in link checker (#18274)
mdjermanovic 7c957f2
chore: package.json update for @eslint/js release
19f9a89
chore: Update dependencies for v9.0.0 (#18275)
nzakas 75cb5f4
Build: changelog update for 9.0.0
e0cbc50
9.0.0
5c35321
docs: add eslintrc-only note to `--rulesdir` (#18281)
adamlui 1fa6622
build: do not use `--force` flag to install dependencies (#18284)
fasttime 113f51e
docs: Mention package.json config support dropped (#18305)
nzakas e1e305d
docs: fix `linebreak-style` examples (#18262)
fasttime 36103a5
chore: eslint-plugin-n v17.0.0 (#18315)
aladdin-add 78e45b1
chore: eslint-plugin-eslint-plugin v6.0.0 (#18316)
aladdin-add c537d76
docs: update `npm init @eslint/config` generated file names (#18298)
aladdin-add df5f8a9
docs: `paths` and `patterns` difference in `no-restricted-imports` (#…
Tanujkanti4441 a76fb55
chore: @eslint-community/eslint-plugin-eslint-comments v4.3.0 (#18319)
mdjermanovic 16b6a8b
docs: Update README
32c08cf
chore: drop Node < 18 and use @eslint/js v9 in eslint-config-eslint (…
mdjermanovic 200fd4e
docs: indicate eslintrc mode for `.eslintignore` (#18285)
fasttime 0db676f
feat: add `Intl` in es6 globals (#18318)
aladdin-add 71c771f
docs: Fix missing accessible name for scroll-to-top link (#18329)
germanfrelo 698d9ff
chore: upgrade jsdoc & unicorn plugins in eslint-config-eslint (#18333)
mdjermanovic 4820790
chore: upgrade globals@15.0.0 dev dependency (#18332)
mdjermanovic 9048e21
chore: lint `docs/src/_data` js files (#18335)
mdjermanovic 09675e1
fix: `--no-ignore` should not apply to non-global ignores (#18334)
mdjermanovic e1ac0b5
fix: --inspect-config only for flat config and respect -c (#18306)
nzakas 0d8cf63
fix: EMFILE errors (#18313)
nzakas 0588fc5
refactor: Move directive gathering to SourceCode (#18328)
nzakas 1cbe1f6
feat: allow `while(true)` in `no-constant-condition` (#18286)
Tanujkanti4441 4d11e56
feat: add `name` to eslint configs (#18289)
aladdin-add fb50077
docs: include notes about globals in migration-guide (#18356)
Grohden 751b518
feat: replace dependency graphemer with `Intl.Segmenter` (#18110)
fasttime 594eb0e
fix: do not crash on error in `fs.walk` filter (#18295)
fasttime 155c71c
chore: package.json update for @eslint/js release
8d18958
fix: Remove name from eslint/js packages (#18368)
nzakas 50d406d
chore: package.json update for @eslint/js release
03068f1
feat: Provide helpful error message for nullish configs (#18357)
nzakas d9a2983
chore: upgrade @eslint/js to v9.1.1 (#18367)
fasttime e4d9c92
Build: changelog update for 9.1.0
b78d831
9.1.0
a26b402
fix: use @eslint/create-config latest (#18373)
aladdin-add ef36aa4
Build: changelog update for 9.1.1
b4d2512
9.1.1
f12a02c
docs: update to eslint v9 in custom-rule-tutorial (#18383)
aladdin-add eeec413
fix: do not throw when defining a global named __defineSetter__ (#18364)
aladdin-add f316e20
ci: run tests in Node.js 22 (#18393)
fasttime 1579ce0
docs: update wording regarding indirect eval (#18394)
kirkwaiblinger a498f35
feat: update Unicode letter detection in capitalized-comments rule (#…
fasttime 8485d76
feat: `no-case-declarations` add suggestions (#18388)
JoshuaKGoldberg 347d44f
chore: remove eslintrc export from eslint-config-eslint (#18400)
mdjermanovic 0f5df50
docs: Update README
284722c
chore: package.json update for eslint-config-eslint release
c4c18e0
chore: package.json update for @eslint/js release
b346605
chore: upgrade @eslint/js@9.2.0 (#18413)
mdjermanovic 989ac9d
Build: changelog update for 9.2.0
271e7ab
9.2.0
0de0909
docs: fix grammar in configuration file resolution (#18419)
MikeMcC399 db0b174
feat: add `enforceForInnerExpressions` option to `no-extra-boolean-ca…
kirkwaiblinger ac7f718
docs: reflect release of v9 in config migration guide (#18412)
pwbriggs 27e3060
chore: Disable documentation label (#18423)
nzakas c18ad25
chore: update actions/upload-artifact action to v4 (#18427)
renovate[bot] f47847c
chore: update actions/stale action to v9 (#18426)
renovate[bot] 040700a
chore: update dependency markdownlint-cli to ^0.40.0 (#18425)
renovate[bot] 37eba48
fix: don't crash when `fs.readFile` returns promise from another real…
mdjermanovic e763512
docs: Link global ignores section in config object property list (#18…
MaoShizhong 04e7c6e
docs: update deprecation notice of `no-return-await` (#18433)
Tanujkanti4441 a63ed72
refactor: Use `node:` protocol for built-in Node.js modules (#18434)
mdjermanovic 05ef92d
feat: deprecate `multiline-comment-style` & `line-comment-position` (…
aladdin-add 7065196
docs: Update README
069aa68
feat: add option `allowEscape` to `no-misleading-character-class` rul…
fasttime 1db9bae
docs: Fix typos (#18443)
friederbluemle d23574c
docs: Clarify usage of `no-unreachable` with TypeScript (#18445)
benj-dobs 2465a1e
docs: Update README
b67eba4
feat: add `restrictedNamedExportsPattern` to `no-restricted-exports` …
akulsr0 39fb0ee
fix: object-shorthand loses type parameters when auto-fixing (#18438)
shulaoda e17e1c0
docs: Update README
62e686c
docs: Add troubleshooting info for plugin compatibility (#18451)
nzakas 5c28d9a
fix: don't remove comments between key and value in object-shorthand …
KubaJastrz 06f1d1c
chore: update dependency @humanwhocodes/retry to ^0.3.0 (#18463)
renovate[bot] b32153c
feat: add `overrides.namedExports` to `func-style` rule (#18444)
kecrily ceada8c
docs: explain how to use "tsc waiting" label (#18466)
fasttime 8db0eff
fix: Improve config error messages (#18457)
nzakas b681ecb
chore: package.json update for @eslint/js release
58e2719
chore: update dependencies for v9.3.0 release (#18469)
fasttime 463a2e3
Build: changelog update for 9.3.0
41a871c
9.3.0
70118a5
fix: `func-style` false positive with arrow functions and `super` (#1…
mdjermanovic 389744b
fix: use `@eslint/config-inspector@latest` (#18483)
aladdin-add f06e0b5
docs: clarify func-style (#18477)
camsteffen 7226ebd
fix: allow implicit undefined return in `no-constructor-return` (#18515)
rzvxa f6534d1
fix: skip processor code blocks that match only universal patterns (#…
mdjermanovic 80747d2
docs: refactor `prefer-destructuring` rule (#18472)
Tanujkanti4441 89a4a0a
feat: ignore IIFE's in the `no-loop-func` rule (#17528)
snitin315 525fdff
docs: fix components files (#18519)
Tanujkanti4441 594145f
refactor: switch to `@eslint/config-array` (#18527)
fasttime d7ab6f5
docs: update theme when when `prefers-color-scheme` changes (#18510)
snitin315 5e1b5dc
chore: package.json update for @eslint/js release
010dd2e
chore: upgrade to `@eslint/js@9.4.0` (#18534)
fasttime 8c6d0c3
Build: changelog update for 9.4.0
a5f7e58
9.4.0
2c8fd34
ci: pin @wdio/browser-runner v8.36.0 (#18540)
aladdin-add 73408de
docs: add link to configuration file docs before examples (#18535)
mdjermanovic d16a659
docs: add link to migration guide for `--ext` CLI option (#18537)
mdjermanovic e49202d
feat: limit the references of Object.assign
Tanujkanti4441 6643f61
Merge branch 'limit-reference' of https://github.com/Tanujkanti4441/e…
Tanujkanti4441 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 feel this should be reported because
foo
has never been reassigned.Incorrect
Correct
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.
seems like i have understood the issue wrong but what about autofixes is it also correct
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.
Yes, I believe the auto fix is also correct,
doSomething
will be reported by theno-unused-vars
rule.@mdjermanovic Can you once confirm the expected behavior?
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 problem is that
ReferenceTracker
returns both certain references (e.g.,const x = Object.assign; x();
) and potential references (those that are references only in some code paths, e.g.,const x = foo ? Object.assign : bar; x();
), which is okay for some rules (e.g., forno-obj-calls
, because it's a bug ifJSON()
is called in any code paths) but not for this one.We currently don't have a utility that would help find only certain references. The solution could be:
ReferenceTracker
to not return potential references.Object.assign
calls. Maybe also<global object>.Object.assign
(likeno-eval
).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.
So, changes in this PR falls in 3rd point so what should we do now, move forward or look for another approaches (point 1st and 2nd)?
the reason i chose 3rd one is i noticed in this rule's previous version is that references was used so that it allows the
Object.assign
ifObject
is importing from a module, and i didn't find any tests which doesn't callObject.assign
directly.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 am still doubtful that this fix is correct and doesn't lead to bugs.
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.
Perhaps we could first ask at https://github.com/eslint-community/eslint-utils if option 1 would be possible. If not, then I think option 3 is fine.