-
Notifications
You must be signed in to change notification settings - Fork 656
Conversation
8d05644
to
5a708b8
Compare
332b78b
to
6366190
Compare
I think we should avoid framework-specific group naming for the same reason we avoided language-specific group naming. Our configuration should have a For example: I do understand that we don't have the infrastructure to accomplish this today but that means we should prioritise adding the necessary capabilities to Rome because renaming rules is a confusing experience for our users. |
How would you solve a possible issue where a rule that targets React goes in conflict with another library that uses JSX? |
5a708b8
to
cceccad
Compare
Our configuration should have a framework section instead where it is possible to configure the used frameworks. The analyzer then enables/disabled rules based on that configuration. For example. The react rules only get enabled if you configure the react framework (with an optional version) or, as an alternative, by setting a The benefit of this approach is that transformation (and maybe even optimisations and bundling) must know about the used frameworks because the transformation may slightly differ. |
I'll help out and test these promoted rules tomorrow (on internal code @ ByteDance). |
!bench_analyzer |
Analyzer Benchmark Results
|
On the grouping:
|
I was on the fence on this one. Initially I thought about |
f7cc1d8
to
fec25a9
Compare
Parser conformance results on ubuntu-latestjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
✅ Deploy Preview for rometools ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
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.
Thanks for working out all the new groups. There's a merge issue in the codegen that must be resolved and I do have a question around the grouping of noDebugger
:
What are the security concerns around debugger
? I think if there's a security concern then the lint diagnostic should point that out. I lean towards correctness
because its useless code in production or has the undesired effect of stopping execution all together
My concern is around the fact that deploying code with debugger, would inevitably trigger a breakpoint if someone opens the developer console or runs the debugger in a backend app. Imagine being a library author and a I don't consider the code useless because it's a tool someone can use and it's helpful (like console logs). Maybe a misuse of the language but it's also debatable. |
That's why I would consider this a bug/broken code. It is code with unintended effects. I share your sentiment that it doesn't perfectly falls into the |
@MichaReiser merge conflicts fixed and |
Comparing feat(rome_js_analyze): promote rules Snapshot #13 to median since last deploy of rome.tools.
1 page testedHomeBrowser previews
Most significant changes4 other significant changes: Number of Requests 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 Calibre: Site dashboard | View this PR | Edit settings | View documentation |
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.
Looking good from a code perspective.
Should we reconsider promoting noUnusedVariables
considering that it still reports a vast number of false positives?
Do you plan to test the new rules on real projects before merging to verify that they meet our quality criteria?
a6e483c
to
0062d74
Compare
0062d74
to
24e9223
Compare
The current bugs have been closed. For now I moved it to a stable group and marked as not recommended.
Yeah I did, and fixed some false positives in other PRs. We should be good to go. |
Summary
Closes #3503
useAltText
security
as per feat(rome_js_analyze): promote rules #3471 (comment)complexity
as per Move `useTemplate` and `useSimplifiedLogicalExpression` to `style` group #3461useCamelCase
stays innursery
because it's still full of false positives (lots of them happen in our repo)noUnreachable
because we need data in order to make the CFG better, and this rule is perfect because because it reaches the boundaries of the feature. Although it means that we will need to focus out attention on possible bugs: @leops @xunilrj , what do you think?This PR promotes the following rules:
noPositiveTabindex
nursery
a11y
true
useKeyWithMouseEvents
nursery
a11y
true
useAnchorContent
nursery
a11y
true
useBlankTarget
nursery
a11y
true
useValidAnchor
nursery
a11y
true
useKeyWithClickEvents
nursery
a11y
true
useButtonType
nursery
a11y
true
noAutofocus
nursery
a11y
true
useFragmentSyntax
nursery
style
true
useTemplate
correctness
style
true
useBlockStatements
correctness
style
true
noImplicitBoolean
correctness
style
true
useCamelCase
nursery
style
true
useOptionalOperator
nursery
style
true
noVoidElementsWithChildren
nursery
correctness
true
noChildrenProp
nursery
correctness
true
noArrayIndexKey
nursery
correctness
true
noRenderReturnValue
nursery
correctness
true
noNewSymbol
nursery
correctness
true
noUselessFragments
nursery
correctness
true
noUnusedVariables
nursery
correctness
false
noUnreachable
nursery
correctness
true
noUnusedVariables
nursery
correctness
true
noRestrictedGlobals
nursery
correctness
true
useSimplifiedLogicExpression
correctness
complexity
true
noExtraBooleanCast
correctness
complexity
true
noDangerouslySetInnerHtml
nursery
security
true
noDangerouslySetInnerHtmlWithChildren
nursery
security
true
noDebugger
correctness
security
true
Test Plan
Snapshot tests should only have their category updated. If there's some code frame changed/removed, it means something has been incorrectly moved.