-
Notifications
You must be signed in to change notification settings - Fork 653
refactor(rome_js_analyze): reorganize lint rules into additional categories #3908
Conversation
✅ Deploy Preview for docs-rometools ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Parser conformance results on ubuntu-latestjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
I am wondering if |
a8652e2
to
5ec5dcb
Compare
It comes down to the definition of each group: |
The |
I am wondering if several rules should follow the same path: noDupeArgs -> noDuplicatedFunctionParameters |
5ec5dcb
to
3295c9e
Compare
Agree with avoiding abbreviations. I implemented I would suggest these names: Discussion might be going out of scope though since this appears to be just about the groups. I can re-suggest this on another issue for a rule names cleanup. Might be good to get some consistency in now because there are still few rules and many still in nursery so it's all not too breaking. |
Could you develop about that?
If |
We're going a bit off topic in this PR 😅 but yeah so basically iirc arguments refers to something that a function takes and parameters to the values that you pass to it when you call the function, that then become concrete "instances" of the arguments for that function call. This is why I think it is called no duplicate arguments and not no duplicate parameters. |
It's the other way round. You pass arguments in a call to a function that is parametrised by function parameters |
Oops sorry, thanks for looking it up. Typed it on my phone yesterday from memory which was apparently wrong. In that case |
I could also suggest adding |
3295c9e
to
c81e910
Compare
I ended up renaming |
Makes sense to have specific groups for frameworks? |
2bf986d
to
0246a0e
Compare
0246a0e
to
fb7aa10
Compare
Comparing refactor(rome_js_analyze): reorganize lint rules into additional categories Snapshot #1 to median since last deploy of rome.tools.
1 page tested
|
Chrome Desktop | iPhone, 4G LTE | Motorola Moto G Power, 3G connection |
---|---|---|
Most significant changes
17 other significant changes: Cumulative Layout Shift on Motorola Moto G Power, 3G connection, Number of Requests on Chrome Desktop, Number of Requests on iPhone, 4G LTE, Number of Requests on Motorola Moto G Power, 3G connection, JS Parse & Compile on Motorola Moto G Power, 3G connection, Total Page Size in Bytes on Chrome Desktop, Total Page Size in Bytes on iPhone, 4G LTE, Total Page Size in Bytes on Motorola Moto G Power, 3G connection, Total CSS Size in Bytes on Chrome Desktop, Total CSS Size in Bytes on iPhone, 4G LTE, Total CSS Size in Bytes on Motorola Moto G Power, 3G connection, Total Image Size in Bytes on Chrome Desktop, Total Image Size in Bytes on iPhone, 4G LTE, Total Image Size in Bytes on Motorola Moto G Power, 3G connection, Total HTML Size in Bytes on Chrome Desktop, Total HTML Size in Bytes on iPhone, 4G LTE, Total HTML Size in Bytes on Motorola Moto G Power, 3G connection
Calibre: Site dashboard | View this PR | Edit settings | View documentation
This is something we have discussed also on Discord. @MichaReiser suggested something different: having a specific place in the configuration where users can specify their framework (react, svelte, vue, etc.), and then Rome will enable all things related to that framework: lint rules, parsing quirks, formatting quirks, bundler quirks, etc. |
Have you performed any testing on the promoted rules on real-world projects like ESLint? |
I've tested the newly recommended rules ( |
Summary
Closes #3719
This PR introduces new rule groups inspired by Clippy, and changes the group and recommended flag for a number of lint rules in preparation for v11.
New Groups
Perf
The following rules have been moved to this group:
noDelete
Suspicious
The following rules have been moved to this group:
noArrayIndexKey
noAsyncPromiseExecutor
noCatchAssign
noCommentText
noCompareNegZero
noDebugger
noDoubleEquals
noDupeArgs
noExplicitAny
(+recommended)noFunctionAssign
noImportAssign
noLabelVar
noShadowRestrictedNames
noSparseArray
noUnsafeNegation
useValidTypeof
Existing Groups
Complexity
The following rules have been moved to this group:
noMultipleSpacesInRegularExpressionLiterals
noUselessFragments
useFlatMap
(+recommended)useOptionalChain
Correctness
The description of this group has been changed to only include rules that are strict about catching actual errors or dead code, while rules that only detect patterns that might be erroneous have been moved to the
suspicious
group.The following rules have been moved to this group:
noConstAssign
(+recommended)useValidForDirection
(+recommended)Nursery
The
noRestrictedGlobals
rule has been downgraded to thenursery
group as it only seems to be useful if it can be configured by the user, but it doesn't expose a way to specify this configuration yet.The
recommended
flag has been removed for thenoAccessKey
since it's not stable yet.Style
The following rules have been moved to this group:
noArguments
useSingleCaseStatement
useWhile
The following rules are no longer recommended:
noImplicitBoolean
noNegationElse
noShoutyConstants
useBlockStatements
useShorthandArrayType
useSingleCaseStatement
Test Plan
Besides moving a number of snapshot tests around, I had to change a few tests that relied on the specific group of a rule or category of a diagnostic.