-
Notifications
You must be signed in to change notification settings - Fork 660
feat(rome_js_analyzer): promote nursery rules #4239
Conversation
✅ Deploy Preview for docs-rometools canceled.
|
ca070f3
to
d4c356f
Compare
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.
Some suggestions:
-
Because
noDuplicateParameters
is in suspicious, I think thatnoDuplicateObjectKeys
should also be in suspicious. -
Because
noExtraNonNullAssertion
is part of suspicious, we could movenoNonNullAssertion
in style. -
I could move
noSetterReturn
to correctness. -
In contrast, I could move
noConstructorReturn
to suspicious because there are non-idiomatic use of return in a constructor. -
I could move
useEnumInitializers
andnoConstEnum
to style.
Rules noVar and useConst are a bit controversial. I needed to figure out where to put them.
They don't catch any bug, so correctness. People can use var all over their code base, which should be fine.
I think style is a good place for them :)
I don't want Rome to get in the way of developers too much.
This means that these rules are not in recommended?
By the way, I am wondering if we should un-promote some rules that are known as unstable (i.e. move them to nursery). I am thinking about useOptionalChain
#4145 and useSimplifiedLogicExpression
#4163.
Regarding |
@Conaclos Thank you for all your suggestions! They all make sense! Here some question for you:
Any particular reason why? It makes sense for
They are recommended. They just go under a category that forces how to style your code.
|
You are right. Let's keep it in suspicious.
I think it is a good rule to have and to recommend. I proposed to temporary move the rule to nursery because of the reported issues. Another solution could be to fix most of its issues before the release. Not sure how to proceed... |
Yeah, let's see if we can flash out a fix for it. I think it's worth it! |
c78cbd9
to
285c963
Compare
0ebc456
to
be16112
Compare
be16112
to
38000ff
Compare
I will merge it; if you have any concerns or proposals, feel free to comment or open a PR to update the promotion of the rules. |
Summary
This PR aims to promote the
nursery
rules that were shipped since11.0.0
version. Here's a breakdown of the changes:suspicious
noEmptyInterface
noExtraNonNullAssertion
noRedundantUseStrict
noConstEnum
useDefaultSwitchClauseLast
correctness
noUnsafeFinally
noDuplicateObjectKeys
noConstructorReturn
noPrecisionLoss
noVoidTypeReturn
noStringCaseMismatch
noSetterReturn
style
useExponentiationOperator
useNumericLiterals
useDefaultParameterLast
useConst
noVar
useEnumInitializers
noNonNullAssertion
a11y
noDistractingElements
noHeaderScope
noAccessKey
complexity
useSimplifiedLogicExpression
not recommendedOpen questions
Rules
noVar
anduseConst
are a bit controversial. I needed to figure out where to put them.They don't catch any bug, so
correctness
. People can usevar
all over their code base, which should be fine.I don't want Rome to get in the way of developers too much.
I am happy to have some feedback and ear opinions!
Test Plan
CI should pass
Documentation
Not needed, everything is autogenerated.