Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
feat(rome_js_analyze): promote rules
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Oct 25, 2022
1 parent 42d9f1d commit 12a515a
Show file tree
Hide file tree
Showing 150 changed files with 1,299 additions and 1,133 deletions.
64 changes: 35 additions & 29 deletions crates/rome_diagnostics_categories/src/categories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

define_dategories! {
// Lint categories
// correctness
"lint/correctness/noArguments": "https://rome.tools/docs/lint/rules/noArguments",
"lint/correctness/noAsyncPromiseExecutor": "https://rome.tools/docs/lint/rules/noAsyncPromiseExecutor",
"lint/correctness/noCatchAssign": "https://rome.tools/docs/lint/rules/noCatchAssign",
Expand All @@ -31,44 +32,49 @@ define_dategories! {
"lint/correctness/noUnsafeNegation": "https://rome.tools/docs/lint/rules/noUnsafeNegation",
"lint/correctness/noUnusedTemplateLiteral": "https://rome.tools/docs/lint/rules/noUnusedTemplateLiteral",
"lint/correctness/useBlockStatements": "https://rome.tools/docs/lint/rules/useBlockStatements",
"lint/correctness/useSimplifiedLogicExpression": "https://rome.tools/docs/lint/rules/useSimplifiedLogicExpression",
"lint/correctness/useSingleCaseStatement": "https://rome.tools/docs/lint/rules/useSingleCaseStatement",
"lint/correctness/useSingleVarDeclarator": "https://rome.tools/docs/lint/rules/useSingleVarDeclarator",
"lint/correctness/useTemplate": "https://rome.tools/docs/lint/rules/useTemplate",
"lint/correctness/useValidTypeof": "https://rome.tools/docs/lint/rules/useValidTypeof",
"lint/correctness/useWhile": "https://rome.tools/docs/lint/rules/useWhile",
"lint/nursery/noDangerouslySetInnerHtml": "https://rome.tools/docs/lint/rules/noDangerouslySetInnerHtml",
"lint/nursery/noNewSymbol": "https://rome.tools/docs/lint/rules/noNewSymbol",
"lint/nursery/noRenderReturnValue": "https://rome.tools/docs/lint/rules/noRenderReturnValue",
"lint/nursery/noUnreachable": "https://rome.tools/docs/lint/rules/noUnreachable",
"lint/nursery/noUnusedVariables": "https://rome.tools/docs/lint/rules/noUnusedVariables",
"lint/nursery/noUselessFragments": "https://rome.tools/docs/lint/rules/noUselessFragments",
"lint/nursery/useButtonType": "https://rome.tools/docs/lint/rules/useButtonType",
"lint/nursery/useCamelCase": "https://rome.tools/docs/lint/rules/useCamelCase",
"lint/nursery/useOptionalChain": "https://rome.tools/docs/lint/rules/useOptionalChain",
"lint/nursery/noUndeclaredVariables": "https://rome.tools/docs/lint/rules/noUndeclaredVariables",
"lint/nursery/noVoidElementsWithChildren": "https://rome.tools/docs/lint/rules/noVoidElementsWithChildren",
"lint/nursery/noChildrenProp": "https://rome.tools/docs/lint/rules/noChildrenProp",
"lint/nursery/useFragmentSyntax": "https://rome.tools/docs/lint/rules/useFragmentSyntax",
"lint/nursery/noArrayIndexKey": "https://rome.tools/docs/lint/rules/noArrayIndexKey",
"lint/nursery/noDangerouslySetInnerHtmlWithChildren": "https://rome.tools/docs/lint/rules/noDangerouslySetInnerHtmlWithChildren",
"lint/nursery/noAutofocus": "https://rome.tools/docs/lint/rules/noAutofocus",
"lint/nursery/useKeyWithMouseEvents": "https://rome.tools/docs/lint/rules/useKeyWithMouseEvents",
"lint/nursery/useAnchorContent": "https://rome.tools/docs/lint/rules/useAnchorContent",
"lint/nursery/useBlankTarget": "https://rome.tools/docs/lint/rules/useBlankTarget",
"lint/nursery/useValidAnchor": "https://rome.tools/docs/lint/rules/useValidAnchor",
"lint/nursery/useKeyWithClickEvents": "https://rome.tools/docs/lint/rules/useKeyWithClickEvents",
"lint/nursery/noRestrictedGlobals": "https://rome.tools/docs/lint/rules/noRestrictedGlobals",
"lint/nursery/useFlatMap": "https://rome.tools/docs/lint/rules/useFlatMap",
"lint/nursery/noPositiveTabindex": "https://rome.tools/docs/lint/rules/noPositiveTabindex",
"lint/nursery/noConstAssign": "https://rome.tools/docs/lint/rules/noConstAssign",
"lint/nursery/noExplicitAny": "https://rome.tools/docs/lint/rules/noExplicitAny",
"lint/nursery/useValidForDirection": "https://rome.tools/docs/lint/rules/useValidForDirection",
"lint/correctness/noDangerouslySetInnerHtml": "https://rome.tools/docs/lint/rules/noDangerouslySetInnerHtml",
"lint/correctness/noNewSymbol": "https://rome.tools/docs/lint/rules/noNewSymbol",
"lint/correctness/noRenderReturnValue": "https://rome.tools/docs/lint/rules/noRenderReturnValue",
"lint/correctness/noUselessFragments": "https://rome.tools/docs/lint/rules/noUselessFragments",
"lint/correctness/noVoidElementsWithChildren": "https://rome.tools/docs/lint/rules/noVoidElementsWithChildren",
"lint/correctness/noChildrenProp": "https://rome.tools/docs/lint/rules/noChildrenProp",
"lint/correctness/noArrayIndexKey": "https://rome.tools/docs/lint/rules/noArrayIndexKey",
"lint/correctness/noDangerouslySetInnerHtmlWithChildren": "https://rome.tools/docs/lint/rules/noDangerouslySetInnerHtmlWithChildren",
"lint/correctness/noAutofocus": "https://rome.tools/docs/lint/rules/noAutofocus",
// style category
"lint/style/noNegationElse": "https://rome.tools/docs/lint/rules/noNegationElse",
"lint/style/noShoutyConstants": "https://rome.tools/docs/lint/rules/noShoutyConstants",
"lint/style/useSelfClosingElements": "https://rome.tools/docs/lint/rules/useSelfClosingElements",
"lint/style/useShorthandArrayType": "https://rome.tools/docs/lint/rules/useShorthandArrayType",
"lint/style/useFragmentSyntax": "https://rome.tools/docs/lint/rules/useFragmentSyntax",
"lint/style/useTemplate": "https://rome.tools/docs/lint/rules/useTemplate",
// complexity
"lint/complexity/useSimplifiedLogicExpression": "https://rome.tools/docs/lint/rules/useSimplifiedLogicExpression",

// a11y category
"lint/a11y/noPositiveTabindex": "https://rome.tools/docs/lint/rules/noPositiveTabindex",
"lint/a11y/useKeyWithMouseEvents": "https://rome.tools/docs/lint/rules/useKeyWithMouseEvents",
"lint/a11y/useAnchorContent": "https://rome.tools/docs/lint/rules/useAnchorContent",
"lint/a11y/useBlankTarget": "https://rome.tools/docs/lint/rules/useBlankTarget",
"lint/a11y/useValidAnchor": "https://rome.tools/docs/lint/rules/useValidAnchor",
"lint/a11y/useKeyWithClickEvents": "https://rome.tools/docs/lint/rules/useKeyWithClickEvents",
"lint/a11y/useButtonType": "https://rome.tools/docs/lint/rules/useButtonType",
// nursery
"lint/nursery/noRestrictedGlobals": "https://rome.tools/docs/lint/rules/noRestrictedGlobals",
"lint/nursery/useFlatMap": "https://rome.tools/docs/lint/rules/useFlatMap",
"lint/nursery/noConstAssign": "https://rome.tools/docs/lint/rules/noConstAssign",
"lint/nursery/noExplicitAny": "https://rome.tools/docs/lint/rules/noExplicitAny",
"lint/nursery/useCamelCase": "https://rome.tools/docs/lint/rules/useCamelCase",
"lint/nursery/useOptionalChain": "https://rome.tools/docs/lint/rules/useOptionalChain",
"lint/nursery/noUndeclaredVariables": "https://rome.tools/docs/lint/rules/noUndeclaredVariables",
"lint/nursery/noUnreachable": "https://rome.tools/docs/lint/rules/noUnreachable",
"lint/nursery/noUnusedVariables": "https://rome.tools/docs/lint/rules/noUnusedVariables",
;

// General categories
"files/missingHandler",
"format",
Expand Down
4 changes: 3 additions & 1 deletion crates/rome_js_analyze/src/analyzers.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions crates/rome_js_analyze/src/analyzers/a11y.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions crates/rome_js_analyze/src/analyzers/complexity.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions crates/rome_js_analyze/src/analyzers/correctness.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 1 addition & 9 deletions crates/rome_js_analyze/src/analyzers/nursery.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion crates/rome_js_analyze/src/analyzers/style.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion crates/rome_js_analyze/src/semantic_analyzers.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions crates/rome_js_analyze/src/semantic_analyzers/a11y.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion crates/rome_js_analyze/src/semantic_analyzers/correctness.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 1 addition & 11 deletions crates/rome_js_analyze/src/semantic_analyzers/nursery.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion crates/rome_js_analyze/src/semantic_analyzers/style.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
source: crates/rome_js_analyze/tests/spec_tests.rs
expression: noAutoFocusInvalid.jsx
---
# Input
```js
<>
<button autoFocus />
<input autoFocus />
<input autoFocus="true" />
<input autoFocus={undefined} />
<input autoFocus={"false"} />
<input autoFocus={"false"} /*comment*/ />
<input /*comment*/ autoFocus={"false"} />
<input autoFocus={"false" /*comment*/} />
<input /*comment*/ autoFocus={"false"} /*comment*/ />
</>
```


Loading

0 comments on commit 12a515a

Please sign in to comment.