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

Commit

Permalink
chore: promote more rules, review groups
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Oct 25, 2022
1 parent 6366190 commit a0cc990
Show file tree
Hide file tree
Showing 148 changed files with 1,102 additions and 800 deletions.
34 changes: 20 additions & 14 deletions crates/rome_diagnostics_categories/src/categories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ define_dategories! {
"lint/correctness/noDoubleEquals": "https://rome.tools/docs/lint/rules/noDoubleEquals",
"lint/correctness/noDupeArgs": "https://rome.tools/docs/lint/rules/noDupeArgs",
"lint/correctness/noEmptyPattern": "https://rome.tools/docs/lint/rules/noEmptyPattern",
"lint/correctness/noExtraBooleanCast": "https://rome.tools/docs/lint/rules/noExtraBooleanCast",
"lint/correctness/noFunctionAssign": "https://rome.tools/docs/lint/rules/noFunctionAssign",
"lint/correctness/noImplicitBoolean": "https://rome.tools/docs/lint/rules/noImplicitBoolean",
"lint/correctness/noImportAssign": "https://rome.tools/docs/lint/rules/noImportAssign",
Expand All @@ -36,43 +35,50 @@ define_dategories! {
"lint/correctness/useSingleVarDeclarator": "https://rome.tools/docs/lint/rules/useSingleVarDeclarator",
"lint/correctness/useValidTypeof": "https://rome.tools/docs/lint/rules/useValidTypeof",
"lint/correctness/useWhile": "https://rome.tools/docs/lint/rules/useWhile",
"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",
"lint/correctness/noUnusedVariables": "https://rome.tools/docs/lint/rules/noUnusedVariables",
"lint/correctness/noUnreachable": "https://rome.tools/docs/lint/rules/noUnreachable",
"lint/correctness/noRestrictedGlobals": "https://rome.tools/docs/lint/rules/noRestrictedGlobals",
"lint/correctness/useOptionalChain": "https://rome.tools/docs/lint/rules/useOptionalChain",
"lint/correctness/noUndeclaredVariables": "https://rome.tools/docs/lint/rules/noUndeclaredVariables",

// 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",
"lint/style/useCamelCase": "https://rome.tools/docs/lint/rules/useCamelCase",

// complexity
"lint/complexity/useSimplifiedLogicExpression": "https://rome.tools/docs/lint/rules/useSimplifiedLogicExpression",
"lint/complexity/noExtraBooleanCast": "https://rome.tools/docs/lint/rules/noExtraBooleanCast",

// a11y category
"lint/a11y/noAutofocus": "https://rome.tools/docs/lint/rules/noAutofocus",
"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",
// react
"lint/react/noDangerouslySetInnerHtml": "https://rome.tools/docs/lint/rules/noDangerouslySetInnerHtml",
"lint/react/noDangerouslySetInnerHtmlWithChildren": "https://rome.tools/docs/lint/rules/noDangerouslySetInnerHtmlWithChildren",
"lint/react/noVoidElementsWithChildren": "https://rome.tools/docs/lint/rules/noVoidElementsWithChildren",
"lint/react/noChildrenProp": "https://rome.tools/docs/lint/rules/noChildrenProp",
"lint/react/noRenderReturnValue": "https://rome.tools/docs/lint/rules/noRenderReturnValue",
"lint/react/noArrayIndexKey": "https://rome.tools/docs/lint/rules/noArrayIndexKey",



// 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",
"lint/nursery/useValidForDirection": "https://rome.tools/docs/lint/rules/useValidForDirection",
;

Expand Down
3 changes: 2 additions & 1 deletion 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.

3 changes: 2 additions & 1 deletion 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.

4 changes: 1 addition & 3 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/semantic_analyzers.rs

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

11 changes: 4 additions & 7 deletions 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.

Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use crate::semantic_analyzers::nursery::no_undeclared_variables::AnyIdentifier;
use crate::semantic_services::SemanticServices;
use rome_analyze::context::RuleContext;
use rome_analyze::{declare_rule, Rule, RuleDiagnostic};
use rome_console::markup;
use rome_js_semantic::{Binding, DeclarationExtensions};
use rome_js_syntax::{JsReferenceIdentifier, JsxReferenceIdentifier, TextRange};
use rome_js_syntax::{
JsIdentifierAssignment, JsReferenceIdentifier, JsxReferenceIdentifier, TextRange,
};
use rome_rowan::{declare_node_union, AstNode};

declare_rule! {
Expand Down Expand Up @@ -35,7 +36,7 @@ declare_rule! {
}

declare_node_union! {
pub(crate) AnyReferenceIdentifier = JsReferenceIdentifier |JsxReferenceIdentifier
pub(crate) AnyIdentifier = JsReferenceIdentifier | JsIdentifierAssignment | JsxReferenceIdentifier
}

const RESTRICTED_GLOBALS: [&str; 2] = ["event", "error"];
Expand Down
6 changes: 1 addition & 5 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.

10 changes: 10 additions & 0 deletions crates/rome_js_analyze/src/semantic_analyzers/react.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.

Loading

0 comments on commit a0cc990

Please sign in to comment.