-
-
Notifications
You must be signed in to change notification settings - Fork 791
feat(lint): lint/complexity/useLiteralKeys/noPropertyAccessFromIndexSignature
#8512
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
base: main
Are you sure you want to change the base?
Conversation
…Signature` fix which is valid, invalid, and ignored cases
…Signature` implementation
…ignature` skipping explicit property
…Signature` snap file From `just test-lintrule useLiteralKeys`
🦋 Changeset detectedLatest commit: 35919fa The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@arendjr I made the implementation to be backward compatible and it's quite simple, though it adds I actually plan this to be breaking (like modifying DetailsAnd the fact that my computer is being eaten alive by clippy and trying to compile tests with ~30GB of cargo caches. Though the option name should be Let me know! |
|
Few notes while I’m in the train:
|
Great catch, the LLM told me something about adding it to gain access to the
I plan to make this PR backwards compatible, users are expected to use the rule as is and won't notice a difference unless they opt-in to the I'll happily push more code (removing the |
|
Any reason this shouldn't read from |
|
It seems that
I'm still learning about the tooling of this project and hopefully I can implement this later on. But the core issue I'm having is whether to continue this PR or not since the complexity of the rule itself. I actually need some discussion due to the scope of this. Based on my research, this is the best way to introduce the project domain to be aware of I hope by checking |
Summary
Added new option to
lint/complexity/useLiteralKeyscallednoPropertyAccessFromIndexSignature.Relevant issue & discussions:
noPropertyAccessFromIndexSignature#463I used Claude Opus 4.5 in Github Copilot to assist me in this PR. Specifically:
I manually wrote the code itself with real time
clippycapability.Test Plan
Adds the following test files:
Run
just test-lintrule useLiteralKeysNotice it created
noPropertyAccessFromIndexSignature.ts.snap.newand removes the.newRun
just readywhich outputs the following error:Output
I believe this is outside of the scope of the PR, which I ignored.
Important
This actually made a new fileinvalid.snap.newthat replaces every literal character\with/for some reason.I ignored this and thought it's just a bug in the development tooling.Check spoiler below.
invalid.snap diff
This is the result of adding
domains: &[RuleDomain::Project],.Not sure if this a bug or intended behavior.
Docs
To do.