diff --git a/CHANGELOG.md b/CHANGELOG.md index a63fbbf0ce2d..e29eb9099b63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,16 +8,18 @@ Read our [guidelines to categorize a change](https://biomejs.dev/internals/versi New entries must be placed in a section entitled `Unreleased`. Read our [guidelines for writing a good changelog entry](https://github.com/biomejs/biome/blob/main/CONTRIBUTING.md#changelog). -## Unreleased - -### Analyzer +## 1.4.0 (2023-11-27) ### CLI - Remove the CLI options from the `lsp-proxy`, as they were never meant to be passed to that command. Contributed by @ematipico + - Add option `--config-path` to `lsp-proxy` and `start` commands. It's now possible to tell the Daemon server to load `biome.json` from a custom path. Contributed by @ematipico - Add new `--diagnostic-level` option to let users control the level of diagnostics printed by the CLI. Possible values are: `"info"`, `"warn"`, `"hint"`. Contributed by @simonxabris +- Add option `--line-feed` to the `format` command. Contributed by @SuperchupuDev +- Add option `--bracket-same-line` to the `format` command. Contributed by @faultyserve +- Add option `--bracket-spacing` to the `format` command. Contributed by @faultyserve #### Bug fixes @@ -25,7 +27,9 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom ### Configuration -### Editors +- Add option `formatter.lineFeed`. Contributed by @SuperchupuDev +- Add option `javascript.formatter.bracketSameLine`. Contributed by @faultyserve +- Add option `javascript.formatter.bracketSpacing`. Contributed by @faultyserve ### Formatter @@ -33,6 +37,7 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom - Add a new option [`--line-ending`](https://biomejs.dev/reference/configuration/#formatterlineending). This option allows changing the type of line endings. Contributed by @SuperchupuDev - Added a new option called `--bracket-spacing` to the formatter. This option allows you to control whether spaces are inserted around the brackets of object literals. [#627](https://github.com/biomejs/biome/issues/627). Contributed by @faultyserver +- Added a new option called `--bracket-same-line` to the formatter. This option allows you to control whether spaces are inserted around the brackets of object literals. [#627](https://github.com/biomejs/biome/issues/627). Contributed by @faultyserver #### Bug fixes @@ -40,19 +45,59 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom - Fix [#301](https://github.com/biomejs/biome/issues/301), the formatter should not break before the `in` keyword. Contributed by @ematipico -### JavaScript APIs - ### Linter +#### Promoted rules + +- [a11y/noInteractiveElementToNoninteractiveRole](https://biomejs.dev/linter/rules/no-interactive-element-to-noninteractive-role) +- [complexity/noThisInStatic](https://biomejs.dev/linter/rules/no-this-in-static) +- [complexity/useArrowFunction](https://biomejs.dev/linter/rules/use-arrow-function) +- [correctness/noEmptyCharacterClassInRegex](https://biomejs.dev/linter/rules/no-empty-character-class-in-regex) +- [correctness/noInvalidNewBuiltin](https://biomejs.dev/linter/rules/no-invalid-new-builtin) +- [style/noUselessElse](https://biomejs.dev/linter/rules/no-useless-else) +- [style/useAsConstAssertion](https://biomejs.dev/linter/rules/use-as-const-assertion) +- [style/useShorthandAssign](https://biomejs.dev/linter/rules/use-shorthand-assign) +- [suspicious/noApproximativeNumericConstant](https://biomejs.dev/linter/rules/no-approximative-numeric-constant) +- [suspicious/noMisleadingInstantiator](https://biomejs.dev/linter/rules/no-misleading-instantiator) +- [suspicious/noMisrefactoredShorthandAssign](https://biomejs.dev/linter/rules/no-misrefactored-shorthand-assign) + +The following rules are now recommended: + +- [a11y/noAccessKey](https://biomejs.dev/linter/rules/no-access-key) +- [a11y/useHeadingContent](https://biomejs.dev/linter/rules/use-heading-content) +- [complexity/useSimpleNumberKeys](https://biomejs.dev/linter/use-simple-number-keys) + +The following rules are now deprecated: + +- [correctness/noNewSymbol](https://biomejs.dev/linter/rules/no-new-symbol) + The rule is replaced by [correctness/noInvalidNewBuiltin](https://biomejs.dev/linter/rules/no-invalid-new-builtin) + #### New features - Add [noDefaultExport](https://biomejs.dev/linter/rules/no-default-export) which disallows `export default`. Contributed by @Conaclos +- Add [noAriaHiddenOnFocusable](https://biomejs.dev/linter/rules/no-aria-hidden-on-focusable) which reports hidden and focusable elements. Contributed by @vasucp1207 + +- Add [noImplicitAnyLet](https://biomejs.dev/linter/rules/no-implicit-any-let) that reports variables declared with `let` and without initialization and type annotation. Contributed by @TaKO8Ki and @b4s36t4 + +- Add [useAwait](https://biomejs.dev/linter/rules/use-await) that reports `async` functions that don't use an `await` expression. + +- Add [useValidAriaRole](https://biomejs.dev/linter/rules/use-valid-aria-role). Contributed by @vasucp1207 + +- Add [useRegexLiterals](https://biomejs.dev/linter/use-regex-literals) that suggests turning call to the regex constructor into regex literals. COntributed by @Yuiki + +#### Enhancements + +- Add an unsafe code fix for [a11y/useAriaActivedescendantWithTabindex](https://biomejs.dev/linter/rules/use-aria-activedescendant-with-tabindex) + #### Bug fixes - Fix [#639](https://github.com/biomejs/biome/issues/639) by ignoring unused TypeScript's mapped key. Contributed by @Conaclos + - Fix [#565](https://github.com/biomejs/biome/issues/565) by handling several `infer` with the same name in extends clauses of TypeScript's conditional types. Contributed by @Conaclos + - Fix [#653](https://github.com/biomejs/biome/issues/653). [noUnusedImports](https://biomejs.dev/linter/rules/no-unused-imports) now correctly removes the entire line where the unused `import` is. Contributed by @Conaclos + - Fix [#607](https://github.com/biomejs/biome/issues/609) `useExhaustiveDependencies`, ignore optional chaining, Contributed by @msdlisper - Fix [#676](https://github.com/biomejs/biome/issues/676), by using the correct node for the `"noreferrer"` when applying the code action. Contributed by @ematipico @@ -63,6 +108,16 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom - Fix [#784](https://github.com/biomejs/biome/issues/784), [noSvgWithoutTitle](https://biomejs.dev/linter/rules/no-svg-without-title) fixes false-positives to `aria-label` and reports svg's role attribute is implicit. Contributed by @unvalley +- Fix [#834](https://github.com/biomejs/biome/issues/834) that made [noUselessLoneBlockStatements](https://biomejs.dev/linter/rules/no-useless-lone-block-statements) reports block statements of switch clauses. Contributed by @vasucp1207 + +- Fix [#783](https://github.com/biomejs/biome/issues/834) that made [noUselessLoneBlockStatements](https://biomejs.dev/linter/rules/no-useless-lone-block-statements) reports block statements of `try-catch` structures. Contributed by @hougesen + +- Fix [#69](https://github.com/biomejs/biome/issues/69) that made [correctness/noUnnecessaryContinue](https://biomejs.dev/linter/rules/no-unnecessary-continue) incorrectly reports a `continue` used to break a switch clause. Contributed by @TaKO8Ki + +- Fix [#664](https://github.com/biomejs/biome/issues/664) by improving the diagnostic of [style/useNamingConvention](https://biomejs.dev/linter/use-naming-convention) when double capital are detected in strict camel case mode. Contributed by @vasucp1207 + +- Fix [#643](https://github.com/biomejs/biome/issues/643) that erroneously parsed the option of [complexity/useExhaustiveDependencies](https://biomejs.dev/linter/use-naming-convention). Contributed by @arendjr + ### Parser #### Bug fixes @@ -103,6 +158,12 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom ### Linter +#### New features + +- Add [noUnusedPrivateClassMembers](https://biomejs.dev/linter/rules/no-unused-private-class-members) rule. + The rule disallow unused private class members. + Contributed by @victor-teles + #### Bug fixes - Fix [#175](https://github.com/biomejs/biome/issues/175) which made [noRedeclare](https://biomejs.dev/linter/rules/no-redeclare) report index signatures using the name of a variable in the parent scope. @@ -120,12 +181,6 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom - Fix [#609](https://github.com/biomejs/biome/issues/609) `useExhaustiveDependencies`, by removing `useContext`, `useId` and `useSyncExternalStore` from the known hooks. Contributed by @msdlisper - Fix `useExhaustiveDependencies`, by removing `useContext`, `useId` and `useSyncExternalStore` from the known hooks. Contributed by @msdlisper -#### New features - -- Add [noUnusedPrivateClassMembers](https://biomejs.dev/linter/rules/no-unused-private-class-members) rule. - The rule disallow unused private class members. - Contributed by @victor-teles - ### Parser #### Enhancements @@ -141,7 +196,6 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom - Fix `rage` command, now it doesn't print info about running servers. Contributed by @ematipico - ### Editors #### Bug fixes diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8d9a637d63d8..22fee1eacbb3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -402,14 +402,15 @@ Members are listed in alphabetical order. Members are free to use the full name, ### Core Contributors team -- [Hiroki Ihoriya @unvalley](https://github.com/unvalley) - [Daiki Nishikawa @nissy-dev](https://github.com/nissy-dev) - [Denis Bezrukov @denbezrukov](https://github.com/denbezrukov) +- [Hiroki Ihoriya @unvalley](https://github.com/unvalley) ### Maintainers team +- [Jon Egeland @faultyserver](https://github.com/faultyserver) +- [Madeline Gurriarán @SuperchupuDev](https://github.com/SuperchupuDev) - [Nicolas Hedger @nhedger](https://github.com/nhedger) - [Victor Teles @victor-teles](https://github.com/victor-teles) -- [Madeline Gurriarán @SuperchupuDev](https://github.com/SuperchupuDev) - [Takayuki Maeda @TaKO8Ki](https://github.com/TaKO8Ki) - [Jon Egeland @faultyserver](https://github.com/faultyserver) diff --git a/crates/biome_cli/tests/snapshots/main_commands_check/config_recommended_group.snap b/crates/biome_cli/tests/snapshots/main_commands_check/config_recommended_group.snap index 846535292c0b..7428e8fefd08 100644 --- a/crates/biome_cli/tests/snapshots/main_commands_check/config_recommended_group.snap +++ b/crates/biome_cli/tests/snapshots/main_commands_check/config_recommended_group.snap @@ -37,13 +37,15 @@ check ━━━━━━━━━━━━━━━━━━━━━━━━ # Emitted Messages ```block -check.js:1:1 lint/correctness/noNewSymbol FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +check.js:1:1 lint/correctness/noInvalidNewBuiltin FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Symbol cannot be called as a constructor. > 1 │ new Symbol(""); │ ^^^^^^^^^^^^^^ + i Calling Symbol with the new operator throws a TypeError. + i Unsafe fix: Remove new. 1 │ new·Symbol(""); diff --git a/crates/biome_cli/tests/snapshots/main_commands_lint/config_recommended_group.snap b/crates/biome_cli/tests/snapshots/main_commands_lint/config_recommended_group.snap index c87e3a648106..53467f1b16e0 100644 --- a/crates/biome_cli/tests/snapshots/main_commands_lint/config_recommended_group.snap +++ b/crates/biome_cli/tests/snapshots/main_commands_lint/config_recommended_group.snap @@ -37,13 +37,15 @@ lint ━━━━━━━━━━━━━━━━━━━━━━━━━ # Emitted Messages ```block -check.js:1:1 lint/correctness/noNewSymbol FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +check.js:1:1 lint/correctness/noInvalidNewBuiltin FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Symbol cannot be called as a constructor. > 1 │ new Symbol(""); │ ^^^^^^^^^^^^^^ + i Calling Symbol with the new operator throws a TypeError. + i Unsafe fix: Remove new. 1 │ new·Symbol(""); diff --git a/crates/biome_cli/tests/snapshots/main_configuration/incorrect_rule_name.snap b/crates/biome_cli/tests/snapshots/main_configuration/incorrect_rule_name.snap index 7d19ebc868d4..a5bc6c7621a9 100644 --- a/crates/biome_cli/tests/snapshots/main_configuration/incorrect_rule_name.snap +++ b/crates/biome_cli/tests/snapshots/main_configuration/incorrect_rule_name.snap @@ -53,10 +53,12 @@ biome.json:6:13 deserialize ━━━━━━━━━━━━━━━━━ - noConstAssign - noConstantCondition - noConstructorReturn + - noEmptyCharacterClassInRegex - noEmptyPattern - noGlobalObjectCalls - noInnerDeclarations - noInvalidConstructorSuper + - noInvalidNewBuiltin - noNewSymbol - noNonoctalDecimalEscape - noPrecisionLoss @@ -112,7 +114,9 @@ biome.json:9:13 deserialize ━━━━━━━━━━━━━━━━━ - noRestrictedGlobals - noShoutyConstants - noUnusedTemplateLiteral + - noUselessElse - noVar + - useAsConstAssertion - useBlockStatements - useCollapsedElseIf - useConst @@ -125,6 +129,7 @@ biome.json:9:13 deserialize ━━━━━━━━━━━━━━━━━ - useNumericLiterals - useSelfClosingElements - useShorthandArrayType + - useShorthandAssign - useSingleCaseStatement - useSingleVarDeclarator - useTemplate diff --git a/crates/biome_diagnostics_categories/src/categories.rs b/crates/biome_diagnostics_categories/src/categories.rs index ac2dfbaeef75..5013caa05601 100644 --- a/crates/biome_diagnostics_categories/src/categories.rs +++ b/crates/biome_diagnostics_categories/src/categories.rs @@ -19,6 +19,7 @@ define_categories! { "lint/a11y/noBlankTarget": "https://biomejs.dev/linter/rules/no-blank-target", "lint/a11y/noDistractingElements": "https://biomejs.dev/linter/rules/no-distracting-elements", "lint/a11y/noHeaderScope": "https://biomejs.dev/linter/rules/no-header-scope", + "lint/a11y/noInteractiveElementToNoninteractiveRole": "https://biomejs.dev/linter/rules/no-interactive-element-to-noninteractive-role", "lint/a11y/noNoninteractiveElementToInteractiveRole": "https://biomejs.dev/linter/rules/no-noninteractive-element-to-interactive-role", "lint/a11y/noNoninteractiveTabindex": "https://biomejs.dev/linter/rules/no-noninteractive-tabindex", "lint/a11y/noPositiveTabindex": "https://biomejs.dev/linter/rules/no-positive-tabindex", @@ -27,6 +28,7 @@ define_categories! { "lint/a11y/noSvgWithoutTitle": "https://biomejs.dev/linter/rules/no-svg-without-title", "lint/a11y/useAltText": "https://biomejs.dev/linter/rules/use-alt-text", "lint/a11y/useAnchorContent": "https://biomejs.dev/linter/rules/use-anchor-content", + "lint/a11y/useAriaActivedescendantWithTabindex": "https://biomejs.dev/linter/rules/use-aria-activedescendant-with-tabindex", "lint/a11y/useAriaPropsForRole": "https://biomejs.dev/linter/rules/use-aria-props-for-role", "lint/a11y/useButtonType": "https://biomejs.dev/linter/rules/use-button-type", "lint/a11y/useHeadingContent": "https://biomejs.dev/linter/rules/use-heading-content", @@ -45,6 +47,7 @@ define_categories! { "lint/complexity/noForEach": "https://biomejs.dev/linter/rules/no-for-each", "lint/complexity/noMultipleSpacesInRegularExpressionLiterals": "https://biomejs.dev/linter/rules/no-multiple-spaces-in-regular-expression-literals", "lint/complexity/noStaticOnlyClass": "https://biomejs.dev/linter/rules/no-static-only-class", + "lint/complexity/noThisInStatic": "https://biomejs.dev/linter/rules/no-this-in-static", "lint/complexity/noUselessCatch": "https://biomejs.dev/linter/rules/no-useless-catch", "lint/complexity/noUselessConstructor": "https://biomejs.dev/linter/rules/no-useless-constructor", "lint/complexity/noUselessEmptyExport": "https://biomejs.dev/linter/rules/no-useless-empty-export", @@ -56,6 +59,7 @@ define_categories! { "lint/complexity/noUselessTypeConstraint": "https://biomejs.dev/linter/rules/no-useless-type-constraint", "lint/complexity/noVoid": "https://biomejs.dev/linter/rules/no-void", "lint/complexity/noWith": "https://biomejs.dev/linter/rules/no-with", + "lint/complexity/useArrowFunction": "https://biomejs.dev/linter/rules/use-arrow-function", "lint/complexity/useFlatMap": "https://biomejs.dev/linter/rules/use-flat-map", "lint/complexity/useLiteralKeys": "https://biomejs.dev/linter/rules/use-literal-keys", "lint/complexity/useOptionalChain": "https://biomejs.dev/linter/rules/use-optional-chain", @@ -65,10 +69,12 @@ define_categories! { "lint/correctness/noConstAssign": "https://biomejs.dev/linter/rules/no-const-assign", "lint/correctness/noConstantCondition": "https://biomejs.dev/linter/rules/no-constant-condition", "lint/correctness/noConstructorReturn": "https://biomejs.dev/linter/rules/no-constructor-return", + "lint/correctness/noEmptyCharacterClassInRegex": "https://biomejs.dev/linter/rules/no-empty-character-class-in-regex", "lint/correctness/noEmptyPattern": "https://biomejs.dev/linter/rules/no-empty-pattern", "lint/correctness/noGlobalObjectCalls": "https://biomejs.dev/linter/rules/no-global-object-calls", "lint/correctness/noInnerDeclarations": "https://biomejs.dev/linter/rules/no-inner-declarations", "lint/correctness/noInvalidConstructorSuper": "https://biomejs.dev/linter/rules/no-invalid-constructor-super", + "lint/correctness/noInvalidNewBuiltin": "https://biomejs.dev/linter/rules/no-invalid-new-builtin", "lint/correctness/noNewSymbol": "https://biomejs.dev/linter/rules/no-new-symbol", "lint/correctness/noNonoctalDecimalEscape": "https://biomejs.dev/linter/rules/no-nonoctal-decimal-escape", "lint/correctness/noPrecisionLoss": "https://biomejs.dev/linter/rules/no-precision-loss", @@ -97,26 +103,15 @@ define_categories! { "lint/nursery/noDefaultExport": "https://biomejs.dev/lint/rules/no-default-export", "lint/nursery/noDuplicateJsonKeys": "https://biomejs.dev/linter/rules/no-duplicate-json-keys", "lint/nursery/noEmptyBlockStatements": "https://biomejs.dev/linter/rules/no-empty-block-statements", - "lint/nursery/noEmptyCharacterClassInRegex": "https://biomejs.dev/linter/rules/no-empty-character-class-in-regex", "lint/nursery/noImplicitAnyLet": "https://biomejs.dev/lint/rules/no-implicit-any-let", - "lint/nursery/noInteractiveElementToNoninteractiveRole": "https://biomejs.dev/linter/rules/no-interactive-element-to-noninteractive-role", - "lint/nursery/noInvalidNewBuiltin": "https://biomejs.dev/linter/rules/no-invalid-new-builtin", - "lint/nursery/noMisleadingInstantiator": "https://biomejs.dev/linter/rules/no-misleading-instantiator", - "lint/nursery/noMisrefactoredShorthandAssign": "https://biomejs.dev/linter/rules/no-misrefactored-shorthand-assign", - "lint/nursery/noThisInStatic": "https://biomejs.dev/linter/rules/no-this-in-static", "lint/nursery/noUnusedImports": "https://biomejs.dev/linter/rules/no-unused-imports", "lint/nursery/noUnusedPrivateClassMembers": "https://biomejs.dev/linter/rules/no-unused-private-class-members", - "lint/nursery/noUselessElse": "https://biomejs.dev/linter/rules/no-useless-else", "lint/nursery/noUselessLoneBlockStatements": "https://biomejs.dev/linter/rules/no-useless-lone-block-statements", - "lint/nursery/useAriaActivedescendantWithTabindex": "https://biomejs.dev/linter/rules/use-aria-activedescendant-with-tabindex", - "lint/nursery/useArrowFunction": "https://biomejs.dev/linter/rules/use-arrow-function", - "lint/nursery/useAsConstAssertion": "https://biomejs.dev/linter/rules/use-as-const-assertion", "lint/nursery/useAwait": "https://biomejs.dev/linter/rules/use-await", "lint/nursery/useBiomeSuppressionComment": "https://biomejs.dev/linter/rules/use-biome-suppression-comment", "lint/nursery/useGroupedTypeImport": "https://biomejs.dev/linter/rules/use-grouped-type-import", "lint/nursery/useImportRestrictions": "https://biomejs.dev/linter/rules/use-import-restrictions", "lint/nursery/useRegexLiterals": "https://biomejs.dev/linter/rules/use-regex-literals", - "lint/nursery/useShorthandAssign": "https://biomejs.dev/linter/rules/use-shorthand-assign", "lint/nursery/useValidAriaRole": "https://biomejs.dev/lint/rules/use-valid-aria-role", "lint/performance/noAccumulatingSpread": "https://biomejs.dev/linter/rules/no-accumulating-spread", "lint/performance/noDelete": "https://biomejs.dev/linter/rules/no-delete", @@ -134,7 +129,9 @@ define_categories! { "lint/style/noRestrictedGlobals": "https://biomejs.dev/linter/rules/no-restricted-globals", "lint/style/noShoutyConstants": "https://biomejs.dev/linter/rules/no-shouty-constants", "lint/style/noUnusedTemplateLiteral": "https://biomejs.dev/linter/rules/no-unused-template-literal", + "lint/style/noUselessElse": "https://biomejs.dev/linter/rules/no-useless-else", "lint/style/noVar": "https://biomejs.dev/linter/rules/no-var", + "lint/style/useAsConstAssertion": "https://biomejs.dev/linter/rules/use-as-const-assertion", "lint/style/useBlockStatements": "https://biomejs.dev/linter/rules/use-block-statements", "lint/style/useCollapsedElseIf": "https://biomejs.dev/linter/rules/use-collapsed-else-if", "lint/style/useConst": "https://biomejs.dev/linter/rules/use-const", @@ -147,10 +144,12 @@ define_categories! { "lint/style/useNumericLiterals": "https://biomejs.dev/linter/rules/use-numeric-literals", "lint/style/useSelfClosingElements": "https://biomejs.dev/linter/rules/use-self-closing-elements", "lint/style/useShorthandArrayType": "https://biomejs.dev/linter/rules/use-shorthand-array-type", + "lint/style/useShorthandAssign": "https://biomejs.dev/linter/rules/use-shorthand-assign", "lint/style/useSingleCaseStatement": "https://biomejs.dev/linter/rules/use-single-case-statement", "lint/style/useSingleVarDeclarator": "https://biomejs.dev/linter/rules/use-single-var-declarator", "lint/style/useTemplate": "https://biomejs.dev/linter/rules/use-template", "lint/style/useWhile": "https://biomejs.dev/linter/rules/use-while", + "lint/suspicious/noApproximativeNumericConstant": "https://biomejs.dev/linter/rules/no-approximative-numeric-constant", "lint/suspicious/noArrayIndexKey": "https://biomejs.dev/linter/rules/no-array-index-key", "lint/suspicious/noAssignInExpressions": "https://biomejs.dev/linter/rules/no-assign-in-expressions", "lint/suspicious/noAsyncPromiseExecutor": "https://biomejs.dev/linter/rules/no-async-promise-executor", @@ -179,6 +178,8 @@ define_categories! { "lint/suspicious/noGlobalIsNan": "https://biomejs.dev/linter/rules/no-global-is-nan", "lint/suspicious/noImportAssign": "https://biomejs.dev/linter/rules/no-import-assign", "lint/suspicious/noLabelVar": "https://biomejs.dev/linter/rules/no-label-var", + "lint/suspicious/noMisleadingInstantiator": "https://biomejs.dev/linter/rules/no-misleading-instantiator", + "lint/suspicious/noMisrefactoredShorthandAssign": "https://biomejs.dev/linter/rules/no-misrefactored-shorthand-assign", "lint/suspicious/noPrototypeBuiltins": "https://biomejs.dev/linter/rules/no-prototype-builtins", "lint/suspicious/noRedeclare": "https://biomejs.dev/linter/rules/no-redeclare", "lint/suspicious/noRedundantUseStrict": "https://biomejs.dev/linter/rules/no-redundant-use-strict", diff --git a/crates/biome_js_analyze/src/analyzers/a11y/no_access_key.rs b/crates/biome_js_analyze/src/analyzers/a11y/no_access_key.rs index db844059e3ba..408365eeba8b 100644 --- a/crates/biome_js_analyze/src/analyzers/a11y/no_access_key.rs +++ b/crates/biome_js_analyze/src/analyzers/a11y/no_access_key.rs @@ -39,7 +39,7 @@ declare_rule! { pub(crate) NoAccessKey { version: "1.0.0", name: "noAccessKey", - recommended: false, + recommended: true, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/analyzers/a11y/use_heading_content.rs b/crates/biome_js_analyze/src/analyzers/a11y/use_heading_content.rs index 5c9912ea4100..b2cd32cec9e8 100644 --- a/crates/biome_js_analyze/src/analyzers/a11y/use_heading_content.rs +++ b/crates/biome_js_analyze/src/analyzers/a11y/use_heading_content.rs @@ -47,7 +47,7 @@ declare_rule! { pub(crate) UseHeadingContent { version: "1.0.0", name: "useHeadingContent", - recommended: false, + recommended: true, } } diff --git a/crates/biome_js_analyze/src/analyzers/complexity.rs b/crates/biome_js_analyze/src/analyzers/complexity.rs index ca9da3249ba6..17f7f3be0637 100644 --- a/crates/biome_js_analyze/src/analyzers/complexity.rs +++ b/crates/biome_js_analyze/src/analyzers/complexity.rs @@ -16,6 +16,7 @@ pub(crate) mod no_useless_switch_case; pub(crate) mod no_useless_type_constraint; pub(crate) mod no_void; pub(crate) mod no_with; +pub(crate) mod use_arrow_function; pub(crate) mod use_flat_map; pub(crate) mod use_literal_keys; pub(crate) mod use_optional_chain; @@ -40,6 +41,7 @@ declare_group! { self :: no_useless_type_constraint :: NoUselessTypeConstraint , self :: no_void :: NoVoid , self :: no_with :: NoWith , + self :: use_arrow_function :: UseArrowFunction , self :: use_flat_map :: UseFlatMap , self :: use_literal_keys :: UseLiteralKeys , self :: use_optional_chain :: UseOptionalChain , diff --git a/crates/biome_js_analyze/src/analyzers/nursery/use_arrow_function.rs b/crates/biome_js_analyze/src/analyzers/complexity/use_arrow_function.rs similarity index 100% rename from crates/biome_js_analyze/src/analyzers/nursery/use_arrow_function.rs rename to crates/biome_js_analyze/src/analyzers/complexity/use_arrow_function.rs diff --git a/crates/biome_js_analyze/src/analyzers/complexity/use_simple_number_keys.rs b/crates/biome_js_analyze/src/analyzers/complexity/use_simple_number_keys.rs index e950e569718a..23ea3279fd87 100644 --- a/crates/biome_js_analyze/src/analyzers/complexity/use_simple_number_keys.rs +++ b/crates/biome_js_analyze/src/analyzers/complexity/use_simple_number_keys.rs @@ -47,7 +47,7 @@ declare_rule! { pub(crate) UseSimpleNumberKeys { version: "1.0.0", name: "useSimpleNumberKeys", - recommended: false, + recommended: true, fix_kind: FixKind::Safe, } } diff --git a/crates/biome_js_analyze/src/analyzers/correctness.rs b/crates/biome_js_analyze/src/analyzers/correctness.rs index 9bd09e458939..7a2db2ad2b2c 100644 --- a/crates/biome_js_analyze/src/analyzers/correctness.rs +++ b/crates/biome_js_analyze/src/analyzers/correctness.rs @@ -3,6 +3,7 @@ use biome_analyze::declare_group; pub(crate) mod no_constructor_return; +pub(crate) mod no_empty_character_class_in_regex; pub(crate) mod no_empty_pattern; pub(crate) mod no_inner_declarations; pub(crate) mod no_invalid_constructor_super; @@ -27,6 +28,7 @@ declare_group! { name : "correctness" , rules : [ self :: no_constructor_return :: NoConstructorReturn , + self :: no_empty_character_class_in_regex :: NoEmptyCharacterClassInRegex , self :: no_empty_pattern :: NoEmptyPattern , self :: no_inner_declarations :: NoInnerDeclarations , self :: no_invalid_constructor_super :: NoInvalidConstructorSuper , diff --git a/crates/biome_js_analyze/src/analyzers/correctness/no_constructor_return.rs b/crates/biome_js_analyze/src/analyzers/correctness/no_constructor_return.rs index b52ef59877ce..544cd13877ee 100644 --- a/crates/biome_js_analyze/src/analyzers/correctness/no_constructor_return.rs +++ b/crates/biome_js_analyze/src/analyzers/correctness/no_constructor_return.rs @@ -44,7 +44,6 @@ declare_rule! { /// } /// ``` /// - /// ``` pub(crate) NoConstructorReturn { version: "1.0.0", name: "noConstructorReturn", diff --git a/crates/biome_js_analyze/src/analyzers/nursery/no_empty_character_class_in_regex.rs b/crates/biome_js_analyze/src/analyzers/correctness/no_empty_character_class_in_regex.rs similarity index 100% rename from crates/biome_js_analyze/src/analyzers/nursery/no_empty_character_class_in_regex.rs rename to crates/biome_js_analyze/src/analyzers/correctness/no_empty_character_class_in_regex.rs diff --git a/crates/biome_js_analyze/src/analyzers/correctness/no_setter_return.rs b/crates/biome_js_analyze/src/analyzers/correctness/no_setter_return.rs index 06648fc48e1e..b4d90ff5b1b3 100644 --- a/crates/biome_js_analyze/src/analyzers/correctness/no_setter_return.rs +++ b/crates/biome_js_analyze/src/analyzers/correctness/no_setter_return.rs @@ -64,8 +64,6 @@ declare_rule! { /// } /// } /// ``` - /// - /// ``` pub(crate) NoSetterReturn { version: "1.0.0", name: "noSetterReturn", diff --git a/crates/biome_js_analyze/src/analyzers/correctness/no_void_type_return.rs b/crates/biome_js_analyze/src/analyzers/correctness/no_void_type_return.rs index 29396054bfdd..180ad97a351b 100644 --- a/crates/biome_js_analyze/src/analyzers/correctness/no_void_type_return.rs +++ b/crates/biome_js_analyze/src/analyzers/correctness/no_void_type_return.rs @@ -84,7 +84,6 @@ declare_rule! { /// } /// ``` /// - /// ``` pub(crate) NoVoidTypeReturn { version: "1.0.0", name: "noVoidTypeReturn", diff --git a/crates/biome_js_analyze/src/analyzers/nursery.rs b/crates/biome_js_analyze/src/analyzers/nursery.rs index 051263ba1b0c..f9b06e33a0f1 100644 --- a/crates/biome_js_analyze/src/analyzers/nursery.rs +++ b/crates/biome_js_analyze/src/analyzers/nursery.rs @@ -2,45 +2,29 @@ use biome_analyze::declare_group; -pub(crate) mod no_approximative_numeric_constant; pub(crate) mod no_default_export; pub(crate) mod no_empty_block_statements; -pub(crate) mod no_empty_character_class_in_regex; pub(crate) mod no_implicit_any_let; -pub(crate) mod no_misleading_instantiator; -pub(crate) mod no_misrefactored_shorthand_assign; pub(crate) mod no_unused_private_class_members; -pub(crate) mod no_useless_else; pub(crate) mod no_useless_lone_block_statements; -pub(crate) mod use_arrow_function; -pub(crate) mod use_as_const_assertion; pub(crate) mod use_await; pub(crate) mod use_grouped_type_import; pub(crate) mod use_import_restrictions; pub(crate) mod use_regex_literals; -pub(crate) mod use_shorthand_assign; declare_group! { pub (crate) Nursery { name : "nursery" , rules : [ - self :: no_approximative_numeric_constant :: NoApproximativeNumericConstant , self :: no_default_export :: NoDefaultExport , self :: no_empty_block_statements :: NoEmptyBlockStatements , - self :: no_empty_character_class_in_regex :: NoEmptyCharacterClassInRegex , self :: no_implicit_any_let :: NoImplicitAnyLet , - self :: no_misleading_instantiator :: NoMisleadingInstantiator , - self :: no_misrefactored_shorthand_assign :: NoMisrefactoredShorthandAssign , self :: no_unused_private_class_members :: NoUnusedPrivateClassMembers , - self :: no_useless_else :: NoUselessElse , self :: no_useless_lone_block_statements :: NoUselessLoneBlockStatements , - self :: use_arrow_function :: UseArrowFunction , - self :: use_as_const_assertion :: UseAsConstAssertion , self :: use_await :: UseAwait , self :: use_grouped_type_import :: UseGroupedTypeImport , self :: use_import_restrictions :: UseImportRestrictions , self :: use_regex_literals :: UseRegexLiterals , - self :: use_shorthand_assign :: UseShorthandAssign , ] } } diff --git a/crates/biome_js_analyze/src/analyzers/nursery/no_default_export.rs b/crates/biome_js_analyze/src/analyzers/nursery/no_default_export.rs index 6733c1578207..dd0057c4fa0d 100644 --- a/crates/biome_js_analyze/src/analyzers/nursery/no_default_export.rs +++ b/crates/biome_js_analyze/src/analyzers/nursery/no_default_export.rs @@ -59,7 +59,7 @@ declare_rule! { /// ``` /// pub(crate) NoDefaultExport { - version: "next", + version: "1.4.0", name: "noDefaultExport", recommended: false, } diff --git a/crates/biome_js_analyze/src/analyzers/nursery/no_implicit_any_let.rs b/crates/biome_js_analyze/src/analyzers/nursery/no_implicit_any_let.rs index d5d435fe600e..2200c5ecddc6 100644 --- a/crates/biome_js_analyze/src/analyzers/nursery/no_implicit_any_let.rs +++ b/crates/biome_js_analyze/src/analyzers/nursery/no_implicit_any_let.rs @@ -38,7 +38,7 @@ declare_rule! { /// ``` /// pub(crate) NoImplicitAnyLet { - version: "next", + version: "1.4.0", name: "noImplicitAnyLet", recommended: true, } diff --git a/crates/biome_js_analyze/src/analyzers/nursery/no_unused_private_class_members.rs b/crates/biome_js_analyze/src/analyzers/nursery/no_unused_private_class_members.rs index 222c1364089c..892802b64c27 100644 --- a/crates/biome_js_analyze/src/analyzers/nursery/no_unused_private_class_members.rs +++ b/crates/biome_js_analyze/src/analyzers/nursery/no_unused_private_class_members.rs @@ -63,7 +63,7 @@ declare_rule! { /// ``` /// pub(crate) NoUnusedPrivateClassMembers { - version: "next", + version: "1.3.3", name: "noUnusedPrivateClassMembers", recommended: false, fix_kind: FixKind::Unsafe, diff --git a/crates/biome_js_analyze/src/analyzers/nursery/no_useless_lone_block_statements.rs b/crates/biome_js_analyze/src/analyzers/nursery/no_useless_lone_block_statements.rs index 488382b2e2ba..2e3e1e654467 100644 --- a/crates/biome_js_analyze/src/analyzers/nursery/no_useless_lone_block_statements.rs +++ b/crates/biome_js_analyze/src/analyzers/nursery/no_useless_lone_block_statements.rs @@ -46,7 +46,7 @@ declare_rule! { /// ``` /// pub(crate) NoUselessLoneBlockStatements { - version: "1.3.0", + version: "1.3.3", name: "noUselessLoneBlockStatements", recommended: false, fix_kind: FixKind::Unsafe, diff --git a/crates/biome_js_analyze/src/analyzers/nursery/use_await.rs b/crates/biome_js_analyze/src/analyzers/nursery/use_await.rs index 12641f1945a1..92e160191249 100644 --- a/crates/biome_js_analyze/src/analyzers/nursery/use_await.rs +++ b/crates/biome_js_analyze/src/analyzers/nursery/use_await.rs @@ -46,7 +46,7 @@ declare_rule! { /// async function noop() { } /// ``` pub(crate) UseAwait { - version: "1.3.0", + version: "1.4.0", name: "useAwait", recommended: true, } diff --git a/crates/biome_js_analyze/src/analyzers/style.rs b/crates/biome_js_analyze/src/analyzers/style.rs index 2bbdfa069764..082913f11a33 100644 --- a/crates/biome_js_analyze/src/analyzers/style.rs +++ b/crates/biome_js_analyze/src/analyzers/style.rs @@ -10,6 +10,8 @@ pub(crate) mod no_negation_else; pub(crate) mod no_non_null_assertion; pub(crate) mod no_parameter_properties; pub(crate) mod no_unused_template_literal; +pub(crate) mod no_useless_else; +pub(crate) mod use_as_const_assertion; pub(crate) mod use_block_statements; pub(crate) mod use_collapsed_else_if; pub(crate) mod use_default_parameter_last; @@ -19,6 +21,7 @@ pub(crate) mod use_literal_enum_members; pub(crate) mod use_numeric_literals; pub(crate) mod use_self_closing_elements; pub(crate) mod use_shorthand_array_type; +pub(crate) mod use_shorthand_assign; pub(crate) mod use_single_case_statement; pub(crate) mod use_single_var_declarator; pub(crate) mod use_template; @@ -36,6 +39,8 @@ declare_group! { self :: no_non_null_assertion :: NoNonNullAssertion , self :: no_parameter_properties :: NoParameterProperties , self :: no_unused_template_literal :: NoUnusedTemplateLiteral , + self :: no_useless_else :: NoUselessElse , + self :: use_as_const_assertion :: UseAsConstAssertion , self :: use_block_statements :: UseBlockStatements , self :: use_collapsed_else_if :: UseCollapsedElseIf , self :: use_default_parameter_last :: UseDefaultParameterLast , @@ -45,6 +50,7 @@ declare_group! { self :: use_numeric_literals :: UseNumericLiterals , self :: use_self_closing_elements :: UseSelfClosingElements , self :: use_shorthand_array_type :: UseShorthandArrayType , + self :: use_shorthand_assign :: UseShorthandAssign , self :: use_single_case_statement :: UseSingleCaseStatement , self :: use_single_var_declarator :: UseSingleVarDeclarator , self :: use_template :: UseTemplate , diff --git a/crates/biome_js_analyze/src/analyzers/nursery/no_useless_else.rs b/crates/biome_js_analyze/src/analyzers/style/no_useless_else.rs similarity index 100% rename from crates/biome_js_analyze/src/analyzers/nursery/no_useless_else.rs rename to crates/biome_js_analyze/src/analyzers/style/no_useless_else.rs diff --git a/crates/biome_js_analyze/src/analyzers/nursery/use_as_const_assertion.rs b/crates/biome_js_analyze/src/analyzers/style/use_as_const_assertion.rs similarity index 99% rename from crates/biome_js_analyze/src/analyzers/nursery/use_as_const_assertion.rs rename to crates/biome_js_analyze/src/analyzers/style/use_as_const_assertion.rs index ff2c1289fc61..3f36f67f08b6 100644 --- a/crates/biome_js_analyze/src/analyzers/nursery/use_as_const_assertion.rs +++ b/crates/biome_js_analyze/src/analyzers/style/use_as_const_assertion.rs @@ -46,7 +46,6 @@ declare_rule! { /// let bar = 'bar' as string; /// let foo = { bar: 'baz' }; /// ``` - /// pub(crate) UseAsConstAssertion { version: "1.3.0", name: "useAsConstAssertion", diff --git a/crates/biome_js_analyze/src/analyzers/nursery/use_shorthand_assign.rs b/crates/biome_js_analyze/src/analyzers/style/use_shorthand_assign.rs similarity index 99% rename from crates/biome_js_analyze/src/analyzers/nursery/use_shorthand_assign.rs rename to crates/biome_js_analyze/src/analyzers/style/use_shorthand_assign.rs index 4657f377ea18..b23bcc7261eb 100644 --- a/crates/biome_js_analyze/src/analyzers/nursery/use_shorthand_assign.rs +++ b/crates/biome_js_analyze/src/analyzers/style/use_shorthand_assign.rs @@ -51,7 +51,6 @@ declare_rule! { /// ```js /// a *= 1; /// ``` - /// pub(crate) UseShorthandAssign { version: "1.3.0", name: "useShorthandAssign", diff --git a/crates/biome_js_analyze/src/analyzers/suspicious.rs b/crates/biome_js_analyze/src/analyzers/suspicious.rs index 23bbaa07633c..d0f1c94e2ee4 100644 --- a/crates/biome_js_analyze/src/analyzers/suspicious.rs +++ b/crates/biome_js_analyze/src/analyzers/suspicious.rs @@ -2,6 +2,7 @@ use biome_analyze::declare_group; +pub(crate) mod no_approximative_numeric_constant; pub(crate) mod no_assign_in_expressions; pub(crate) mod no_async_promise_executor; pub(crate) mod no_comment_text; @@ -20,6 +21,8 @@ pub(crate) mod no_empty_interface; pub(crate) mod no_explicit_any; pub(crate) mod no_extra_non_null_assertion; pub(crate) mod no_fallthrough_switch_clause; +pub(crate) mod no_misleading_instantiator; +pub(crate) mod no_misrefactored_shorthand_assign; pub(crate) mod no_prototype_builtins; pub(crate) mod no_redundant_use_strict; pub(crate) mod no_self_compare; @@ -35,6 +38,7 @@ declare_group! { pub (crate) Suspicious { name : "suspicious" , rules : [ + self :: no_approximative_numeric_constant :: NoApproximativeNumericConstant , self :: no_assign_in_expressions :: NoAssignInExpressions , self :: no_async_promise_executor :: NoAsyncPromiseExecutor , self :: no_comment_text :: NoCommentText , @@ -53,6 +57,8 @@ declare_group! { self :: no_explicit_any :: NoExplicitAny , self :: no_extra_non_null_assertion :: NoExtraNonNullAssertion , self :: no_fallthrough_switch_clause :: NoFallthroughSwitchClause , + self :: no_misleading_instantiator :: NoMisleadingInstantiator , + self :: no_misrefactored_shorthand_assign :: NoMisrefactoredShorthandAssign , self :: no_prototype_builtins :: NoPrototypeBuiltins , self :: no_redundant_use_strict :: NoRedundantUseStrict , self :: no_self_compare :: NoSelfCompare , diff --git a/crates/biome_js_analyze/src/analyzers/nursery/no_approximative_numeric_constant.rs b/crates/biome_js_analyze/src/analyzers/suspicious/no_approximative_numeric_constant.rs similarity index 99% rename from crates/biome_js_analyze/src/analyzers/nursery/no_approximative_numeric_constant.rs rename to crates/biome_js_analyze/src/analyzers/suspicious/no_approximative_numeric_constant.rs index 6aab81effd4d..3de7e334f512 100644 --- a/crates/biome_js_analyze/src/analyzers/nursery/no_approximative_numeric_constant.rs +++ b/crates/biome_js_analyze/src/analyzers/suspicious/no_approximative_numeric_constant.rs @@ -29,7 +29,6 @@ declare_rule! { /// ```js /// let x = Math.LN10; /// ``` - /// pub(crate) NoApproximativeNumericConstant { version: "1.3.0", name: "noApproximativeNumericConstant", diff --git a/crates/biome_js_analyze/src/analyzers/suspicious/no_explicit_any.rs b/crates/biome_js_analyze/src/analyzers/suspicious/no_explicit_any.rs index 1810de285de8..22d1d8e606ad 100644 --- a/crates/biome_js_analyze/src/analyzers/suspicious/no_explicit_any.rs +++ b/crates/biome_js_analyze/src/analyzers/suspicious/no_explicit_any.rs @@ -53,7 +53,6 @@ declare_rule! { /// function fn(param: Array>): Array {} /// ``` /// - /// ``` pub(crate) NoExplicitAny { version: "1.0.0", name: "noExplicitAny", diff --git a/crates/biome_js_analyze/src/analyzers/nursery/no_misleading_instantiator.rs b/crates/biome_js_analyze/src/analyzers/suspicious/no_misleading_instantiator.rs similarity index 99% rename from crates/biome_js_analyze/src/analyzers/nursery/no_misleading_instantiator.rs rename to crates/biome_js_analyze/src/analyzers/suspicious/no_misleading_instantiator.rs index 3a96eb35eff4..0a8e8cbb54c1 100644 --- a/crates/biome_js_analyze/src/analyzers/nursery/no_misleading_instantiator.rs +++ b/crates/biome_js_analyze/src/analyzers/suspicious/no_misleading_instantiator.rs @@ -47,7 +47,6 @@ declare_rule! { /// new (): C; /// } /// ``` - /// pub(crate) NoMisleadingInstantiator { version: "1.3.0", name: "noMisleadingInstantiator", diff --git a/crates/biome_js_analyze/src/analyzers/nursery/no_misrefactored_shorthand_assign.rs b/crates/biome_js_analyze/src/analyzers/suspicious/no_misrefactored_shorthand_assign.rs similarity index 99% rename from crates/biome_js_analyze/src/analyzers/nursery/no_misrefactored_shorthand_assign.rs rename to crates/biome_js_analyze/src/analyzers/suspicious/no_misrefactored_shorthand_assign.rs index 7e8ac6eafb1f..d25c3ac57ffb 100644 --- a/crates/biome_js_analyze/src/analyzers/nursery/no_misrefactored_shorthand_assign.rs +++ b/crates/biome_js_analyze/src/analyzers/suspicious/no_misrefactored_shorthand_assign.rs @@ -50,7 +50,6 @@ declare_rule! { /// ```js /// a = a - b /// ``` - /// pub(crate) NoMisrefactoredShorthandAssign { version: "1.3.0", name: "noMisrefactoredShorthandAssign", diff --git a/crates/biome_js_analyze/src/aria_analyzers/a11y.rs b/crates/biome_js_analyze/src/aria_analyzers/a11y.rs index 579e0fc146f3..4fb19a4fb559 100644 --- a/crates/biome_js_analyze/src/aria_analyzers/a11y.rs +++ b/crates/biome_js_analyze/src/aria_analyzers/a11y.rs @@ -3,9 +3,11 @@ use biome_analyze::declare_group; pub(crate) mod no_aria_unsupported_elements; +pub(crate) mod no_interactive_element_to_noninteractive_role; pub(crate) mod no_noninteractive_element_to_interactive_role; pub(crate) mod no_noninteractive_tabindex; pub(crate) mod no_redundant_roles; +pub(crate) mod use_aria_activedescendant_with_tabindex; pub(crate) mod use_aria_props_for_role; pub(crate) mod use_valid_aria_props; pub(crate) mod use_valid_aria_values; @@ -16,9 +18,11 @@ declare_group! { name : "a11y" , rules : [ self :: no_aria_unsupported_elements :: NoAriaUnsupportedElements , + self :: no_interactive_element_to_noninteractive_role :: NoInteractiveElementToNoninteractiveRole , self :: no_noninteractive_element_to_interactive_role :: NoNoninteractiveElementToInteractiveRole , self :: no_noninteractive_tabindex :: NoNoninteractiveTabindex , self :: no_redundant_roles :: NoRedundantRoles , + self :: use_aria_activedescendant_with_tabindex :: UseAriaActivedescendantWithTabindex , self :: use_aria_props_for_role :: UseAriaPropsForRole , self :: use_valid_aria_props :: UseValidAriaProps , self :: use_valid_aria_values :: UseValidAriaValues , diff --git a/crates/biome_js_analyze/src/aria_analyzers/nursery/no_interactive_element_to_noninteractive_role.rs b/crates/biome_js_analyze/src/aria_analyzers/a11y/no_interactive_element_to_noninteractive_role.rs similarity index 99% rename from crates/biome_js_analyze/src/aria_analyzers/nursery/no_interactive_element_to_noninteractive_role.rs rename to crates/biome_js_analyze/src/aria_analyzers/a11y/no_interactive_element_to_noninteractive_role.rs index 26a2e38b79fc..081248842f44 100644 --- a/crates/biome_js_analyze/src/aria_analyzers/nursery/no_interactive_element_to_noninteractive_role.rs +++ b/crates/biome_js_analyze/src/aria_analyzers/a11y/no_interactive_element_to_noninteractive_role.rs @@ -33,7 +33,7 @@ declare_rule! { pub(crate) NoInteractiveElementToNoninteractiveRole { version: "1.3.0", name: "noInteractiveElementToNoninteractiveRole", - recommended: false, + recommended: true, } } diff --git a/crates/biome_js_analyze/src/aria_analyzers/nursery/use_aria_activedescendant_with_tabindex.rs b/crates/biome_js_analyze/src/aria_analyzers/a11y/use_aria_activedescendant_with_tabindex.rs similarity index 99% rename from crates/biome_js_analyze/src/aria_analyzers/nursery/use_aria_activedescendant_with_tabindex.rs rename to crates/biome_js_analyze/src/aria_analyzers/a11y/use_aria_activedescendant_with_tabindex.rs index 287fe3e2cd85..253507ce29a0 100644 --- a/crates/biome_js_analyze/src/aria_analyzers/nursery/use_aria_activedescendant_with_tabindex.rs +++ b/crates/biome_js_analyze/src/aria_analyzers/a11y/use_aria_activedescendant_with_tabindex.rs @@ -53,7 +53,7 @@ declare_rule! { pub(crate) UseAriaActivedescendantWithTabindex { version: "1.3.0", name: "useAriaActivedescendantWithTabindex", - recommended: false, + recommended: true, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/aria_analyzers/nursery.rs b/crates/biome_js_analyze/src/aria_analyzers/nursery.rs index cfd4afe7627e..ade48d6c312d 100644 --- a/crates/biome_js_analyze/src/aria_analyzers/nursery.rs +++ b/crates/biome_js_analyze/src/aria_analyzers/nursery.rs @@ -3,8 +3,6 @@ use biome_analyze::declare_group; pub(crate) mod no_aria_hidden_on_focusable; -pub(crate) mod no_interactive_element_to_noninteractive_role; -pub(crate) mod use_aria_activedescendant_with_tabindex; pub(crate) mod use_valid_aria_role; declare_group! { @@ -12,8 +10,6 @@ declare_group! { name : "nursery" , rules : [ self :: no_aria_hidden_on_focusable :: NoAriaHiddenOnFocusable , - self :: no_interactive_element_to_noninteractive_role :: NoInteractiveElementToNoninteractiveRole , - self :: use_aria_activedescendant_with_tabindex :: UseAriaActivedescendantWithTabindex , self :: use_valid_aria_role :: UseValidAriaRole , ] } diff --git a/crates/biome_js_analyze/src/aria_analyzers/nursery/no_aria_hidden_on_focusable.rs b/crates/biome_js_analyze/src/aria_analyzers/nursery/no_aria_hidden_on_focusable.rs index b2b5c6dd5346..66256a1c6099 100644 --- a/crates/biome_js_analyze/src/aria_analyzers/nursery/no_aria_hidden_on_focusable.rs +++ b/crates/biome_js_analyze/src/aria_analyzers/nursery/no_aria_hidden_on_focusable.rs @@ -45,7 +45,7 @@ declare_rule! { /// - [MDN aria-hidden](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-hidden) /// pub(crate) NoAriaHiddenOnFocusable { - version: "1.3.0", + version: "1.4.0", name: "noAriaHiddenOnFocusable", recommended: true, fix_kind: FixKind::Unsafe, diff --git a/crates/biome_js_analyze/src/aria_analyzers/nursery/use_valid_aria_role.rs b/crates/biome_js_analyze/src/aria_analyzers/nursery/use_valid_aria_role.rs index 130c50b0761c..89c3c742d02f 100644 --- a/crates/biome_js_analyze/src/aria_analyzers/nursery/use_valid_aria_role.rs +++ b/crates/biome_js_analyze/src/aria_analyzers/nursery/use_valid_aria_role.rs @@ -72,7 +72,7 @@ declare_rule! { /// - [MDN: Using ARIA: Roles, states, and properties](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques) /// pub(crate) UseValidAriaRole { - version: "next", + version: "1.4.0", name: "useValidAriaRole", recommended: true, fix_kind: FixKind::Unsafe, diff --git a/crates/biome_js_analyze/src/semantic_analyzers/complexity.rs b/crates/biome_js_analyze/src/semantic_analyzers/complexity.rs index 5ddc5ac66777..aeb5cb92796d 100644 --- a/crates/biome_js_analyze/src/semantic_analyzers/complexity.rs +++ b/crates/biome_js_analyze/src/semantic_analyzers/complexity.rs @@ -3,6 +3,7 @@ use biome_analyze::declare_group; pub(crate) mod no_banned_types; +pub(crate) mod no_this_in_static; pub(crate) mod no_useless_fragments; pub(crate) mod no_useless_this_alias; @@ -11,6 +12,7 @@ declare_group! { name : "complexity" , rules : [ self :: no_banned_types :: NoBannedTypes , + self :: no_this_in_static :: NoThisInStatic , self :: no_useless_fragments :: NoUselessFragments , self :: no_useless_this_alias :: NoUselessThisAlias , ] diff --git a/crates/biome_js_analyze/src/semantic_analyzers/complexity/no_banned_types.rs b/crates/biome_js_analyze/src/semantic_analyzers/complexity/no_banned_types.rs index 7e5dd483ba6c..dcaab0850bf6 100644 --- a/crates/biome_js_analyze/src/semantic_analyzers/complexity/no_banned_types.rs +++ b/crates/biome_js_analyze/src/semantic_analyzers/complexity/no_banned_types.rs @@ -89,7 +89,6 @@ declare_rule! { /// let tuple: [boolean, string] = [false, "foo"]; /// ``` /// - /// ``` pub(crate) NoBannedTypes { version: "1.0.0", name: "noBannedTypes", diff --git a/crates/biome_js_analyze/src/semantic_analyzers/nursery/no_this_in_static.rs b/crates/biome_js_analyze/src/semantic_analyzers/complexity/no_this_in_static.rs similarity index 99% rename from crates/biome_js_analyze/src/semantic_analyzers/nursery/no_this_in_static.rs rename to crates/biome_js_analyze/src/semantic_analyzers/complexity/no_this_in_static.rs index a119b2ffc7f7..89799990462f 100644 --- a/crates/biome_js_analyze/src/semantic_analyzers/nursery/no_this_in_static.rs +++ b/crates/biome_js_analyze/src/semantic_analyzers/complexity/no_this_in_static.rs @@ -80,9 +80,9 @@ declare_rule! { /// ``` /// pub(crate) NoThisInStatic { - version: "next", + version: "1.3.1", name: "noThisInStatic", - recommended: false, + recommended: true, fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/semantic_analyzers/correctness.rs b/crates/biome_js_analyze/src/semantic_analyzers/correctness.rs index 21f3565536c9..61d61de31df3 100644 --- a/crates/biome_js_analyze/src/semantic_analyzers/correctness.rs +++ b/crates/biome_js_analyze/src/semantic_analyzers/correctness.rs @@ -6,6 +6,7 @@ pub(crate) mod no_children_prop; pub(crate) mod no_const_assign; pub(crate) mod no_constant_condition; pub(crate) mod no_global_object_calls; +pub(crate) mod no_invalid_new_builtin; pub(crate) mod no_new_symbol; pub(crate) mod no_render_return_value; pub(crate) mod no_undeclared_variables; @@ -23,6 +24,7 @@ declare_group! { self :: no_const_assign :: NoConstAssign , self :: no_constant_condition :: NoConstantCondition , self :: no_global_object_calls :: NoGlobalObjectCalls , + self :: no_invalid_new_builtin :: NoInvalidNewBuiltin , self :: no_new_symbol :: NoNewSymbol , self :: no_render_return_value :: NoRenderReturnValue , self :: no_undeclared_variables :: NoUndeclaredVariables , diff --git a/crates/biome_js_analyze/src/semantic_analyzers/nursery/no_invalid_new_builtin.rs b/crates/biome_js_analyze/src/semantic_analyzers/correctness/no_invalid_new_builtin.rs similarity index 100% rename from crates/biome_js_analyze/src/semantic_analyzers/nursery/no_invalid_new_builtin.rs rename to crates/biome_js_analyze/src/semantic_analyzers/correctness/no_invalid_new_builtin.rs diff --git a/crates/biome_js_analyze/src/semantic_analyzers/correctness/no_new_symbol.rs b/crates/biome_js_analyze/src/semantic_analyzers/correctness/no_new_symbol.rs index c658286367a0..2aec22835742 100644 --- a/crates/biome_js_analyze/src/semantic_analyzers/correctness/no_new_symbol.rs +++ b/crates/biome_js_analyze/src/semantic_analyzers/correctness/no_new_symbol.rs @@ -35,7 +35,8 @@ declare_rule! { pub(crate) NoNewSymbol { version: "1.0.0", name: "noNewSymbol", - recommended: true, + recommended: false, + deprecated: "Use `noInvalidNewBuiltin` instead.", fix_kind: FixKind::Unsafe, } } diff --git a/crates/biome_js_analyze/src/semantic_analyzers/nursery.rs b/crates/biome_js_analyze/src/semantic_analyzers/nursery.rs index 23e88c3097a2..8cf07549a644 100644 --- a/crates/biome_js_analyze/src/semantic_analyzers/nursery.rs +++ b/crates/biome_js_analyze/src/semantic_analyzers/nursery.rs @@ -2,16 +2,12 @@ use biome_analyze::declare_group; -pub(crate) mod no_invalid_new_builtin; -pub(crate) mod no_this_in_static; pub(crate) mod no_unused_imports; declare_group! { pub (crate) Nursery { name : "nursery" , rules : [ - self :: no_invalid_new_builtin :: NoInvalidNewBuiltin , - self :: no_this_in_static :: NoThisInStatic , self :: no_unused_imports :: NoUnusedImports , ] } diff --git a/crates/biome_js_analyze/src/syntax/correctness/no_initializer_with_definite.rs b/crates/biome_js_analyze/src/syntax/correctness/no_initializer_with_definite.rs index c0ca141c1577..e5426ede61c6 100644 --- a/crates/biome_js_analyze/src/syntax/correctness/no_initializer_with_definite.rs +++ b/crates/biome_js_analyze/src/syntax/correctness/no_initializer_with_definite.rs @@ -13,7 +13,7 @@ declare_rule! { /// let foo!: string = "bar"; /// ``` pub(crate) NoInitializerWithDefinite { - version: "1.0.0", + version: "1.4.0", name: "noInitializerWithDefinite", } } diff --git a/crates/biome_js_analyze/tests/specs/nursery/noInteractiveElementToNoninteractiveRole/invalid.jsx b/crates/biome_js_analyze/tests/specs/a11y/noInteractiveElementToNoninteractiveRole/invalid.jsx similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/noInteractiveElementToNoninteractiveRole/invalid.jsx rename to crates/biome_js_analyze/tests/specs/a11y/noInteractiveElementToNoninteractiveRole/invalid.jsx diff --git a/crates/biome_js_analyze/tests/specs/nursery/noInteractiveElementToNoninteractiveRole/invalid.jsx.snap b/crates/biome_js_analyze/tests/specs/a11y/noInteractiveElementToNoninteractiveRole/invalid.jsx.snap similarity index 79% rename from crates/biome_js_analyze/tests/specs/nursery/noInteractiveElementToNoninteractiveRole/invalid.jsx.snap rename to crates/biome_js_analyze/tests/specs/a11y/noInteractiveElementToNoninteractiveRole/invalid.jsx.snap index df4f8e9552ee..9ba49036a24f 100644 --- a/crates/biome_js_analyze/tests/specs/nursery/noInteractiveElementToNoninteractiveRole/invalid.jsx.snap +++ b/crates/biome_js_analyze/tests/specs/a11y/noInteractiveElementToNoninteractiveRole/invalid.jsx.snap @@ -75,7 +75,7 @@ expression: invalid.jsx # Diagnostics ``` -invalid.jsx:2:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:2:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -93,7 +93,7 @@ invalid.jsx:2:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:3:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:3:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -112,7 +112,7 @@ invalid.jsx:3:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:5:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:5:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -131,7 +131,7 @@ invalid.jsx:5:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:6:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:6:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -150,7 +150,7 @@ invalid.jsx:6:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:7:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:7:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -169,7 +169,7 @@ invalid.jsx:7:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:8:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:8:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -188,7 +188,7 @@ invalid.jsx:8:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:9:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:9:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -207,7 +207,7 @@ invalid.jsx:9:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:10:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:10:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -226,7 +226,7 @@ invalid.jsx:10:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:11:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:11:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -245,7 +245,7 @@ invalid.jsx:11:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:12:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:12:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -264,7 +264,7 @@ invalid.jsx:12:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:13:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:13:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -283,7 +283,7 @@ invalid.jsx:13:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:14:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:14:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -302,7 +302,7 @@ invalid.jsx:14:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:15:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:15:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -321,7 +321,7 @@ invalid.jsx:15:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:16:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:16:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -340,7 +340,7 @@ invalid.jsx:16:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:17:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:17:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -359,7 +359,7 @@ invalid.jsx:17:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:18:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:18:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -378,7 +378,7 @@ invalid.jsx:18:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:19:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:19:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -397,7 +397,7 @@ invalid.jsx:19:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:20:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:20:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -416,7 +416,7 @@ invalid.jsx:20:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:21:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:21:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -435,7 +435,7 @@ invalid.jsx:21:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:22:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:22:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -454,7 +454,7 @@ invalid.jsx:22:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:23:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:23:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -473,7 +473,7 @@ invalid.jsx:23:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:24:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:24:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -492,7 +492,7 @@ invalid.jsx:24:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:25:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:25:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -511,7 +511,7 @@ invalid.jsx:25:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:26:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:26:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -530,7 +530,7 @@ invalid.jsx:26:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:27:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:27:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -549,7 +549,7 @@ invalid.jsx:27:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:29:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:29:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -568,7 +568,7 @@ invalid.jsx:29:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:30:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:30:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -587,7 +587,7 @@ invalid.jsx:30:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:31:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:31:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -606,7 +606,7 @@ invalid.jsx:31:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:32:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:32:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -625,7 +625,7 @@ invalid.jsx:32:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:33:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:33:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -644,7 +644,7 @@ invalid.jsx:33:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:35:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:35:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -663,7 +663,7 @@ invalid.jsx:35:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:36:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:36:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -682,7 +682,7 @@ invalid.jsx:36:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:38:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:38:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -701,7 +701,7 @@ invalid.jsx:38:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:39:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:39:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -720,7 +720,7 @@ invalid.jsx:39:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:40:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:40:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -739,7 +739,7 @@ invalid.jsx:40:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:41:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:41:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -758,7 +758,7 @@ invalid.jsx:41:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:42:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:42:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -777,7 +777,7 @@ invalid.jsx:42:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:43:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:43:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -796,7 +796,7 @@ invalid.jsx:43:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:44:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:44:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -815,7 +815,7 @@ invalid.jsx:44:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:45:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:45:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -834,7 +834,7 @@ invalid.jsx:45:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:46:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:46:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -853,7 +853,7 @@ invalid.jsx:46:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:47:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:47:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -872,7 +872,7 @@ invalid.jsx:47:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:48:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:48:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -891,7 +891,7 @@ invalid.jsx:48:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:49:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:49:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -910,7 +910,7 @@ invalid.jsx:49:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:50:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:50:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -929,7 +929,7 @@ invalid.jsx:50:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:51:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:51:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -948,7 +948,7 @@ invalid.jsx:51:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:52:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:52:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -967,7 +967,7 @@ invalid.jsx:52:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:53:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:53:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -986,7 +986,7 @@ invalid.jsx:53:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:54:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:54:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -1005,7 +1005,7 @@ invalid.jsx:54:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:55:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:55:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -1024,7 +1024,7 @@ invalid.jsx:55:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:56:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:56:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -1043,7 +1043,7 @@ invalid.jsx:56:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:57:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:57:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -1062,7 +1062,7 @@ invalid.jsx:57:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:58:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:58:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -1081,7 +1081,7 @@ invalid.jsx:58:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:59:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:59:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -1100,7 +1100,7 @@ invalid.jsx:59:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:60:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:60:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -1119,7 +1119,7 @@ invalid.jsx:60:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:62:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:62:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -1138,7 +1138,7 @@ invalid.jsx:62:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:63:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:63:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -1157,7 +1157,7 @@ invalid.jsx:63:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:64:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:64:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -1176,7 +1176,7 @@ invalid.jsx:64:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:65:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:65:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. @@ -1195,7 +1195,7 @@ invalid.jsx:65:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━ ``` ``` -invalid.jsx:66:1 lint/nursery/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.jsx:66:1 lint/a11y/noInteractiveElementToNoninteractiveRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Interactive elements should not be assigned non-interactive roles. diff --git a/crates/biome_js_analyze/tests/specs/nursery/noInteractiveElementToNoninteractiveRole/valid.jsx b/crates/biome_js_analyze/tests/specs/a11y/noInteractiveElementToNoninteractiveRole/valid.jsx similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/noInteractiveElementToNoninteractiveRole/valid.jsx rename to crates/biome_js_analyze/tests/specs/a11y/noInteractiveElementToNoninteractiveRole/valid.jsx diff --git a/crates/biome_js_analyze/tests/specs/nursery/noInteractiveElementToNoninteractiveRole/valid.jsx.snap b/crates/biome_js_analyze/tests/specs/a11y/noInteractiveElementToNoninteractiveRole/valid.jsx.snap similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/noInteractiveElementToNoninteractiveRole/valid.jsx.snap rename to crates/biome_js_analyze/tests/specs/a11y/noInteractiveElementToNoninteractiveRole/valid.jsx.snap diff --git a/crates/biome_js_analyze/tests/specs/nursery/useAriaActivedescendantWithTabindex/invalid.js b/crates/biome_js_analyze/tests/specs/a11y/useAriaActivedescendantWithTabindex/invalid.js similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/useAriaActivedescendantWithTabindex/invalid.js rename to crates/biome_js_analyze/tests/specs/a11y/useAriaActivedescendantWithTabindex/invalid.js diff --git a/crates/biome_js_analyze/tests/specs/nursery/useAriaActivedescendantWithTabindex/invalid.js.snap b/crates/biome_js_analyze/tests/specs/a11y/useAriaActivedescendantWithTabindex/invalid.js.snap similarity index 83% rename from crates/biome_js_analyze/tests/specs/nursery/useAriaActivedescendantWithTabindex/invalid.js.snap rename to crates/biome_js_analyze/tests/specs/a11y/useAriaActivedescendantWithTabindex/invalid.js.snap index bf082224cad5..89b75d2576f3 100644 --- a/crates/biome_js_analyze/tests/specs/nursery/useAriaActivedescendantWithTabindex/invalid.js.snap +++ b/crates/biome_js_analyze/tests/specs/a11y/useAriaActivedescendantWithTabindex/invalid.js.snap @@ -10,7 +10,7 @@ expression: invalid.js # Diagnostics ``` -invalid.js:1:1 lint/nursery/useAriaActivedescendantWithTabindex FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:1:1 lint/a11y/useAriaActivedescendantWithTabindex FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Enforce elements with aria-activedescendant are tabbable. diff --git a/crates/biome_js_analyze/tests/specs/nursery/useAriaActivedescendantWithTabindex/valid.js b/crates/biome_js_analyze/tests/specs/a11y/useAriaActivedescendantWithTabindex/valid.js similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/useAriaActivedescendantWithTabindex/valid.js rename to crates/biome_js_analyze/tests/specs/a11y/useAriaActivedescendantWithTabindex/valid.js diff --git a/crates/biome_js_analyze/tests/specs/nursery/useAriaActivedescendantWithTabindex/valid.js.snap b/crates/biome_js_analyze/tests/specs/a11y/useAriaActivedescendantWithTabindex/valid.js.snap similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/useAriaActivedescendantWithTabindex/valid.js.snap rename to crates/biome_js_analyze/tests/specs/a11y/useAriaActivedescendantWithTabindex/valid.js.snap diff --git a/crates/biome_js_analyze/tests/specs/nursery/noThisInStatic/invalid.js b/crates/biome_js_analyze/tests/specs/complexity/noThisInStatic/invalid.js similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/noThisInStatic/invalid.js rename to crates/biome_js_analyze/tests/specs/complexity/noThisInStatic/invalid.js diff --git a/crates/biome_js_analyze/tests/specs/nursery/noThisInStatic/invalid.js.snap b/crates/biome_js_analyze/tests/specs/complexity/noThisInStatic/invalid.js.snap similarity index 85% rename from crates/biome_js_analyze/tests/specs/nursery/noThisInStatic/invalid.js.snap rename to crates/biome_js_analyze/tests/specs/complexity/noThisInStatic/invalid.js.snap index 1f86c6c13814..2e173fa5d7e7 100644 --- a/crates/biome_js_analyze/tests/specs/nursery/noThisInStatic/invalid.js.snap +++ b/crates/biome_js_analyze/tests/specs/complexity/noThisInStatic/invalid.js.snap @@ -48,7 +48,7 @@ const E = class extends f() { # Diagnostics ``` -invalid.js:2:14 lint/nursery/noThisInStatic FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:2:14 lint/complexity/noThisInStatic FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Using this in a static context can be confusing. @@ -72,7 +72,7 @@ invalid.js:2:14 lint/nursery/noThisInStatic FIXABLE ━━━━━━━━ ``` ``` -invalid.js:2:31 lint/nursery/noThisInStatic FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:2:31 lint/complexity/noThisInStatic FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Using super in a static context can be confusing. @@ -96,7 +96,7 @@ invalid.js:2:31 lint/nursery/noThisInStatic FIXABLE ━━━━━━━━ ``` ``` -invalid.js:8:19 lint/nursery/noThisInStatic FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:8:19 lint/complexity/noThisInStatic FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Using this in a static context can be confusing. @@ -121,7 +121,7 @@ invalid.js:8:19 lint/nursery/noThisInStatic FIXABLE ━━━━━━━━ ``` ``` -invalid.js:9:26 lint/nursery/noThisInStatic FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:9:26 lint/complexity/noThisInStatic FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Using super in a static context can be confusing. @@ -147,7 +147,7 @@ invalid.js:9:26 lint/nursery/noThisInStatic FIXABLE ━━━━━━━━ ``` ``` -invalid.js:13:15 lint/nursery/noThisInStatic FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:13:15 lint/complexity/noThisInStatic FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Using this in a static context can be confusing. @@ -172,7 +172,7 @@ invalid.js:13:15 lint/nursery/noThisInStatic FIXABLE ━━━━━━━━ ``` ``` -invalid.js:14:15 lint/nursery/noThisInStatic FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:14:15 lint/complexity/noThisInStatic FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Using super in a static context can be confusing. @@ -198,7 +198,7 @@ invalid.js:14:15 lint/nursery/noThisInStatic FIXABLE ━━━━━━━━ ``` ``` -invalid.js:18:16 lint/nursery/noThisInStatic FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:18:16 lint/complexity/noThisInStatic FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Using this in a static context can be confusing. @@ -223,7 +223,7 @@ invalid.js:18:16 lint/nursery/noThisInStatic FIXABLE ━━━━━━━━ ``` ``` -invalid.js:18:32 lint/nursery/noThisInStatic FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:18:32 lint/complexity/noThisInStatic FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Using super in a static context can be confusing. @@ -248,7 +248,7 @@ invalid.js:18:32 lint/nursery/noThisInStatic FIXABLE ━━━━━━━━ ``` ``` -invalid.js:24:16 lint/nursery/noThisInStatic FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:24:16 lint/complexity/noThisInStatic FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Using this in a static context can be confusing. @@ -274,7 +274,7 @@ invalid.js:24:16 lint/nursery/noThisInStatic FIXABLE ━━━━━━━━ ``` ``` -invalid.js:24:32 lint/nursery/noThisInStatic FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:24:32 lint/complexity/noThisInStatic FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Using super in a static context can be confusing. @@ -300,7 +300,7 @@ invalid.js:24:32 lint/nursery/noThisInStatic FIXABLE ━━━━━━━━ ``` ``` -invalid.js:30:16 lint/nursery/noThisInStatic FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:30:16 lint/complexity/noThisInStatic FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Using this in a static context can be confusing. @@ -326,7 +326,7 @@ invalid.js:30:16 lint/nursery/noThisInStatic FIXABLE ━━━━━━━━ ``` ``` -invalid.js:30:32 lint/nursery/noThisInStatic ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:30:32 lint/complexity/noThisInStatic ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Using super in a static context can be confusing. @@ -343,7 +343,7 @@ invalid.js:30:32 lint/nursery/noThisInStatic ━━━━━━━━━━━ ``` ``` -invalid.js:37:16 lint/nursery/noThisInStatic ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:37:16 lint/complexity/noThisInStatic ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Using this in a static context can be confusing. @@ -360,7 +360,7 @@ invalid.js:37:16 lint/nursery/noThisInStatic ━━━━━━━━━━━ ``` ``` -invalid.js:37:32 lint/nursery/noThisInStatic ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:37:32 lint/complexity/noThisInStatic ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Using super in a static context can be confusing. diff --git a/crates/biome_js_analyze/tests/specs/nursery/noThisInStatic/valid.js b/crates/biome_js_analyze/tests/specs/complexity/noThisInStatic/valid.js similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/noThisInStatic/valid.js rename to crates/biome_js_analyze/tests/specs/complexity/noThisInStatic/valid.js diff --git a/crates/biome_js_analyze/tests/specs/nursery/noThisInStatic/valid.js.snap b/crates/biome_js_analyze/tests/specs/complexity/noThisInStatic/valid.js.snap similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/noThisInStatic/valid.js.snap rename to crates/biome_js_analyze/tests/specs/complexity/noThisInStatic/valid.js.snap diff --git a/crates/biome_js_analyze/tests/specs/nursery/useArrowFunction/invalid.ts b/crates/biome_js_analyze/tests/specs/complexity/useArrowFunction/invalid.ts similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/useArrowFunction/invalid.ts rename to crates/biome_js_analyze/tests/specs/complexity/useArrowFunction/invalid.ts diff --git a/crates/biome_js_analyze/tests/specs/nursery/useArrowFunction/invalid.ts.snap b/crates/biome_js_analyze/tests/specs/complexity/useArrowFunction/invalid.ts.snap similarity index 88% rename from crates/biome_js_analyze/tests/specs/nursery/useArrowFunction/invalid.ts.snap rename to crates/biome_js_analyze/tests/specs/complexity/useArrowFunction/invalid.ts.snap index b8dea97272d9..d735bb44236b 100644 --- a/crates/biome_js_analyze/tests/specs/nursery/useArrowFunction/invalid.ts.snap +++ b/crates/biome_js_analyze/tests/specs/complexity/useArrowFunction/invalid.ts.snap @@ -46,7 +46,7 @@ function f7() { # Diagnostics ``` -invalid.ts:1:12 lint/nursery/useArrowFunction FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:1:12 lint/complexity/useArrowFunction FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This function expression can be turned into an arrow function. @@ -73,7 +73,7 @@ invalid.ts:1:12 lint/nursery/useArrowFunction FIXABLE ━━━━━━━━ ``` ``` -invalid.ts:5:12 lint/nursery/useArrowFunction FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:5:12 lint/complexity/useArrowFunction FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This function expression can be turned into an arrow function. @@ -104,7 +104,7 @@ invalid.ts:5:12 lint/nursery/useArrowFunction FIXABLE ━━━━━━━━ ``` ``` -invalid.ts:9:18 lint/nursery/useArrowFunction FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:9:18 lint/complexity/useArrowFunction FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This function expression can be turned into an arrow function. @@ -135,7 +135,7 @@ invalid.ts:9:18 lint/nursery/useArrowFunction FIXABLE ━━━━━━━━ ``` ``` -invalid.ts:13:12 lint/nursery/useArrowFunction FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:13:12 lint/complexity/useArrowFunction FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This function expression can be turned into an arrow function. @@ -166,7 +166,7 @@ invalid.ts:13:12 lint/nursery/useArrowFunction FIXABLE ━━━━━━━ ``` ``` -invalid.ts:17:12 lint/nursery/useArrowFunction FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:17:12 lint/complexity/useArrowFunction FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This function expression can be turned into an arrow function. @@ -195,7 +195,7 @@ invalid.ts:17:12 lint/nursery/useArrowFunction FIXABLE ━━━━━━━ ``` ``` -invalid.ts:21:12 lint/nursery/useArrowFunction FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:21:12 lint/complexity/useArrowFunction FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This function expression can be turned into an arrow function. @@ -227,7 +227,7 @@ invalid.ts:21:12 lint/nursery/useArrowFunction FIXABLE ━━━━━━━ ``` ``` -invalid.ts:30:12 lint/nursery/useArrowFunction FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:30:12 lint/complexity/useArrowFunction FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This function expression can be turned into an arrow function. diff --git a/crates/biome_js_analyze/tests/specs/nursery/useArrowFunction/valid.ts b/crates/biome_js_analyze/tests/specs/complexity/useArrowFunction/valid.ts similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/useArrowFunction/valid.ts rename to crates/biome_js_analyze/tests/specs/complexity/useArrowFunction/valid.ts diff --git a/crates/biome_js_analyze/tests/specs/nursery/useArrowFunction/valid.ts.snap b/crates/biome_js_analyze/tests/specs/complexity/useArrowFunction/valid.ts.snap similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/useArrowFunction/valid.ts.snap rename to crates/biome_js_analyze/tests/specs/complexity/useArrowFunction/valid.ts.snap diff --git a/crates/biome_js_analyze/tests/specs/nursery/noEmptyCharacterClassInRegex/invalid.js b/crates/biome_js_analyze/tests/specs/correctness/noEmptyCharacterClassInRegex/invalid.js similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/noEmptyCharacterClassInRegex/invalid.js rename to crates/biome_js_analyze/tests/specs/correctness/noEmptyCharacterClassInRegex/invalid.js diff --git a/crates/biome_js_analyze/tests/specs/nursery/noEmptyCharacterClassInRegex/invalid.js.snap b/crates/biome_js_analyze/tests/specs/correctness/noEmptyCharacterClassInRegex/invalid.js.snap similarity index 70% rename from crates/biome_js_analyze/tests/specs/nursery/noEmptyCharacterClassInRegex/invalid.js.snap rename to crates/biome_js_analyze/tests/specs/correctness/noEmptyCharacterClassInRegex/invalid.js.snap index 9d9d05e5c817..afddd7943293 100644 --- a/crates/biome_js_analyze/tests/specs/nursery/noEmptyCharacterClassInRegex/invalid.js.snap +++ b/crates/biome_js_analyze/tests/specs/correctness/noEmptyCharacterClassInRegex/invalid.js.snap @@ -28,7 +28,7 @@ if (/^abc[]/.test(foo)) {} # Diagnostics ``` -invalid.js:1:6 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:1:6 lint/correctness/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The regular expression includes this empty character class. @@ -45,7 +45,7 @@ invalid.js:1:6 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━ ``` ``` -invalid.js:2:5 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:2:5 lint/correctness/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The regular expression includes this empty character class. @@ -63,7 +63,7 @@ invalid.js:2:5 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━ ``` ``` -invalid.js:3:20 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:3:20 lint/correctness/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The regular expression includes this empty character class. @@ -82,7 +82,7 @@ invalid.js:3:20 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━ ``` ``` -invalid.js:4:10 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:4:10 lint/correctness/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The regular expression includes this empty character class. @@ -101,7 +101,7 @@ invalid.js:4:10 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━ ``` ``` -invalid.js:5:2 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:5:2 lint/correctness/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The regular expression includes this empty character class. @@ -120,7 +120,7 @@ invalid.js:5:2 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━ ``` ``` -invalid.js:6:4 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:6:4 lint/correctness/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The regular expression includes this empty character class. @@ -139,7 +139,7 @@ invalid.js:6:4 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━ ``` ``` -invalid.js:7:11 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:7:11 lint/correctness/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The regular expression includes this empty character class. @@ -158,7 +158,7 @@ invalid.js:7:11 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━ ``` ``` -invalid.js:8:2 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:8:2 lint/correctness/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The regular expression includes this empty character class. @@ -177,7 +177,7 @@ invalid.js:8:2 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━ ``` ``` -invalid.js:9:11 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:9:11 lint/correctness/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The regular expression includes this empty character class. @@ -196,7 +196,7 @@ invalid.js:9:11 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━ ``` ``` -invalid.js:10:2 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:10:2 lint/correctness/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The regular expression includes this empty character class. @@ -215,7 +215,7 @@ invalid.js:10:2 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━ ``` ``` -invalid.js:11:3 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:11:3 lint/correctness/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The regular expression includes this empty character class. @@ -234,7 +234,7 @@ invalid.js:11:3 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━ ``` ``` -invalid.js:12:6 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:12:6 lint/correctness/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The regular expression includes this empty character class. @@ -253,7 +253,7 @@ invalid.js:12:6 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━ ``` ``` -invalid.js:13:7 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:13:7 lint/correctness/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The regular expression includes this empty character class. @@ -272,7 +272,7 @@ invalid.js:13:7 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━ ``` ``` -invalid.js:14:6 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:14:6 lint/correctness/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The regular expression includes this empty character class. @@ -291,7 +291,7 @@ invalid.js:14:6 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━ ``` ``` -invalid.js:15:3 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:15:3 lint/correctness/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The regular expression includes this empty character class. @@ -310,7 +310,7 @@ invalid.js:15:3 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━ ``` ``` -invalid.js:16:6 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:16:6 lint/correctness/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The regular expression includes this empty character class. @@ -329,7 +329,7 @@ invalid.js:16:6 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━ ``` ``` -invalid.js:17:3 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:17:3 lint/correctness/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The regular expression includes this empty character class. @@ -348,7 +348,7 @@ invalid.js:17:3 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━ ``` ``` -invalid.js:19:2 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:19:2 lint/correctness/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The regular expression includes this negated empty character class. @@ -366,7 +366,7 @@ invalid.js:19:2 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━ ``` ``` -invalid.js:20:5 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:20:5 lint/correctness/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The regular expression includes this negated empty character class. diff --git a/crates/biome_js_analyze/tests/specs/nursery/noEmptyCharacterClassInRegex/valid.js b/crates/biome_js_analyze/tests/specs/correctness/noEmptyCharacterClassInRegex/valid.js similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/noEmptyCharacterClassInRegex/valid.js rename to crates/biome_js_analyze/tests/specs/correctness/noEmptyCharacterClassInRegex/valid.js diff --git a/crates/biome_js_analyze/tests/specs/nursery/noEmptyCharacterClassInRegex/valid.js.snap b/crates/biome_js_analyze/tests/specs/correctness/noEmptyCharacterClassInRegex/valid.js.snap similarity index 74% rename from crates/biome_js_analyze/tests/specs/nursery/noEmptyCharacterClassInRegex/valid.js.snap rename to crates/biome_js_analyze/tests/specs/correctness/noEmptyCharacterClassInRegex/valid.js.snap index 800ec7a04d4f..85965608da55 100644 --- a/crates/biome_js_analyze/tests/specs/nursery/noEmptyCharacterClassInRegex/valid.js.snap +++ b/crates/biome_js_analyze/tests/specs/correctness/noEmptyCharacterClassInRegex/valid.js.snap @@ -30,7 +30,7 @@ expression: valid.js # Diagnostics ``` -valid.js:15:3 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +valid.js:15:3 lint/correctness/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The regular expression includes this negated empty character class. @@ -49,7 +49,7 @@ valid.js:15:3 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━━ ``` ``` -valid.js:22:3 lint/nursery/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +valid.js:22:3 lint/correctness/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The regular expression includes this negated empty character class. diff --git a/crates/biome_js_analyze/tests/specs/nursery/noInvalidNewBuiltin/invalid.js b/crates/biome_js_analyze/tests/specs/correctness/noInvalidNewBuiltin/invalid.js similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/noInvalidNewBuiltin/invalid.js rename to crates/biome_js_analyze/tests/specs/correctness/noInvalidNewBuiltin/invalid.js diff --git a/crates/biome_js_analyze/tests/specs/nursery/noInvalidNewBuiltin/invalid.js.snap b/crates/biome_js_analyze/tests/specs/correctness/noInvalidNewBuiltin/invalid.js.snap similarity index 76% rename from crates/biome_js_analyze/tests/specs/nursery/noInvalidNewBuiltin/invalid.js.snap rename to crates/biome_js_analyze/tests/specs/correctness/noInvalidNewBuiltin/invalid.js.snap index 4d420fa85942..65218b5dcec5 100644 --- a/crates/biome_js_analyze/tests/specs/nursery/noInvalidNewBuiltin/invalid.js.snap +++ b/crates/biome_js_analyze/tests/specs/correctness/noInvalidNewBuiltin/invalid.js.snap @@ -20,7 +20,7 @@ var baz = new BigInt(9007199254740991); # Diagnostics ``` -invalid.js:1:11 lint/nursery/noInvalidNewBuiltin FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:1:11 lint/correctness/noInvalidNewBuiltin FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Symbol cannot be called as a constructor. @@ -39,7 +39,7 @@ invalid.js:1:11 lint/nursery/noInvalidNewBuiltin FIXABLE ━━━━━━━ ``` ``` -invalid.js:5:11 lint/nursery/noInvalidNewBuiltin FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:5:11 lint/correctness/noInvalidNewBuiltin FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Symbol cannot be called as a constructor. @@ -60,7 +60,7 @@ invalid.js:5:11 lint/nursery/noInvalidNewBuiltin FIXABLE ━━━━━━━ ``` ``` -invalid.js:7:11 lint/nursery/noInvalidNewBuiltin FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:7:11 lint/correctness/noInvalidNewBuiltin FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! BigInt cannot be called as a constructor. @@ -81,7 +81,7 @@ invalid.js:7:11 lint/nursery/noInvalidNewBuiltin FIXABLE ━━━━━━━ ``` ``` -invalid.js:11:11 lint/nursery/noInvalidNewBuiltin FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:11:11 lint/correctness/noInvalidNewBuiltin FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! BigInt cannot be called as a constructor. diff --git a/crates/biome_js_analyze/tests/specs/nursery/noInvalidNewBuiltin/valid.js b/crates/biome_js_analyze/tests/specs/correctness/noInvalidNewBuiltin/valid.js similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/noInvalidNewBuiltin/valid.js rename to crates/biome_js_analyze/tests/specs/correctness/noInvalidNewBuiltin/valid.js diff --git a/crates/biome_js_analyze/tests/specs/nursery/noInvalidNewBuiltin/valid.js.snap b/crates/biome_js_analyze/tests/specs/correctness/noInvalidNewBuiltin/valid.js.snap similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/noInvalidNewBuiltin/valid.js.snap rename to crates/biome_js_analyze/tests/specs/correctness/noInvalidNewBuiltin/valid.js.snap diff --git a/crates/biome_js_analyze/tests/specs/nursery/noUselessElse/invalid.js b/crates/biome_js_analyze/tests/specs/style/noUselessElse/invalid.js similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/noUselessElse/invalid.js rename to crates/biome_js_analyze/tests/specs/style/noUselessElse/invalid.js diff --git a/crates/biome_js_analyze/tests/specs/nursery/noUselessElse/invalid.js.snap b/crates/biome_js_analyze/tests/specs/style/noUselessElse/invalid.js.snap similarity index 92% rename from crates/biome_js_analyze/tests/specs/nursery/noUselessElse/invalid.js.snap rename to crates/biome_js_analyze/tests/specs/style/noUselessElse/invalid.js.snap index ea27035700fd..a339b728eb4e 100644 --- a/crates/biome_js_analyze/tests/specs/nursery/noUselessElse/invalid.js.snap +++ b/crates/biome_js_analyze/tests/specs/style/noUselessElse/invalid.js.snap @@ -103,7 +103,7 @@ function f (x) { // 0 # Diagnostics ``` -invalid.js:4:7 lint/nursery/noUselessElse FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:4:7 lint/style/noUselessElse FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This else clause can be omitted. @@ -145,7 +145,7 @@ invalid.js:4:7 lint/nursery/noUselessElse FIXABLE ━━━━━━━━━ ``` ``` -invalid.js:13:7 lint/nursery/noUselessElse FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:13:7 lint/style/noUselessElse FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This else clause can be omitted. @@ -188,7 +188,7 @@ invalid.js:13:7 lint/nursery/noUselessElse FIXABLE ━━━━━━━━━ ``` ``` -invalid.js:22:7 lint/nursery/noUselessElse FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:22:7 lint/style/noUselessElse FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This else clause can be omitted. @@ -218,7 +218,7 @@ invalid.js:22:7 lint/nursery/noUselessElse FIXABLE ━━━━━━━━━ ``` ``` -invalid.js:28:5 lint/nursery/noUselessElse FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:28:5 lint/style/noUselessElse FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This else clause can be omitted. @@ -255,7 +255,7 @@ invalid.js:28:5 lint/nursery/noUselessElse FIXABLE ━━━━━━━━━ ``` ``` -invalid.js:35:7 lint/nursery/noUselessElse FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:35:7 lint/style/noUselessElse FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This else clause can be omitted. @@ -292,7 +292,7 @@ invalid.js:35:7 lint/nursery/noUselessElse FIXABLE ━━━━━━━━━ ``` ``` -invalid.js:37:7 lint/nursery/noUselessElse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:37:7 lint/style/noUselessElse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This else clause can be omitted. @@ -324,7 +324,7 @@ invalid.js:37:7 lint/nursery/noUselessElse ━━━━━━━━━━━━ ``` ``` -invalid.js:46:11 lint/nursery/noUselessElse FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:46:11 lint/style/noUselessElse FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This else clause can be omitted. @@ -367,7 +367,7 @@ invalid.js:46:11 lint/nursery/noUselessElse FIXABLE ━━━━━━━━ ``` ``` -invalid.js:57:11 lint/nursery/noUselessElse FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:57:11 lint/style/noUselessElse FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This else clause can be omitted. @@ -410,7 +410,7 @@ invalid.js:57:11 lint/nursery/noUselessElse FIXABLE ━━━━━━━━ ``` ``` -invalid.js:73:7 lint/nursery/noUselessElse FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:73:7 lint/style/noUselessElse FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This else clause can be omitted. @@ -452,7 +452,7 @@ invalid.js:73:7 lint/nursery/noUselessElse FIXABLE ━━━━━━━━━ ``` ``` -invalid.js:88:13 lint/nursery/noUselessElse FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:88:13 lint/style/noUselessElse FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This else clause can be omitted. diff --git a/crates/biome_js_analyze/tests/specs/nursery/noUselessElse/missed.js b/crates/biome_js_analyze/tests/specs/style/noUselessElse/missed.js similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/noUselessElse/missed.js rename to crates/biome_js_analyze/tests/specs/style/noUselessElse/missed.js diff --git a/crates/biome_js_analyze/tests/specs/nursery/noUselessElse/missed.js.snap b/crates/biome_js_analyze/tests/specs/style/noUselessElse/missed.js.snap similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/noUselessElse/missed.js.snap rename to crates/biome_js_analyze/tests/specs/style/noUselessElse/missed.js.snap diff --git a/crates/biome_js_analyze/tests/specs/nursery/noUselessElse/valid.js b/crates/biome_js_analyze/tests/specs/style/noUselessElse/valid.js similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/noUselessElse/valid.js rename to crates/biome_js_analyze/tests/specs/style/noUselessElse/valid.js diff --git a/crates/biome_js_analyze/tests/specs/nursery/noUselessElse/valid.js.snap b/crates/biome_js_analyze/tests/specs/style/noUselessElse/valid.js.snap similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/noUselessElse/valid.js.snap rename to crates/biome_js_analyze/tests/specs/style/noUselessElse/valid.js.snap diff --git a/crates/biome_js_analyze/tests/specs/nursery/useAsConstAssertion/invalid.ts b/crates/biome_js_analyze/tests/specs/style/useAsConstAssertion/invalid.ts similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/useAsConstAssertion/invalid.ts rename to crates/biome_js_analyze/tests/specs/style/useAsConstAssertion/invalid.ts diff --git a/crates/biome_js_analyze/tests/specs/nursery/useAsConstAssertion/invalid.ts.snap b/crates/biome_js_analyze/tests/specs/style/useAsConstAssertion/invalid.ts.snap similarity index 81% rename from crates/biome_js_analyze/tests/specs/nursery/useAsConstAssertion/invalid.ts.snap rename to crates/biome_js_analyze/tests/specs/style/useAsConstAssertion/invalid.ts.snap index 0456b87cbe81..d7099b80e36b 100644 --- a/crates/biome_js_analyze/tests/specs/nursery/useAsConstAssertion/invalid.ts.snap +++ b/crates/biome_js_analyze/tests/specs/style/useAsConstAssertion/invalid.ts.snap @@ -53,7 +53,7 @@ function foo(param = 'bar' as 'bar') {} # Diagnostics ``` -invalid.ts:3:27 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:3:27 lint/style/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use as const instead of as with a literal type. @@ -79,7 +79,7 @@ invalid.ts:3:27 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━ ``` ``` -invalid.ts:4:23 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:4:23 lint/style/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use as const instead of as with a literal type. @@ -104,7 +104,7 @@ invalid.ts:4:23 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━ ``` ``` -invalid.ts:5:9 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:5:9 lint/style/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use as const instead of type annotation. @@ -130,7 +130,7 @@ invalid.ts:5:9 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━ ``` ``` -invalid.ts:6:10 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:6:10 lint/style/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use as const instead of type annotation. @@ -156,7 +156,7 @@ invalid.ts:6:10 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━ ``` ``` -invalid.ts:7:10 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:7:10 lint/style/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use as const instead of type annotation. @@ -182,7 +182,7 @@ invalid.ts:7:10 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━ ``` ``` -invalid.ts:8:27 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:8:27 lint/style/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use as const instead of as with a literal type. @@ -208,7 +208,7 @@ invalid.ts:8:27 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━ ``` ``` -invalid.ts:9:12 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:9:12 lint/style/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use as const instead of angle bracket type assertion. @@ -234,7 +234,7 @@ invalid.ts:9:12 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━ ``` ``` -invalid.ts:10:12 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:10:12 lint/style/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use as const instead of angle bracket type assertion. @@ -260,7 +260,7 @@ invalid.ts:10:12 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━ ``` ``` -invalid.ts:11:20 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:11:20 lint/style/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use as const instead of as with a literal type. @@ -286,7 +286,7 @@ invalid.ts:11:20 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━ ``` ``` -invalid.ts:12:16 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:12:16 lint/style/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use as const instead of as with a literal type. @@ -312,7 +312,7 @@ invalid.ts:12:16 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━ ``` ``` -invalid.ts:15:8 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:15:8 lint/style/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use as const instead of type annotation. @@ -337,7 +337,7 @@ invalid.ts:15:8 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━ ``` ``` -invalid.ts:19:8 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:19:8 lint/style/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use as const instead of type annotation. @@ -362,7 +362,7 @@ invalid.ts:19:8 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━ ``` ``` -invalid.ts:23:10 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:23:10 lint/style/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use as const instead of angle bracket type assertion. @@ -387,7 +387,7 @@ invalid.ts:23:10 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━ ``` ``` -invalid.ts:27:18 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:27:18 lint/style/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use as const instead of as with a literal type. @@ -412,7 +412,7 @@ invalid.ts:27:18 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━ ``` ``` -invalid.ts:31:14 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:31:14 lint/style/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use as const instead of as with a literal type. @@ -437,7 +437,7 @@ invalid.ts:31:14 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━ ``` ``` -invalid.ts:35:36 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:35:36 lint/style/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use as const instead of as with a literal type. @@ -462,7 +462,7 @@ invalid.ts:35:36 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━ ``` ``` -invalid.ts:38:27 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:38:27 lint/style/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use as const instead of as with a literal type. @@ -488,7 +488,7 @@ invalid.ts:38:27 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━ ``` ``` -invalid.ts:41:40 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:41:40 lint/style/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use as const instead of as with a literal type. @@ -513,7 +513,7 @@ invalid.ts:41:40 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━ ``` ``` -invalid.ts:44:31 lint/nursery/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:44:31 lint/style/useAsConstAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use as const instead of as with a literal type. diff --git a/crates/biome_js_analyze/tests/specs/nursery/useAsConstAssertion/valid.ts b/crates/biome_js_analyze/tests/specs/style/useAsConstAssertion/valid.ts similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/useAsConstAssertion/valid.ts rename to crates/biome_js_analyze/tests/specs/style/useAsConstAssertion/valid.ts diff --git a/crates/biome_js_analyze/tests/specs/nursery/useAsConstAssertion/valid.ts.snap b/crates/biome_js_analyze/tests/specs/style/useAsConstAssertion/valid.ts.snap similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/useAsConstAssertion/valid.ts.snap rename to crates/biome_js_analyze/tests/specs/style/useAsConstAssertion/valid.ts.snap diff --git a/crates/biome_js_analyze/tests/specs/nursery/useShorthandAssign/invalid.js b/crates/biome_js_analyze/tests/specs/style/useShorthandAssign/invalid.js similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/useShorthandAssign/invalid.js rename to crates/biome_js_analyze/tests/specs/style/useShorthandAssign/invalid.js diff --git a/crates/biome_js_analyze/tests/specs/nursery/useShorthandAssign/invalid.js.snap b/crates/biome_js_analyze/tests/specs/style/useShorthandAssign/invalid.js.snap similarity index 74% rename from crates/biome_js_analyze/tests/specs/nursery/useShorthandAssign/invalid.js.snap rename to crates/biome_js_analyze/tests/specs/style/useShorthandAssign/invalid.js.snap index b52014be29d8..7df15716604f 100644 --- a/crates/biome_js_analyze/tests/specs/nursery/useShorthandAssign/invalid.js.snap +++ b/crates/biome_js_analyze/tests/specs/style/useShorthandAssign/invalid.js.snap @@ -32,7 +32,7 @@ window.a = window.a + 1; # Diagnostics ``` -invalid.js:1:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:1:1 lint/style/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Assignment (=) can be replaced with operator assignment +=. @@ -52,7 +52,7 @@ invalid.js:1:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━ ``` ``` -invalid.js:2:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:2:1 lint/style/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Assignment (=) can be replaced with operator assignment -=. @@ -74,7 +74,7 @@ invalid.js:2:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━ ``` ``` -invalid.js:3:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:3:1 lint/style/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Assignment (=) can be replaced with operator assignment *=. @@ -98,7 +98,7 @@ invalid.js:3:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━ ``` ``` -invalid.js:4:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:4:1 lint/style/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Assignment (=) can be replaced with operator assignment *=. @@ -122,7 +122,7 @@ invalid.js:4:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━ ``` ``` -invalid.js:5:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:5:1 lint/style/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Assignment (=) can be replaced with operator assignment /=. @@ -146,7 +146,7 @@ invalid.js:5:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━ ``` ``` -invalid.js:6:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:6:1 lint/style/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Assignment (=) can be replaced with operator assignment %=. @@ -170,7 +170,7 @@ invalid.js:6:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━ ``` ``` -invalid.js:7:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:7:1 lint/style/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Assignment (=) can be replaced with operator assignment <<=. @@ -194,7 +194,7 @@ invalid.js:7:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━ ``` ``` -invalid.js:8:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:8:1 lint/style/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Assignment (=) can be replaced with operator assignment >>=. @@ -218,7 +218,7 @@ invalid.js:8:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━ ``` ``` -invalid.js:9:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:9:1 lint/style/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Assignment (=) can be replaced with operator assignment >>>=. @@ -242,7 +242,7 @@ invalid.js:9:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━ ``` ``` -invalid.js:10:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:10:1 lint/style/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Assignment (=) can be replaced with operator assignment &=. @@ -266,7 +266,7 @@ invalid.js:10:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━ ``` ``` -invalid.js:11:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:11:1 lint/style/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Assignment (=) can be replaced with operator assignment &=. @@ -290,7 +290,7 @@ invalid.js:11:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━ ``` ``` -invalid.js:12:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:12:1 lint/style/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Assignment (=) can be replaced with operator assignment ^=. @@ -314,7 +314,7 @@ invalid.js:12:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━ ``` ``` -invalid.js:13:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:13:1 lint/style/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Assignment (=) can be replaced with operator assignment ^=. @@ -338,7 +338,7 @@ invalid.js:13:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━ ``` ``` -invalid.js:14:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:14:1 lint/style/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Assignment (=) can be replaced with operator assignment |=. @@ -362,7 +362,7 @@ invalid.js:14:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━ ``` ``` -invalid.js:15:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:15:1 lint/style/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Assignment (=) can be replaced with operator assignment |=. @@ -386,7 +386,7 @@ invalid.js:15:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━ ``` ``` -invalid.js:16:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:16:1 lint/style/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Assignment (=) can be replaced with operator assignment **=. @@ -410,7 +410,7 @@ invalid.js:16:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━ ``` ``` -invalid.js:17:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:17:1 lint/style/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Assignment (=) can be replaced with operator assignment +=. @@ -434,7 +434,7 @@ invalid.js:17:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━ ``` ``` -invalid.js:18:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:18:1 lint/style/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Assignment (=) can be replaced with operator assignment +=. @@ -458,7 +458,7 @@ invalid.js:18:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━ ``` ``` -invalid.js:19:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:19:1 lint/style/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Assignment (=) can be replaced with operator assignment +=. @@ -482,7 +482,7 @@ invalid.js:19:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━ ``` ``` -invalid.js:20:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:20:1 lint/style/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Assignment (=) can be replaced with operator assignment +=. @@ -506,7 +506,7 @@ invalid.js:20:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━ ``` ``` -invalid.js:21:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:21:1 lint/style/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Assignment (=) can be replaced with operator assignment +=. @@ -530,7 +530,7 @@ invalid.js:21:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━ ``` ``` -invalid.js:22:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:22:1 lint/style/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Assignment (=) can be replaced with operator assignment -=. @@ -554,7 +554,7 @@ invalid.js:22:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━ ``` ``` -invalid.js:23:1 lint/nursery/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:23:1 lint/style/useShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Assignment (=) can be replaced with operator assignment +=. diff --git a/crates/biome_js_analyze/tests/specs/nursery/useShorthandAssign/valid.js b/crates/biome_js_analyze/tests/specs/style/useShorthandAssign/valid.js similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/useShorthandAssign/valid.js rename to crates/biome_js_analyze/tests/specs/style/useShorthandAssign/valid.js diff --git a/crates/biome_js_analyze/tests/specs/nursery/useShorthandAssign/valid.js.snap b/crates/biome_js_analyze/tests/specs/style/useShorthandAssign/valid.js.snap similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/useShorthandAssign/valid.js.snap rename to crates/biome_js_analyze/tests/specs/style/useShorthandAssign/valid.js.snap diff --git a/crates/biome_js_analyze/tests/specs/nursery/noApproximativeNumericConstant/invalid.js b/crates/biome_js_analyze/tests/specs/suspicious/noApproximativeNumericConstant/invalid.js similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/noApproximativeNumericConstant/invalid.js rename to crates/biome_js_analyze/tests/specs/suspicious/noApproximativeNumericConstant/invalid.js diff --git a/crates/biome_js_analyze/tests/specs/nursery/noApproximativeNumericConstant/invalid.js.snap b/crates/biome_js_analyze/tests/specs/suspicious/noApproximativeNumericConstant/invalid.js.snap similarity index 74% rename from crates/biome_js_analyze/tests/specs/nursery/noApproximativeNumericConstant/invalid.js.snap rename to crates/biome_js_analyze/tests/specs/suspicious/noApproximativeNumericConstant/invalid.js.snap index 73b0f73cc509..8065da71a099 100644 --- a/crates/biome_js_analyze/tests/specs/nursery/noApproximativeNumericConstant/invalid.js.snap +++ b/crates/biome_js_analyze/tests/specs/suspicious/noApproximativeNumericConstant/invalid.js.snap @@ -34,7 +34,7 @@ const constants1 = [ # Diagnostics ``` -invalid.js:1:11 lint/nursery/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:1:11 lint/suspicious/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Prefer constants from the standard library. @@ -49,7 +49,7 @@ invalid.js:1:11 lint/nursery/noApproximativeNumericConstant ━━━━━━ ``` ``` -invalid.js:2:11 lint/nursery/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:2:11 lint/suspicious/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Prefer constants from the standard library. @@ -65,7 +65,7 @@ invalid.js:2:11 lint/nursery/noApproximativeNumericConstant ━━━━━━ ``` ``` -invalid.js:3:11 lint/nursery/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:3:11 lint/suspicious/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Prefer constants from the standard library. @@ -82,7 +82,7 @@ invalid.js:3:11 lint/nursery/noApproximativeNumericConstant ━━━━━━ ``` ``` -invalid.js:6:2 lint/nursery/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:6:2 lint/suspicious/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Prefer constants from the standard library. @@ -98,7 +98,7 @@ invalid.js:6:2 lint/nursery/noApproximativeNumericConstant ━━━━━━━ ``` ``` -invalid.js:7:2 lint/nursery/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:7:2 lint/suspicious/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Prefer constants from the standard library. @@ -115,7 +115,7 @@ invalid.js:7:2 lint/nursery/noApproximativeNumericConstant ━━━━━━━ ``` ``` -invalid.js:8:2 lint/nursery/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:8:2 lint/suspicious/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Prefer constants from the standard library. @@ -132,7 +132,7 @@ invalid.js:8:2 lint/nursery/noApproximativeNumericConstant ━━━━━━━ ``` ``` -invalid.js:9:2 lint/nursery/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:9:2 lint/suspicious/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Prefer constants from the standard library. @@ -149,7 +149,7 @@ invalid.js:9:2 lint/nursery/noApproximativeNumericConstant ━━━━━━━ ``` ``` -invalid.js:10:2 lint/nursery/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:10:2 lint/suspicious/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Prefer constants from the standard library. @@ -166,7 +166,7 @@ invalid.js:10:2 lint/nursery/noApproximativeNumericConstant ━━━━━━ ``` ``` -invalid.js:11:2 lint/nursery/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:11:2 lint/suspicious/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Prefer constants from the standard library. @@ -183,7 +183,7 @@ invalid.js:11:2 lint/nursery/noApproximativeNumericConstant ━━━━━━ ``` ``` -invalid.js:12:2 lint/nursery/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:12:2 lint/suspicious/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Prefer constants from the standard library. @@ -200,7 +200,7 @@ invalid.js:12:2 lint/nursery/noApproximativeNumericConstant ━━━━━━ ``` ``` -invalid.js:13:2 lint/nursery/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:13:2 lint/suspicious/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Prefer constants from the standard library. @@ -217,7 +217,7 @@ invalid.js:13:2 lint/nursery/noApproximativeNumericConstant ━━━━━━ ``` ``` -invalid.js:17:2 lint/nursery/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:17:2 lint/suspicious/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Prefer constants from the standard library. @@ -233,7 +233,7 @@ invalid.js:17:2 lint/nursery/noApproximativeNumericConstant ━━━━━━ ``` ``` -invalid.js:18:2 lint/nursery/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:18:2 lint/suspicious/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Prefer constants from the standard library. @@ -250,7 +250,7 @@ invalid.js:18:2 lint/nursery/noApproximativeNumericConstant ━━━━━━ ``` ``` -invalid.js:19:2 lint/nursery/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:19:2 lint/suspicious/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Prefer constants from the standard library. @@ -267,7 +267,7 @@ invalid.js:19:2 lint/nursery/noApproximativeNumericConstant ━━━━━━ ``` ``` -invalid.js:20:2 lint/nursery/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:20:2 lint/suspicious/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Prefer constants from the standard library. @@ -284,7 +284,7 @@ invalid.js:20:2 lint/nursery/noApproximativeNumericConstant ━━━━━━ ``` ``` -invalid.js:21:2 lint/nursery/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:21:2 lint/suspicious/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Prefer constants from the standard library. @@ -301,7 +301,7 @@ invalid.js:21:2 lint/nursery/noApproximativeNumericConstant ━━━━━━ ``` ``` -invalid.js:22:2 lint/nursery/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:22:2 lint/suspicious/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Prefer constants from the standard library. @@ -318,7 +318,7 @@ invalid.js:22:2 lint/nursery/noApproximativeNumericConstant ━━━━━━ ``` ``` -invalid.js:23:2 lint/nursery/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:23:2 lint/suspicious/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Prefer constants from the standard library. @@ -335,7 +335,7 @@ invalid.js:23:2 lint/nursery/noApproximativeNumericConstant ━━━━━━ ``` ``` -invalid.js:24:2 lint/nursery/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:24:2 lint/suspicious/noApproximativeNumericConstant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Prefer constants from the standard library. diff --git a/crates/biome_js_analyze/tests/specs/nursery/noApproximativeNumericConstant/valid.js b/crates/biome_js_analyze/tests/specs/suspicious/noApproximativeNumericConstant/valid.js similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/noApproximativeNumericConstant/valid.js rename to crates/biome_js_analyze/tests/specs/suspicious/noApproximativeNumericConstant/valid.js diff --git a/crates/biome_js_analyze/tests/specs/nursery/noApproximativeNumericConstant/valid.js.snap b/crates/biome_js_analyze/tests/specs/suspicious/noApproximativeNumericConstant/valid.js.snap similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/noApproximativeNumericConstant/valid.js.snap rename to crates/biome_js_analyze/tests/specs/suspicious/noApproximativeNumericConstant/valid.js.snap diff --git a/crates/biome_js_analyze/tests/specs/nursery/noMisleadingInstantiator/invalid.ts b/crates/biome_js_analyze/tests/specs/suspicious/noMisleadingInstantiator/invalid.ts similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/noMisleadingInstantiator/invalid.ts rename to crates/biome_js_analyze/tests/specs/suspicious/noMisleadingInstantiator/invalid.ts diff --git a/crates/biome_js_analyze/tests/specs/nursery/noMisleadingInstantiator/invalid.ts.snap b/crates/biome_js_analyze/tests/specs/suspicious/noMisleadingInstantiator/invalid.ts.snap similarity index 75% rename from crates/biome_js_analyze/tests/specs/nursery/noMisleadingInstantiator/invalid.ts.snap rename to crates/biome_js_analyze/tests/specs/suspicious/noMisleadingInstantiator/invalid.ts.snap index e23426dbff98..5e80bc01eb41 100644 --- a/crates/biome_js_analyze/tests/specs/nursery/noMisleadingInstantiator/invalid.ts.snap +++ b/crates/biome_js_analyze/tests/specs/suspicious/noMisleadingInstantiator/invalid.ts.snap @@ -45,7 +45,7 @@ interface I { # Diagnostics ``` -invalid.ts:2:3 lint/nursery/noMisleadingInstantiator ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:2:3 lint/suspicious/noMisleadingInstantiator ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Don't use the new method in interfaces. @@ -61,7 +61,7 @@ invalid.ts:2:3 lint/nursery/noMisleadingInstantiator ━━━━━━━━━ ``` ``` -invalid.ts:6:2 lint/nursery/noMisleadingInstantiator ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:6:2 lint/suspicious/noMisleadingInstantiator ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Don't use the constructor method in interfaces. @@ -77,7 +77,7 @@ invalid.ts:6:2 lint/nursery/noMisleadingInstantiator ━━━━━━━━━ ``` ``` -invalid.ts:11:3 lint/nursery/noMisleadingInstantiator ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:11:3 lint/suspicious/noMisleadingInstantiator ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Don't use the new method in interfaces. @@ -94,7 +94,7 @@ invalid.ts:11:3 lint/nursery/noMisleadingInstantiator ━━━━━━━━ ``` ``` -invalid.ts:15:3 lint/nursery/noMisleadingInstantiator ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:15:3 lint/suspicious/noMisleadingInstantiator ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Don't use the constructor method in type aliases. @@ -110,7 +110,7 @@ invalid.ts:15:3 lint/nursery/noMisleadingInstantiator ━━━━━━━━ ``` ``` -invalid.ts:19:3 lint/nursery/noMisleadingInstantiator ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:19:3 lint/suspicious/noMisleadingInstantiator ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Don't use the new method in classes. @@ -126,7 +126,7 @@ invalid.ts:19:3 lint/nursery/noMisleadingInstantiator ━━━━━━━━ ``` ``` -invalid.ts:23:3 lint/nursery/noMisleadingInstantiator ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:23:3 lint/suspicious/noMisleadingInstantiator ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Don't use the new method in classes. @@ -142,7 +142,7 @@ invalid.ts:23:3 lint/nursery/noMisleadingInstantiator ━━━━━━━━ ``` ``` -invalid.ts:27:3 lint/nursery/noMisleadingInstantiator ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:27:3 lint/suspicious/noMisleadingInstantiator ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Don't use the new method in classes. @@ -158,7 +158,7 @@ invalid.ts:27:3 lint/nursery/noMisleadingInstantiator ━━━━━━━━ ``` ``` -invalid.ts:27:3 lint/nursery/noMisleadingInstantiator ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:27:3 lint/suspicious/noMisleadingInstantiator ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Don't use the new method in classes. @@ -174,7 +174,7 @@ invalid.ts:27:3 lint/nursery/noMisleadingInstantiator ━━━━━━━━ ``` ``` -invalid.ts:31:3 lint/nursery/noMisleadingInstantiator ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:31:3 lint/suspicious/noMisleadingInstantiator ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Don't use the constructor method in interfaces. @@ -190,7 +190,7 @@ invalid.ts:31:3 lint/nursery/noMisleadingInstantiator ━━━━━━━━ ``` ``` -invalid.ts:35:3 lint/nursery/noMisleadingInstantiator ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.ts:35:3 lint/suspicious/noMisleadingInstantiator ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Don't use the new method in interfaces. diff --git a/crates/biome_js_analyze/tests/specs/nursery/noMisleadingInstantiator/valid.ts b/crates/biome_js_analyze/tests/specs/suspicious/noMisleadingInstantiator/valid.ts similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/noMisleadingInstantiator/valid.ts rename to crates/biome_js_analyze/tests/specs/suspicious/noMisleadingInstantiator/valid.ts diff --git a/crates/biome_js_analyze/tests/specs/nursery/noMisleadingInstantiator/valid.ts.snap b/crates/biome_js_analyze/tests/specs/suspicious/noMisleadingInstantiator/valid.ts.snap similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/noMisleadingInstantiator/valid.ts.snap rename to crates/biome_js_analyze/tests/specs/suspicious/noMisleadingInstantiator/valid.ts.snap diff --git a/crates/biome_js_analyze/tests/specs/nursery/noMisrefactoredShorthandAssign/invalid.js b/crates/biome_js_analyze/tests/specs/suspicious/noMisrefactoredShorthandAssign/invalid.js similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/noMisrefactoredShorthandAssign/invalid.js rename to crates/biome_js_analyze/tests/specs/suspicious/noMisrefactoredShorthandAssign/invalid.js diff --git a/crates/biome_js_analyze/tests/specs/nursery/noMisrefactoredShorthandAssign/invalid.js.snap b/crates/biome_js_analyze/tests/specs/suspicious/noMisrefactoredShorthandAssign/invalid.js.snap similarity index 69% rename from crates/biome_js_analyze/tests/specs/nursery/noMisrefactoredShorthandAssign/invalid.js.snap rename to crates/biome_js_analyze/tests/specs/suspicious/noMisrefactoredShorthandAssign/invalid.js.snap index 241561b67e15..0d1b4dc9e701 100644 --- a/crates/biome_js_analyze/tests/specs/nursery/noMisrefactoredShorthandAssign/invalid.js.snap +++ b/crates/biome_js_analyze/tests/specs/suspicious/noMisrefactoredShorthandAssign/invalid.js.snap @@ -43,7 +43,7 @@ a ^= b ^ a # Diagnostics ``` -invalid.js:1:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:1:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. @@ -62,7 +62,7 @@ invalid.js:1:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━ ``` ``` -invalid.js:3:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:3:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. @@ -83,7 +83,7 @@ invalid.js:3:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━ ``` ``` -invalid.js:5:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:5:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. @@ -104,7 +104,7 @@ invalid.js:5:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━ ``` ``` -invalid.js:7:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:7:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. @@ -125,7 +125,7 @@ invalid.js:7:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━ ``` ``` -invalid.js:9:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:9:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. @@ -146,7 +146,7 @@ invalid.js:9:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━ ``` ``` -invalid.js:11:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:11:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. @@ -167,7 +167,7 @@ invalid.js:11:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━ ``` ``` -invalid.js:13:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:13:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. @@ -188,7 +188,7 @@ invalid.js:13:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━ ``` ``` -invalid.js:15:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:15:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. @@ -209,7 +209,7 @@ invalid.js:15:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━ ``` ``` -invalid.js:17:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:17:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. @@ -230,7 +230,7 @@ invalid.js:17:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━ ``` ``` -invalid.js:19:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:19:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. @@ -251,7 +251,7 @@ invalid.js:19:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━ ``` ``` -invalid.js:21:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:21:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. @@ -272,7 +272,7 @@ invalid.js:21:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━ ``` ``` -invalid.js:23:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:23:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. @@ -293,7 +293,7 @@ invalid.js:23:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━ ``` ``` -invalid.js:25:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:25:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. @@ -314,7 +314,7 @@ invalid.js:25:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━ ``` ``` -invalid.js:27:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:27:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. @@ -335,7 +335,7 @@ invalid.js:27:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━ ``` ``` -invalid.js:29:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:29:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. @@ -356,7 +356,7 @@ invalid.js:29:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━ ``` ``` -invalid.js:31:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:31:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. @@ -377,7 +377,7 @@ invalid.js:31:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━ ``` ``` -invalid.js:33:1 lint/nursery/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +invalid.js:33:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. diff --git a/crates/biome_js_analyze/tests/specs/nursery/noMisrefactoredShorthandAssign/valid.js b/crates/biome_js_analyze/tests/specs/suspicious/noMisrefactoredShorthandAssign/valid.js similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/noMisrefactoredShorthandAssign/valid.js rename to crates/biome_js_analyze/tests/specs/suspicious/noMisrefactoredShorthandAssign/valid.js diff --git a/crates/biome_js_analyze/tests/specs/nursery/noMisrefactoredShorthandAssign/valid.js.snap b/crates/biome_js_analyze/tests/specs/suspicious/noMisrefactoredShorthandAssign/valid.js.snap similarity index 100% rename from crates/biome_js_analyze/tests/specs/nursery/noMisrefactoredShorthandAssign/valid.js.snap rename to crates/biome_js_analyze/tests/specs/suspicious/noMisrefactoredShorthandAssign/valid.js.snap diff --git a/crates/biome_service/src/configuration/linter/rules.rs b/crates/biome_service/src/configuration/linter/rules.rs index 9486f7cc573f..7ac4d82872ad 100644 --- a/crates/biome_service/src/configuration/linter/rules.rs +++ b/crates/biome_service/src/configuration/linter/rules.rs @@ -463,6 +463,15 @@ pub struct A11y { #[bpaf(long("no-header-scope"), argument("on|off|warn"), optional, hide)] #[serde(skip_serializing_if = "Option::is_none")] pub no_header_scope: Option, + #[doc = "Enforce that non-interactive ARIA roles are not assigned to interactive HTML elements."] + #[bpaf( + long("no-interactive-element-to-noninteractive-role"), + argument("on|off|warn"), + optional, + hide + )] + #[serde(skip_serializing_if = "Option::is_none")] + pub no_interactive_element_to_noninteractive_role: Option, #[doc = "Enforce that interactive ARIA roles are not assigned to non-interactive HTML elements."] #[bpaf( long("no-noninteractive-element-to-interactive-role"), @@ -505,6 +514,15 @@ pub struct A11y { #[bpaf(long("use-anchor-content"), argument("on|off|warn"), optional, hide)] #[serde(skip_serializing_if = "Option::is_none")] pub use_anchor_content: Option, + #[doc = "Enforce that tabIndex is assigned to non-interactive HTML elements with aria-activedescendant."] + #[bpaf( + long("use-aria-activedescendant-with-tabindex"), + argument("on|off|warn"), + optional, + hide + )] + #[serde(skip_serializing_if = "Option::is_none")] + pub use_aria_activedescendant_with_tabindex: Option, #[doc = "Enforce that elements with ARIA roles must have all required ARIA attributes for that role."] #[bpaf( long("use-aria-props-for-role"), @@ -589,6 +607,12 @@ impl MergeWith for A11y { if let Some(no_header_scope) = other.no_header_scope { self.no_header_scope = Some(no_header_scope); } + if let Some(no_interactive_element_to_noninteractive_role) = + other.no_interactive_element_to_noninteractive_role + { + self.no_interactive_element_to_noninteractive_role = + Some(no_interactive_element_to_noninteractive_role); + } if let Some(no_noninteractive_element_to_interactive_role) = other.no_noninteractive_element_to_interactive_role { @@ -616,6 +640,12 @@ impl MergeWith for A11y { if let Some(use_anchor_content) = other.use_anchor_content { self.use_anchor_content = Some(use_anchor_content); } + if let Some(use_aria_activedescendant_with_tabindex) = + other.use_aria_activedescendant_with_tabindex + { + self.use_aria_activedescendant_with_tabindex = + Some(use_aria_activedescendant_with_tabindex); + } if let Some(use_aria_props_for_role) = other.use_aria_props_for_role { self.use_aria_props_for_role = Some(use_aria_props_for_role); } @@ -664,13 +694,14 @@ impl MergeWith for A11y { } impl A11y { const GROUP_NAME: &'static str = "a11y"; - pub(crate) const GROUP_RULES: [&'static str; 26] = [ + pub(crate) const GROUP_RULES: [&'static str; 28] = [ "noAccessKey", "noAriaUnsupportedElements", "noAutofocus", "noBlankTarget", "noDistractingElements", "noHeaderScope", + "noInteractiveElementToNoninteractiveRole", "noNoninteractiveElementToInteractiveRole", "noNoninteractiveTabindex", "noPositiveTabindex", @@ -679,6 +710,7 @@ impl A11y { "noSvgWithoutTitle", "useAltText", "useAnchorContent", + "useAriaActivedescendantWithTabindex", "useAriaPropsForRole", "useButtonType", "useHeadingContent", @@ -692,12 +724,14 @@ impl A11y { "useValidAriaValues", "useValidLang", ]; - const RECOMMENDED_RULES: [&'static str; 24] = [ + const RECOMMENDED_RULES: [&'static str; 28] = [ + "noAccessKey", "noAriaUnsupportedElements", "noAutofocus", "noBlankTarget", "noDistractingElements", "noHeaderScope", + "noInteractiveElementToNoninteractiveRole", "noNoninteractiveElementToInteractiveRole", "noNoninteractiveTabindex", "noPositiveTabindex", @@ -706,8 +740,10 @@ impl A11y { "noSvgWithoutTitle", "useAltText", "useAnchorContent", + "useAriaActivedescendantWithTabindex", "useAriaPropsForRole", "useButtonType", + "useHeadingContent", "useHtmlLang", "useIframeTitle", "useKeyWithClickEvents", @@ -718,7 +754,8 @@ impl A11y { "useValidAriaValues", "useValidLang", ]; - const RECOMMENDED_RULES_AS_FILTERS: [RuleFilter<'static>; 24] = [ + const RECOMMENDED_RULES_AS_FILTERS: [RuleFilter<'static>; 28] = [ + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[0]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[1]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[2]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[3]), @@ -734,6 +771,7 @@ impl A11y { RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[13]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[14]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[15]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[16]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[17]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[18]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[19]), @@ -743,8 +781,10 @@ impl A11y { RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[23]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[24]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[25]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[26]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[27]), ]; - const ALL_RULES_AS_FILTERS: [RuleFilter<'static>; 26] = [ + const ALL_RULES_AS_FILTERS: [RuleFilter<'static>; 28] = [ RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[0]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[1]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[2]), @@ -771,6 +811,8 @@ impl A11y { RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[23]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[24]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[25]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[26]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[27]), ]; #[doc = r" Retrieves the recommended rules"] pub(crate) fn is_recommended(&self) -> bool { @@ -817,106 +859,116 @@ impl A11y { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[5])); } } - if let Some(rule) = self.no_noninteractive_element_to_interactive_role.as_ref() { + if let Some(rule) = self.no_interactive_element_to_noninteractive_role.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[6])); } } - if let Some(rule) = self.no_noninteractive_tabindex.as_ref() { + if let Some(rule) = self.no_noninteractive_element_to_interactive_role.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[7])); } } - if let Some(rule) = self.no_positive_tabindex.as_ref() { + if let Some(rule) = self.no_noninteractive_tabindex.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[8])); } } - if let Some(rule) = self.no_redundant_alt.as_ref() { + if let Some(rule) = self.no_positive_tabindex.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[9])); } } - if let Some(rule) = self.no_redundant_roles.as_ref() { + if let Some(rule) = self.no_redundant_alt.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[10])); } } - if let Some(rule) = self.no_svg_without_title.as_ref() { + if let Some(rule) = self.no_redundant_roles.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[11])); } } - if let Some(rule) = self.use_alt_text.as_ref() { + if let Some(rule) = self.no_svg_without_title.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[12])); } } - if let Some(rule) = self.use_anchor_content.as_ref() { + if let Some(rule) = self.use_alt_text.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[13])); } } - if let Some(rule) = self.use_aria_props_for_role.as_ref() { + if let Some(rule) = self.use_anchor_content.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[14])); } } - if let Some(rule) = self.use_button_type.as_ref() { + if let Some(rule) = self.use_aria_activedescendant_with_tabindex.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[15])); } } - if let Some(rule) = self.use_heading_content.as_ref() { + if let Some(rule) = self.use_aria_props_for_role.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[16])); } } - if let Some(rule) = self.use_html_lang.as_ref() { + if let Some(rule) = self.use_button_type.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[17])); } } - if let Some(rule) = self.use_iframe_title.as_ref() { + if let Some(rule) = self.use_heading_content.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[18])); } } - if let Some(rule) = self.use_key_with_click_events.as_ref() { + if let Some(rule) = self.use_html_lang.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[19])); } } - if let Some(rule) = self.use_key_with_mouse_events.as_ref() { + if let Some(rule) = self.use_iframe_title.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[20])); } } - if let Some(rule) = self.use_media_caption.as_ref() { + if let Some(rule) = self.use_key_with_click_events.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[21])); } } - if let Some(rule) = self.use_valid_anchor.as_ref() { + if let Some(rule) = self.use_key_with_mouse_events.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[22])); } } - if let Some(rule) = self.use_valid_aria_props.as_ref() { + if let Some(rule) = self.use_media_caption.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[23])); } } - if let Some(rule) = self.use_valid_aria_values.as_ref() { + if let Some(rule) = self.use_valid_anchor.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[24])); } } - if let Some(rule) = self.use_valid_lang.as_ref() { + if let Some(rule) = self.use_valid_aria_props.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[25])); } } + if let Some(rule) = self.use_valid_aria_values.as_ref() { + if rule.is_enabled() { + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[26])); + } + } + if let Some(rule) = self.use_valid_lang.as_ref() { + if rule.is_enabled() { + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[27])); + } + } index_set } pub(crate) fn get_disabled_rules(&self) -> IndexSet { @@ -951,106 +1003,116 @@ impl A11y { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[5])); } } - if let Some(rule) = self.no_noninteractive_element_to_interactive_role.as_ref() { + if let Some(rule) = self.no_interactive_element_to_noninteractive_role.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[6])); } } - if let Some(rule) = self.no_noninteractive_tabindex.as_ref() { + if let Some(rule) = self.no_noninteractive_element_to_interactive_role.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[7])); } } - if let Some(rule) = self.no_positive_tabindex.as_ref() { + if let Some(rule) = self.no_noninteractive_tabindex.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[8])); } } - if let Some(rule) = self.no_redundant_alt.as_ref() { + if let Some(rule) = self.no_positive_tabindex.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[9])); } } - if let Some(rule) = self.no_redundant_roles.as_ref() { + if let Some(rule) = self.no_redundant_alt.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[10])); } } - if let Some(rule) = self.no_svg_without_title.as_ref() { + if let Some(rule) = self.no_redundant_roles.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[11])); } } - if let Some(rule) = self.use_alt_text.as_ref() { + if let Some(rule) = self.no_svg_without_title.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[12])); } } - if let Some(rule) = self.use_anchor_content.as_ref() { + if let Some(rule) = self.use_alt_text.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[13])); } } - if let Some(rule) = self.use_aria_props_for_role.as_ref() { + if let Some(rule) = self.use_anchor_content.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[14])); } } - if let Some(rule) = self.use_button_type.as_ref() { + if let Some(rule) = self.use_aria_activedescendant_with_tabindex.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[15])); } } - if let Some(rule) = self.use_heading_content.as_ref() { + if let Some(rule) = self.use_aria_props_for_role.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[16])); } } - if let Some(rule) = self.use_html_lang.as_ref() { + if let Some(rule) = self.use_button_type.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[17])); } } - if let Some(rule) = self.use_iframe_title.as_ref() { + if let Some(rule) = self.use_heading_content.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[18])); } } - if let Some(rule) = self.use_key_with_click_events.as_ref() { + if let Some(rule) = self.use_html_lang.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[19])); } } - if let Some(rule) = self.use_key_with_mouse_events.as_ref() { + if let Some(rule) = self.use_iframe_title.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[20])); } } - if let Some(rule) = self.use_media_caption.as_ref() { + if let Some(rule) = self.use_key_with_click_events.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[21])); } } - if let Some(rule) = self.use_valid_anchor.as_ref() { + if let Some(rule) = self.use_key_with_mouse_events.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[22])); } } - if let Some(rule) = self.use_valid_aria_props.as_ref() { + if let Some(rule) = self.use_media_caption.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[23])); } } - if let Some(rule) = self.use_valid_aria_values.as_ref() { + if let Some(rule) = self.use_valid_anchor.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[24])); } } - if let Some(rule) = self.use_valid_lang.as_ref() { + if let Some(rule) = self.use_valid_aria_props.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[25])); } } + if let Some(rule) = self.use_valid_aria_values.as_ref() { + if rule.is_disabled() { + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[26])); + } + } + if let Some(rule) = self.use_valid_lang.as_ref() { + if rule.is_disabled() { + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[27])); + } + } index_set } #[doc = r" Checks if, given a rule name, matches one of the rules contained in this category"] @@ -1061,10 +1123,10 @@ impl A11y { pub(crate) fn is_recommended_rule(rule_name: &str) -> bool { Self::RECOMMENDED_RULES.contains(&rule_name) } - pub(crate) fn recommended_rules_as_filters() -> [RuleFilter<'static>; 24] { + pub(crate) fn recommended_rules_as_filters() -> [RuleFilter<'static>; 28] { Self::RECOMMENDED_RULES_AS_FILTERS } - pub(crate) fn all_rules_as_filters() -> [RuleFilter<'static>; 26] { + pub(crate) fn all_rules_as_filters() -> [RuleFilter<'static>; 28] { Self::ALL_RULES_AS_FILTERS } #[doc = r" Select preset rules"] @@ -1093,6 +1155,9 @@ impl A11y { "noBlankTarget" => self.no_blank_target.as_ref(), "noDistractingElements" => self.no_distracting_elements.as_ref(), "noHeaderScope" => self.no_header_scope.as_ref(), + "noInteractiveElementToNoninteractiveRole" => { + self.no_interactive_element_to_noninteractive_role.as_ref() + } "noNoninteractiveElementToInteractiveRole" => { self.no_noninteractive_element_to_interactive_role.as_ref() } @@ -1103,6 +1168,9 @@ impl A11y { "noSvgWithoutTitle" => self.no_svg_without_title.as_ref(), "useAltText" => self.use_alt_text.as_ref(), "useAnchorContent" => self.use_anchor_content.as_ref(), + "useAriaActivedescendantWithTabindex" => { + self.use_aria_activedescendant_with_tabindex.as_ref() + } "useAriaPropsForRole" => self.use_aria_props_for_role.as_ref(), "useButtonType" => self.use_button_type.as_ref(), "useHeadingContent" => self.use_heading_content.as_ref(), @@ -1166,6 +1234,10 @@ pub struct Complexity { #[bpaf(long("no-static-only-class"), argument("on|off|warn"), optional, hide)] #[serde(skip_serializing_if = "Option::is_none")] pub no_static_only_class: Option, + #[doc = "Disallow this and super in static contexts."] + #[bpaf(long("no-this-in-static"), argument("on|off|warn"), optional, hide)] + #[serde(skip_serializing_if = "Option::is_none")] + pub no_this_in_static: Option, #[doc = "Disallow unnecessary catch clauses."] #[bpaf(long("no-useless-catch"), argument("on|off|warn"), optional, hide)] #[serde(skip_serializing_if = "Option::is_none")] @@ -1230,6 +1302,10 @@ pub struct Complexity { #[bpaf(long("no-with"), argument("on|off|warn"), optional, hide)] #[serde(skip_serializing_if = "Option::is_none")] pub no_with: Option, + #[doc = "Use arrow functions over function expressions."] + #[bpaf(long("use-arrow-function"), argument("on|off|warn"), optional, hide)] + #[serde(skip_serializing_if = "Option::is_none")] + pub use_arrow_function: Option, #[doc = "Promotes the use of .flatMap() when map().flat() are used together."] #[bpaf(long("use-flat-map"), argument("on|off|warn"), optional, hide)] #[serde(skip_serializing_if = "Option::is_none")] @@ -1284,6 +1360,9 @@ impl MergeWith for Complexity { if let Some(no_static_only_class) = other.no_static_only_class { self.no_static_only_class = Some(no_static_only_class); } + if let Some(no_this_in_static) = other.no_this_in_static { + self.no_this_in_static = Some(no_this_in_static); + } if let Some(no_useless_catch) = other.no_useless_catch { self.no_useless_catch = Some(no_useless_catch); } @@ -1317,6 +1396,9 @@ impl MergeWith for Complexity { if let Some(no_with) = other.no_with { self.no_with = Some(no_with); } + if let Some(use_arrow_function) = other.use_arrow_function { + self.use_arrow_function = Some(use_arrow_function); + } if let Some(use_flat_map) = other.use_flat_map { self.use_flat_map = Some(use_flat_map); } @@ -1344,13 +1426,14 @@ impl MergeWith for Complexity { } impl Complexity { const GROUP_NAME: &'static str = "complexity"; - pub(crate) const GROUP_RULES: [&'static str; 22] = [ + pub(crate) const GROUP_RULES: [&'static str; 24] = [ "noBannedTypes", "noExcessiveCognitiveComplexity", "noExtraBooleanCast", "noForEach", "noMultipleSpacesInRegularExpressionLiterals", "noStaticOnlyClass", + "noThisInStatic", "noUselessCatch", "noUselessConstructor", "noUselessEmptyExport", @@ -1362,18 +1445,20 @@ impl Complexity { "noUselessTypeConstraint", "noVoid", "noWith", + "useArrowFunction", "useFlatMap", "useLiteralKeys", "useOptionalChain", "useSimpleNumberKeys", "useSimplifiedLogicExpression", ]; - const RECOMMENDED_RULES: [&'static str; 18] = [ + const RECOMMENDED_RULES: [&'static str; 21] = [ "noBannedTypes", "noExtraBooleanCast", "noForEach", "noMultipleSpacesInRegularExpressionLiterals", "noStaticOnlyClass", + "noThisInStatic", "noUselessCatch", "noUselessConstructor", "noUselessEmptyExport", @@ -1384,11 +1469,13 @@ impl Complexity { "noUselessThisAlias", "noUselessTypeConstraint", "noWith", + "useArrowFunction", "useFlatMap", "useLiteralKeys", "useOptionalChain", + "useSimpleNumberKeys", ]; - const RECOMMENDED_RULES_AS_FILTERS: [RuleFilter<'static>; 18] = [ + const RECOMMENDED_RULES_AS_FILTERS: [RuleFilter<'static>; 21] = [ RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[0]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[2]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[3]), @@ -1403,12 +1490,15 @@ impl Complexity { RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[12]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[13]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[14]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[16]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[15]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[17]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[18]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[19]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[20]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[21]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[22]), ]; - const ALL_RULES_AS_FILTERS: [RuleFilter<'static>; 22] = [ + const ALL_RULES_AS_FILTERS: [RuleFilter<'static>; 24] = [ RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[0]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[1]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[2]), @@ -1431,6 +1521,8 @@ impl Complexity { RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[19]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[20]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[21]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[22]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[23]), ]; #[doc = r" Retrieves the recommended rules"] pub(crate) fn is_recommended(&self) -> bool { @@ -1480,86 +1572,96 @@ impl Complexity { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[5])); } } - if let Some(rule) = self.no_useless_catch.as_ref() { + if let Some(rule) = self.no_this_in_static.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[6])); } } - if let Some(rule) = self.no_useless_constructor.as_ref() { + if let Some(rule) = self.no_useless_catch.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[7])); } } - if let Some(rule) = self.no_useless_empty_export.as_ref() { + if let Some(rule) = self.no_useless_constructor.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[8])); } } - if let Some(rule) = self.no_useless_fragments.as_ref() { + if let Some(rule) = self.no_useless_empty_export.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[9])); } } - if let Some(rule) = self.no_useless_label.as_ref() { + if let Some(rule) = self.no_useless_fragments.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[10])); } } - if let Some(rule) = self.no_useless_rename.as_ref() { + if let Some(rule) = self.no_useless_label.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[11])); } } - if let Some(rule) = self.no_useless_switch_case.as_ref() { + if let Some(rule) = self.no_useless_rename.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[12])); } } - if let Some(rule) = self.no_useless_this_alias.as_ref() { + if let Some(rule) = self.no_useless_switch_case.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[13])); } } - if let Some(rule) = self.no_useless_type_constraint.as_ref() { + if let Some(rule) = self.no_useless_this_alias.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[14])); } } - if let Some(rule) = self.no_void.as_ref() { + if let Some(rule) = self.no_useless_type_constraint.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[15])); } } - if let Some(rule) = self.no_with.as_ref() { + if let Some(rule) = self.no_void.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[16])); } } - if let Some(rule) = self.use_flat_map.as_ref() { + if let Some(rule) = self.no_with.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[17])); } } - if let Some(rule) = self.use_literal_keys.as_ref() { + if let Some(rule) = self.use_arrow_function.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[18])); } } - if let Some(rule) = self.use_optional_chain.as_ref() { + if let Some(rule) = self.use_flat_map.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[19])); } } - if let Some(rule) = self.use_simple_number_keys.as_ref() { + if let Some(rule) = self.use_literal_keys.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[20])); } } - if let Some(rule) = self.use_simplified_logic_expression.as_ref() { + if let Some(rule) = self.use_optional_chain.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[21])); } } + if let Some(rule) = self.use_simple_number_keys.as_ref() { + if rule.is_enabled() { + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[22])); + } + } + if let Some(rule) = self.use_simplified_logic_expression.as_ref() { + if rule.is_enabled() { + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[23])); + } + } index_set } pub(crate) fn get_disabled_rules(&self) -> IndexSet { @@ -1597,100 +1699,110 @@ impl Complexity { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[5])); } } - if let Some(rule) = self.no_useless_catch.as_ref() { + if let Some(rule) = self.no_this_in_static.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[6])); } } - if let Some(rule) = self.no_useless_constructor.as_ref() { + if let Some(rule) = self.no_useless_catch.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[7])); } } - if let Some(rule) = self.no_useless_empty_export.as_ref() { + if let Some(rule) = self.no_useless_constructor.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[8])); } } - if let Some(rule) = self.no_useless_fragments.as_ref() { + if let Some(rule) = self.no_useless_empty_export.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[9])); } } - if let Some(rule) = self.no_useless_label.as_ref() { + if let Some(rule) = self.no_useless_fragments.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[10])); } } - if let Some(rule) = self.no_useless_rename.as_ref() { + if let Some(rule) = self.no_useless_label.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[11])); } } - if let Some(rule) = self.no_useless_switch_case.as_ref() { + if let Some(rule) = self.no_useless_rename.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[12])); } } - if let Some(rule) = self.no_useless_this_alias.as_ref() { + if let Some(rule) = self.no_useless_switch_case.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[13])); } } - if let Some(rule) = self.no_useless_type_constraint.as_ref() { + if let Some(rule) = self.no_useless_this_alias.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[14])); } } - if let Some(rule) = self.no_void.as_ref() { + if let Some(rule) = self.no_useless_type_constraint.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[15])); } } - if let Some(rule) = self.no_with.as_ref() { + if let Some(rule) = self.no_void.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[16])); } } - if let Some(rule) = self.use_flat_map.as_ref() { + if let Some(rule) = self.no_with.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[17])); } } - if let Some(rule) = self.use_literal_keys.as_ref() { + if let Some(rule) = self.use_arrow_function.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[18])); } } - if let Some(rule) = self.use_optional_chain.as_ref() { + if let Some(rule) = self.use_flat_map.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[19])); } } - if let Some(rule) = self.use_simple_number_keys.as_ref() { + if let Some(rule) = self.use_literal_keys.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[20])); } } - if let Some(rule) = self.use_simplified_logic_expression.as_ref() { + if let Some(rule) = self.use_optional_chain.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[21])); } } - index_set - } - #[doc = r" Checks if, given a rule name, matches one of the rules contained in this category"] - pub(crate) fn has_rule(rule_name: &str) -> bool { - Self::GROUP_RULES.contains(&rule_name) + if let Some(rule) = self.use_simple_number_keys.as_ref() { + if rule.is_disabled() { + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[22])); + } + } + if let Some(rule) = self.use_simplified_logic_expression.as_ref() { + if rule.is_disabled() { + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[23])); + } + } + index_set + } + #[doc = r" Checks if, given a rule name, matches one of the rules contained in this category"] + pub(crate) fn has_rule(rule_name: &str) -> bool { + Self::GROUP_RULES.contains(&rule_name) } #[doc = r" Checks if, given a rule name, it is marked as recommended"] pub(crate) fn is_recommended_rule(rule_name: &str) -> bool { Self::RECOMMENDED_RULES.contains(&rule_name) } - pub(crate) fn recommended_rules_as_filters() -> [RuleFilter<'static>; 18] { + pub(crate) fn recommended_rules_as_filters() -> [RuleFilter<'static>; 21] { Self::RECOMMENDED_RULES_AS_FILTERS } - pub(crate) fn all_rules_as_filters() -> [RuleFilter<'static>; 22] { + pub(crate) fn all_rules_as_filters() -> [RuleFilter<'static>; 24] { Self::ALL_RULES_AS_FILTERS } #[doc = r" Select preset rules"] @@ -1721,6 +1833,7 @@ impl Complexity { .no_multiple_spaces_in_regular_expression_literals .as_ref(), "noStaticOnlyClass" => self.no_static_only_class.as_ref(), + "noThisInStatic" => self.no_this_in_static.as_ref(), "noUselessCatch" => self.no_useless_catch.as_ref(), "noUselessConstructor" => self.no_useless_constructor.as_ref(), "noUselessEmptyExport" => self.no_useless_empty_export.as_ref(), @@ -1732,6 +1845,7 @@ impl Complexity { "noUselessTypeConstraint" => self.no_useless_type_constraint.as_ref(), "noVoid" => self.no_void.as_ref(), "noWith" => self.no_with.as_ref(), + "useArrowFunction" => self.use_arrow_function.as_ref(), "useFlatMap" => self.use_flat_map.as_ref(), "useLiteralKeys" => self.use_literal_keys.as_ref(), "useOptionalChain" => self.use_optional_chain.as_ref(), @@ -1770,6 +1884,15 @@ pub struct Correctness { #[bpaf(long("no-constructor-return"), argument("on|off|warn"), optional, hide)] #[serde(skip_serializing_if = "Option::is_none")] pub no_constructor_return: Option, + #[doc = "Disallow empty character classes in regular expression literals."] + #[bpaf( + long("no-empty-character-class-in-regex"), + argument("on|off|warn"), + optional, + hide + )] + #[serde(skip_serializing_if = "Option::is_none")] + pub no_empty_character_class_in_regex: Option, #[doc = "Disallows empty destructuring patterns."] #[bpaf(long("no-empty-pattern"), argument("on|off|warn"), optional, hide)] #[serde(skip_serializing_if = "Option::is_none")] @@ -1796,6 +1919,15 @@ pub struct Correctness { )] #[serde(skip_serializing_if = "Option::is_none")] pub no_invalid_constructor_super: Option, + #[doc = "Disallow new operators with global non-constructor functions."] + #[bpaf( + long("no-invalid-new-builtin"), + argument("on|off|warn"), + optional, + hide + )] + #[serde(skip_serializing_if = "Option::is_none")] + pub no_invalid_new_builtin: Option, #[doc = "Disallow new operators with the Symbol object."] #[bpaf(long("no-new-symbol"), argument("on|off|warn"), optional, hide)] #[serde(skip_serializing_if = "Option::is_none")] @@ -1953,6 +2085,9 @@ impl MergeWith for Correctness { if let Some(no_constructor_return) = other.no_constructor_return { self.no_constructor_return = Some(no_constructor_return); } + if let Some(no_empty_character_class_in_regex) = other.no_empty_character_class_in_regex { + self.no_empty_character_class_in_regex = Some(no_empty_character_class_in_regex); + } if let Some(no_empty_pattern) = other.no_empty_pattern { self.no_empty_pattern = Some(no_empty_pattern); } @@ -1965,6 +2100,9 @@ impl MergeWith for Correctness { if let Some(no_invalid_constructor_super) = other.no_invalid_constructor_super { self.no_invalid_constructor_super = Some(no_invalid_constructor_super); } + if let Some(no_invalid_new_builtin) = other.no_invalid_new_builtin { + self.no_invalid_new_builtin = Some(no_invalid_new_builtin); + } if let Some(no_new_symbol) = other.no_new_symbol { self.no_new_symbol = Some(no_new_symbol); } @@ -2046,15 +2184,17 @@ impl MergeWith for Correctness { } impl Correctness { const GROUP_NAME: &'static str = "correctness"; - pub(crate) const GROUP_RULES: [&'static str; 31] = [ + pub(crate) const GROUP_RULES: [&'static str; 33] = [ "noChildrenProp", "noConstAssign", "noConstantCondition", "noConstructorReturn", + "noEmptyCharacterClassInRegex", "noEmptyPattern", "noGlobalObjectCalls", "noInnerDeclarations", "noInvalidConstructorSuper", + "noInvalidNewBuiltin", "noNewSymbol", "noNonoctalDecimalEscape", "noPrecisionLoss", @@ -2079,16 +2219,17 @@ impl Correctness { "useValidForDirection", "useYield", ]; - const RECOMMENDED_RULES: [&'static str; 28] = [ + const RECOMMENDED_RULES: [&'static str; 29] = [ "noChildrenProp", "noConstAssign", "noConstantCondition", "noConstructorReturn", + "noEmptyCharacterClassInRegex", "noEmptyPattern", "noGlobalObjectCalls", "noInnerDeclarations", "noInvalidConstructorSuper", - "noNewSymbol", + "noInvalidNewBuiltin", "noNonoctalDecimalEscape", "noPrecisionLoss", "noRenderReturnValue", @@ -2109,7 +2250,7 @@ impl Correctness { "useValidForDirection", "useYield", ]; - const RECOMMENDED_RULES_AS_FILTERS: [RuleFilter<'static>; 28] = [ + const RECOMMENDED_RULES_AS_FILTERS: [RuleFilter<'static>; 29] = [ RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[0]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[1]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[2]), @@ -2120,26 +2261,27 @@ impl Correctness { RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[7]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[8]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[9]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[10]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[11]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[12]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[13]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[14]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[15]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[16]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[17]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[18]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[19]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[20]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[21]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[22]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[23]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[24]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[25]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[26]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[27]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[28]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[29]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[30]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[31]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[32]), ]; - const ALL_RULES_AS_FILTERS: [RuleFilter<'static>; 31] = [ + const ALL_RULES_AS_FILTERS: [RuleFilter<'static>; 33] = [ RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[0]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[1]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[2]), @@ -2171,6 +2313,8 @@ impl Correctness { RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[28]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[29]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[30]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[31]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[32]), ]; #[doc = r" Retrieves the recommended rules"] pub(crate) fn is_recommended(&self) -> bool { @@ -2207,141 +2351,151 @@ impl Correctness { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[3])); } } - if let Some(rule) = self.no_empty_pattern.as_ref() { + if let Some(rule) = self.no_empty_character_class_in_regex.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[4])); } } - if let Some(rule) = self.no_global_object_calls.as_ref() { + if let Some(rule) = self.no_empty_pattern.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[5])); } } - if let Some(rule) = self.no_inner_declarations.as_ref() { + if let Some(rule) = self.no_global_object_calls.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[6])); } } - if let Some(rule) = self.no_invalid_constructor_super.as_ref() { + if let Some(rule) = self.no_inner_declarations.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[7])); } } - if let Some(rule) = self.no_new_symbol.as_ref() { + if let Some(rule) = self.no_invalid_constructor_super.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[8])); } } - if let Some(rule) = self.no_nonoctal_decimal_escape.as_ref() { + if let Some(rule) = self.no_invalid_new_builtin.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[9])); } } - if let Some(rule) = self.no_precision_loss.as_ref() { + if let Some(rule) = self.no_new_symbol.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[10])); } } - if let Some(rule) = self.no_render_return_value.as_ref() { + if let Some(rule) = self.no_nonoctal_decimal_escape.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[11])); } } - if let Some(rule) = self.no_self_assign.as_ref() { + if let Some(rule) = self.no_precision_loss.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[12])); } } - if let Some(rule) = self.no_setter_return.as_ref() { + if let Some(rule) = self.no_render_return_value.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[13])); } } - if let Some(rule) = self.no_string_case_mismatch.as_ref() { + if let Some(rule) = self.no_self_assign.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[14])); } } - if let Some(rule) = self.no_switch_declarations.as_ref() { + if let Some(rule) = self.no_setter_return.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[15])); } } - if let Some(rule) = self.no_undeclared_variables.as_ref() { + if let Some(rule) = self.no_string_case_mismatch.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[16])); } } - if let Some(rule) = self.no_unnecessary_continue.as_ref() { + if let Some(rule) = self.no_switch_declarations.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[17])); } } - if let Some(rule) = self.no_unreachable.as_ref() { + if let Some(rule) = self.no_undeclared_variables.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[18])); } } - if let Some(rule) = self.no_unreachable_super.as_ref() { + if let Some(rule) = self.no_unnecessary_continue.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[19])); } } - if let Some(rule) = self.no_unsafe_finally.as_ref() { + if let Some(rule) = self.no_unreachable.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[20])); } } - if let Some(rule) = self.no_unsafe_optional_chaining.as_ref() { + if let Some(rule) = self.no_unreachable_super.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[21])); } } - if let Some(rule) = self.no_unused_labels.as_ref() { + if let Some(rule) = self.no_unsafe_finally.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[22])); } } - if let Some(rule) = self.no_unused_variables.as_ref() { + if let Some(rule) = self.no_unsafe_optional_chaining.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[23])); } } - if let Some(rule) = self.no_void_elements_with_children.as_ref() { + if let Some(rule) = self.no_unused_labels.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[24])); } } - if let Some(rule) = self.no_void_type_return.as_ref() { + if let Some(rule) = self.no_unused_variables.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[25])); } } - if let Some(rule) = self.use_exhaustive_dependencies.as_ref() { + if let Some(rule) = self.no_void_elements_with_children.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[26])); } } - if let Some(rule) = self.use_hook_at_top_level.as_ref() { + if let Some(rule) = self.no_void_type_return.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[27])); } } - if let Some(rule) = self.use_is_nan.as_ref() { + if let Some(rule) = self.use_exhaustive_dependencies.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[28])); } } - if let Some(rule) = self.use_valid_for_direction.as_ref() { + if let Some(rule) = self.use_hook_at_top_level.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[29])); } } - if let Some(rule) = self.use_yield.as_ref() { + if let Some(rule) = self.use_is_nan.as_ref() { if rule.is_enabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[30])); } } + if let Some(rule) = self.use_valid_for_direction.as_ref() { + if rule.is_enabled() { + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[31])); + } + } + if let Some(rule) = self.use_yield.as_ref() { + if rule.is_enabled() { + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[32])); + } + } index_set } pub(crate) fn get_disabled_rules(&self) -> IndexSet { @@ -2366,141 +2520,151 @@ impl Correctness { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[3])); } } - if let Some(rule) = self.no_empty_pattern.as_ref() { + if let Some(rule) = self.no_empty_character_class_in_regex.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[4])); } } - if let Some(rule) = self.no_global_object_calls.as_ref() { + if let Some(rule) = self.no_empty_pattern.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[5])); } } - if let Some(rule) = self.no_inner_declarations.as_ref() { + if let Some(rule) = self.no_global_object_calls.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[6])); } } - if let Some(rule) = self.no_invalid_constructor_super.as_ref() { + if let Some(rule) = self.no_inner_declarations.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[7])); } } - if let Some(rule) = self.no_new_symbol.as_ref() { + if let Some(rule) = self.no_invalid_constructor_super.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[8])); } } - if let Some(rule) = self.no_nonoctal_decimal_escape.as_ref() { + if let Some(rule) = self.no_invalid_new_builtin.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[9])); } } - if let Some(rule) = self.no_precision_loss.as_ref() { + if let Some(rule) = self.no_new_symbol.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[10])); } } - if let Some(rule) = self.no_render_return_value.as_ref() { + if let Some(rule) = self.no_nonoctal_decimal_escape.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[11])); } } - if let Some(rule) = self.no_self_assign.as_ref() { + if let Some(rule) = self.no_precision_loss.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[12])); } } - if let Some(rule) = self.no_setter_return.as_ref() { + if let Some(rule) = self.no_render_return_value.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[13])); } } - if let Some(rule) = self.no_string_case_mismatch.as_ref() { + if let Some(rule) = self.no_self_assign.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[14])); } } - if let Some(rule) = self.no_switch_declarations.as_ref() { + if let Some(rule) = self.no_setter_return.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[15])); } } - if let Some(rule) = self.no_undeclared_variables.as_ref() { + if let Some(rule) = self.no_string_case_mismatch.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[16])); } } - if let Some(rule) = self.no_unnecessary_continue.as_ref() { + if let Some(rule) = self.no_switch_declarations.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[17])); } } - if let Some(rule) = self.no_unreachable.as_ref() { + if let Some(rule) = self.no_undeclared_variables.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[18])); } } - if let Some(rule) = self.no_unreachable_super.as_ref() { + if let Some(rule) = self.no_unnecessary_continue.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[19])); } } - if let Some(rule) = self.no_unsafe_finally.as_ref() { + if let Some(rule) = self.no_unreachable.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[20])); } } - if let Some(rule) = self.no_unsafe_optional_chaining.as_ref() { + if let Some(rule) = self.no_unreachable_super.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[21])); } } - if let Some(rule) = self.no_unused_labels.as_ref() { + if let Some(rule) = self.no_unsafe_finally.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[22])); } } - if let Some(rule) = self.no_unused_variables.as_ref() { + if let Some(rule) = self.no_unsafe_optional_chaining.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[23])); } } - if let Some(rule) = self.no_void_elements_with_children.as_ref() { + if let Some(rule) = self.no_unused_labels.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[24])); } } - if let Some(rule) = self.no_void_type_return.as_ref() { + if let Some(rule) = self.no_unused_variables.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[25])); } } - if let Some(rule) = self.use_exhaustive_dependencies.as_ref() { + if let Some(rule) = self.no_void_elements_with_children.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[26])); } } - if let Some(rule) = self.use_hook_at_top_level.as_ref() { + if let Some(rule) = self.no_void_type_return.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[27])); } } - if let Some(rule) = self.use_is_nan.as_ref() { + if let Some(rule) = self.use_exhaustive_dependencies.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[28])); } } - if let Some(rule) = self.use_valid_for_direction.as_ref() { + if let Some(rule) = self.use_hook_at_top_level.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[29])); } } - if let Some(rule) = self.use_yield.as_ref() { + if let Some(rule) = self.use_is_nan.as_ref() { if rule.is_disabled() { index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[30])); } } + if let Some(rule) = self.use_valid_for_direction.as_ref() { + if rule.is_disabled() { + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[31])); + } + } + if let Some(rule) = self.use_yield.as_ref() { + if rule.is_disabled() { + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[32])); + } + } index_set } #[doc = r" Checks if, given a rule name, matches one of the rules contained in this category"] @@ -2511,10 +2675,10 @@ impl Correctness { pub(crate) fn is_recommended_rule(rule_name: &str) -> bool { Self::RECOMMENDED_RULES.contains(&rule_name) } - pub(crate) fn recommended_rules_as_filters() -> [RuleFilter<'static>; 28] { + pub(crate) fn recommended_rules_as_filters() -> [RuleFilter<'static>; 29] { Self::RECOMMENDED_RULES_AS_FILTERS } - pub(crate) fn all_rules_as_filters() -> [RuleFilter<'static>; 31] { + pub(crate) fn all_rules_as_filters() -> [RuleFilter<'static>; 33] { Self::ALL_RULES_AS_FILTERS } #[doc = r" Select preset rules"] @@ -2541,10 +2705,12 @@ impl Correctness { "noConstAssign" => self.no_const_assign.as_ref(), "noConstantCondition" => self.no_constant_condition.as_ref(), "noConstructorReturn" => self.no_constructor_return.as_ref(), + "noEmptyCharacterClassInRegex" => self.no_empty_character_class_in_regex.as_ref(), "noEmptyPattern" => self.no_empty_pattern.as_ref(), "noGlobalObjectCalls" => self.no_global_object_calls.as_ref(), "noInnerDeclarations" => self.no_inner_declarations.as_ref(), "noInvalidConstructorSuper" => self.no_invalid_constructor_super.as_ref(), + "noInvalidNewBuiltin" => self.no_invalid_new_builtin.as_ref(), "noNewSymbol" => self.no_new_symbol.as_ref(), "noNonoctalDecimalEscape" => self.no_nonoctal_decimal_escape.as_ref(), "noPrecisionLoss" => self.no_precision_loss.as_ref(), @@ -2585,15 +2751,6 @@ pub struct Nursery { #[serde(skip_serializing_if = "Option::is_none")] #[bpaf(hide)] pub all: Option, - #[doc = "Usually, the definition in the standard library is more precise than what people come up with or the used constant exceeds the maximum precision of the number type."] - #[bpaf( - long("no-approximative-numeric-constant"), - argument("on|off|warn"), - optional, - hide - )] - #[serde(skip_serializing_if = "Option::is_none")] - pub no_approximative_numeric_constant: Option, #[doc = "Enforce that aria-hidden=\"true\" is not set on focusable elements."] #[bpaf( long("no-aria-hidden-on-focusable"), @@ -2625,59 +2782,10 @@ pub struct Nursery { )] #[serde(skip_serializing_if = "Option::is_none")] pub no_empty_block_statements: Option, - #[doc = "Disallow empty character classes in regular expression literals."] - #[bpaf( - long("no-empty-character-class-in-regex"), - argument("on|off|warn"), - optional, - hide - )] - #[serde(skip_serializing_if = "Option::is_none")] - pub no_empty_character_class_in_regex: Option, #[doc = "Disallow use of implicit any type on variable declarations."] #[bpaf(long("no-implicit-any-let"), argument("on|off|warn"), optional, hide)] #[serde(skip_serializing_if = "Option::is_none")] pub no_implicit_any_let: Option, - #[doc = "Enforce that non-interactive ARIA roles are not assigned to interactive HTML elements."] - #[bpaf( - long("no-interactive-element-to-noninteractive-role"), - argument("on|off|warn"), - optional, - hide - )] - #[serde(skip_serializing_if = "Option::is_none")] - pub no_interactive_element_to_noninteractive_role: Option, - #[doc = "Disallow new operators with global non-constructor functions."] - #[bpaf( - long("no-invalid-new-builtin"), - argument("on|off|warn"), - optional, - hide - )] - #[serde(skip_serializing_if = "Option::is_none")] - pub no_invalid_new_builtin: Option, - #[doc = "Enforce proper usage of new and constructor."] - #[bpaf( - long("no-misleading-instantiator"), - argument("on|off|warn"), - optional, - hide - )] - #[serde(skip_serializing_if = "Option::is_none")] - pub no_misleading_instantiator: Option, - #[doc = "Disallow shorthand assign when variable appears on both sides."] - #[bpaf( - long("no-misrefactored-shorthand-assign"), - argument("on|off|warn"), - optional, - hide - )] - #[serde(skip_serializing_if = "Option::is_none")] - pub no_misrefactored_shorthand_assign: Option, - #[doc = "Disallow this and super in static contexts."] - #[bpaf(long("no-this-in-static"), argument("on|off|warn"), optional, hide)] - #[serde(skip_serializing_if = "Option::is_none")] - pub no_this_in_static: Option, #[doc = "Disallow unused imports."] #[bpaf(long("no-unused-imports"), argument("on|off|warn"), optional, hide)] #[serde(skip_serializing_if = "Option::is_none")] @@ -2691,10 +2799,6 @@ pub struct Nursery { )] #[serde(skip_serializing_if = "Option::is_none")] pub no_unused_private_class_members: Option, - #[doc = "Disallow else block when the if block breaks early."] - #[bpaf(long("no-useless-else"), argument("on|off|warn"), optional, hide)] - #[serde(skip_serializing_if = "Option::is_none")] - pub no_useless_else: Option, #[doc = "Disallow unnecessary nested block statements."] #[bpaf( long("no-useless-lone-block-statements"), @@ -2704,28 +2808,6 @@ pub struct Nursery { )] #[serde(skip_serializing_if = "Option::is_none")] pub no_useless_lone_block_statements: Option, - #[doc = "Enforce that tabIndex is assigned to non-interactive HTML elements with aria-activedescendant."] - #[bpaf( - long("use-aria-activedescendant-with-tabindex"), - argument("on|off|warn"), - optional, - hide - )] - #[serde(skip_serializing_if = "Option::is_none")] - pub use_aria_activedescendant_with_tabindex: Option, - #[doc = "Use arrow functions over function expressions."] - #[bpaf(long("use-arrow-function"), argument("on|off|warn"), optional, hide)] - #[serde(skip_serializing_if = "Option::is_none")] - pub use_arrow_function: Option, - #[doc = "Enforce the use of as const over literal type and type annotation."] - #[bpaf( - long("use-as-const-assertion"), - argument("on|off|warn"), - optional, - hide - )] - #[serde(skip_serializing_if = "Option::is_none")] - pub use_as_const_assertion: Option, #[doc = "Ensure async functions utilize await."] #[bpaf(long("use-await"), argument("on|off|warn"), optional, hide)] #[serde(skip_serializing_if = "Option::is_none")] @@ -2752,10 +2834,6 @@ pub struct Nursery { #[bpaf(long("use-regex-literals"), argument("on|off|warn"), optional, hide)] #[serde(skip_serializing_if = "Option::is_none")] pub use_regex_literals: Option, - #[doc = "Require assignment operator shorthand where possible."] - #[bpaf(long("use-shorthand-assign"), argument("on|off|warn"), optional, hide)] - #[serde(skip_serializing_if = "Option::is_none")] - pub use_shorthand_assign: Option, #[doc = "Elements with ARIA roles must use a valid, non-abstract ARIA role."] #[bpaf(long("use-valid-aria-role"), argument("on|off|warn"), optional, hide)] #[serde(skip_serializing_if = "Option::is_none")] @@ -2763,9 +2841,6 @@ pub struct Nursery { } impl MergeWith for Nursery { fn merge_with(&mut self, other: Nursery) { - if let Some(no_approximative_numeric_constant) = other.no_approximative_numeric_constant { - self.no_approximative_numeric_constant = Some(no_approximative_numeric_constant); - } if let Some(no_aria_hidden_on_focusable) = other.no_aria_hidden_on_focusable { self.no_aria_hidden_on_focusable = Some(no_aria_hidden_on_focusable); } @@ -2778,54 +2853,18 @@ impl MergeWith for Nursery { if let Some(no_empty_block_statements) = other.no_empty_block_statements { self.no_empty_block_statements = Some(no_empty_block_statements); } - if let Some(no_empty_character_class_in_regex) = other.no_empty_character_class_in_regex { - self.no_empty_character_class_in_regex = Some(no_empty_character_class_in_regex); - } if let Some(no_implicit_any_let) = other.no_implicit_any_let { self.no_implicit_any_let = Some(no_implicit_any_let); } - if let Some(no_interactive_element_to_noninteractive_role) = - other.no_interactive_element_to_noninteractive_role - { - self.no_interactive_element_to_noninteractive_role = - Some(no_interactive_element_to_noninteractive_role); - } - if let Some(no_invalid_new_builtin) = other.no_invalid_new_builtin { - self.no_invalid_new_builtin = Some(no_invalid_new_builtin); - } - if let Some(no_misleading_instantiator) = other.no_misleading_instantiator { - self.no_misleading_instantiator = Some(no_misleading_instantiator); - } - if let Some(no_misrefactored_shorthand_assign) = other.no_misrefactored_shorthand_assign { - self.no_misrefactored_shorthand_assign = Some(no_misrefactored_shorthand_assign); - } - if let Some(no_this_in_static) = other.no_this_in_static { - self.no_this_in_static = Some(no_this_in_static); - } if let Some(no_unused_imports) = other.no_unused_imports { self.no_unused_imports = Some(no_unused_imports); } if let Some(no_unused_private_class_members) = other.no_unused_private_class_members { self.no_unused_private_class_members = Some(no_unused_private_class_members); } - if let Some(no_useless_else) = other.no_useless_else { - self.no_useless_else = Some(no_useless_else); - } if let Some(no_useless_lone_block_statements) = other.no_useless_lone_block_statements { self.no_useless_lone_block_statements = Some(no_useless_lone_block_statements); } - if let Some(use_aria_activedescendant_with_tabindex) = - other.use_aria_activedescendant_with_tabindex - { - self.use_aria_activedescendant_with_tabindex = - Some(use_aria_activedescendant_with_tabindex); - } - if let Some(use_arrow_function) = other.use_arrow_function { - self.use_arrow_function = Some(use_arrow_function); - } - if let Some(use_as_const_assertion) = other.use_as_const_assertion { - self.use_as_const_assertion = Some(use_as_const_assertion); - } if let Some(use_await) = other.use_await { self.use_await = Some(use_await); } @@ -2838,9 +2877,6 @@ impl MergeWith for Nursery { if let Some(use_regex_literals) = other.use_regex_literals { self.use_regex_literals = Some(use_regex_literals); } - if let Some(use_shorthand_assign) = other.use_shorthand_assign { - self.use_shorthand_assign = Some(use_shorthand_assign); - } if let Some(use_valid_aria_role) = other.use_valid_aria_role { self.use_valid_aria_role = Some(use_valid_aria_role); } @@ -2856,62 +2892,38 @@ impl MergeWith for Nursery { } impl Nursery { const GROUP_NAME: &'static str = "nursery"; - pub(crate) const GROUP_RULES: [&'static str; 25] = [ - "noApproximativeNumericConstant", + pub(crate) const GROUP_RULES: [&'static str; 13] = [ "noAriaHiddenOnFocusable", "noDefaultExport", "noDuplicateJsonKeys", "noEmptyBlockStatements", - "noEmptyCharacterClassInRegex", "noImplicitAnyLet", - "noInteractiveElementToNoninteractiveRole", - "noInvalidNewBuiltin", - "noMisleadingInstantiator", - "noMisrefactoredShorthandAssign", - "noThisInStatic", "noUnusedImports", "noUnusedPrivateClassMembers", - "noUselessElse", "noUselessLoneBlockStatements", - "useAriaActivedescendantWithTabindex", - "useArrowFunction", - "useAsConstAssertion", "useAwait", "useGroupedTypeImport", "useImportRestrictions", "useRegexLiterals", - "useShorthandAssign", "useValidAriaRole", ]; - const RECOMMENDED_RULES: [&'static str; 12] = [ + const RECOMMENDED_RULES: [&'static str; 6] = [ "noAriaHiddenOnFocusable", "noDuplicateJsonKeys", - "noEmptyCharacterClassInRegex", "noImplicitAnyLet", - "noInvalidNewBuiltin", - "noMisleadingInstantiator", - "noUselessElse", - "useArrowFunction", - "useAsConstAssertion", "useAwait", "useGroupedTypeImport", "useValidAriaRole", ]; - const RECOMMENDED_RULES_AS_FILTERS: [RuleFilter<'static>; 12] = [ - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[1]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[3]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[5]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[6]), + const RECOMMENDED_RULES_AS_FILTERS: [RuleFilter<'static>; 6] = [ + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[0]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[2]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[4]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[8]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[9]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[14]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[17]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[18]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[19]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[20]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[24]), + RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[12]), ]; - const ALL_RULES_AS_FILTERS: [RuleFilter<'static>; 25] = [ + const ALL_RULES_AS_FILTERS: [RuleFilter<'static>; 13] = [ RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[0]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[1]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[2]), @@ -2925,18 +2937,6 @@ impl Nursery { RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[10]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[11]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[12]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[13]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[14]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[15]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[16]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[17]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[18]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[19]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[20]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[21]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[22]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[23]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[24]), ]; #[doc = r" Retrieves the recommended rules"] pub(crate) fn is_recommended(&self) -> bool { @@ -2953,258 +2953,138 @@ impl Nursery { } pub(crate) fn get_enabled_rules(&self) -> IndexSet { let mut index_set = IndexSet::new(); - if let Some(rule) = self.no_approximative_numeric_constant.as_ref() { - if rule.is_enabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[0])); - } - } if let Some(rule) = self.no_aria_hidden_on_focusable.as_ref() { if rule.is_enabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[1])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[0])); } } if let Some(rule) = self.no_default_export.as_ref() { if rule.is_enabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[2])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[1])); } } if let Some(rule) = self.no_duplicate_json_keys.as_ref() { if rule.is_enabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[3])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[2])); } } if let Some(rule) = self.no_empty_block_statements.as_ref() { if rule.is_enabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[4])); - } - } - if let Some(rule) = self.no_empty_character_class_in_regex.as_ref() { - if rule.is_enabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[5])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[3])); } } if let Some(rule) = self.no_implicit_any_let.as_ref() { if rule.is_enabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[6])); - } - } - if let Some(rule) = self.no_interactive_element_to_noninteractive_role.as_ref() { - if rule.is_enabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[7])); - } - } - if let Some(rule) = self.no_invalid_new_builtin.as_ref() { - if rule.is_enabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[8])); - } - } - if let Some(rule) = self.no_misleading_instantiator.as_ref() { - if rule.is_enabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[9])); - } - } - if let Some(rule) = self.no_misrefactored_shorthand_assign.as_ref() { - if rule.is_enabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[10])); - } - } - if let Some(rule) = self.no_this_in_static.as_ref() { - if rule.is_enabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[11])); - } - } - if let Some(rule) = self.no_unused_imports.as_ref() { - if rule.is_enabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[12])); - } - } - if let Some(rule) = self.no_unused_private_class_members.as_ref() { - if rule.is_enabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[13])); - } - } - if let Some(rule) = self.no_useless_else.as_ref() { - if rule.is_enabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[14])); - } - } - if let Some(rule) = self.no_useless_lone_block_statements.as_ref() { - if rule.is_enabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[15])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[4])); } } - if let Some(rule) = self.use_aria_activedescendant_with_tabindex.as_ref() { + if let Some(rule) = self.no_unused_imports.as_ref() { if rule.is_enabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[16])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[5])); } } - if let Some(rule) = self.use_arrow_function.as_ref() { + if let Some(rule) = self.no_unused_private_class_members.as_ref() { if rule.is_enabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[17])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[6])); } } - if let Some(rule) = self.use_as_const_assertion.as_ref() { + if let Some(rule) = self.no_useless_lone_block_statements.as_ref() { if rule.is_enabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[18])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[7])); } } if let Some(rule) = self.use_await.as_ref() { if rule.is_enabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[19])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[8])); } } if let Some(rule) = self.use_grouped_type_import.as_ref() { if rule.is_enabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[20])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[9])); } } if let Some(rule) = self.use_import_restrictions.as_ref() { if rule.is_enabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[21])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[10])); } } if let Some(rule) = self.use_regex_literals.as_ref() { if rule.is_enabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[22])); - } - } - if let Some(rule) = self.use_shorthand_assign.as_ref() { - if rule.is_enabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[23])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[11])); } } if let Some(rule) = self.use_valid_aria_role.as_ref() { if rule.is_enabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[24])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[12])); } } index_set } pub(crate) fn get_disabled_rules(&self) -> IndexSet { let mut index_set = IndexSet::new(); - if let Some(rule) = self.no_approximative_numeric_constant.as_ref() { - if rule.is_disabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[0])); - } - } if let Some(rule) = self.no_aria_hidden_on_focusable.as_ref() { if rule.is_disabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[1])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[0])); } } if let Some(rule) = self.no_default_export.as_ref() { if rule.is_disabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[2])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[1])); } } if let Some(rule) = self.no_duplicate_json_keys.as_ref() { if rule.is_disabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[3])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[2])); } } if let Some(rule) = self.no_empty_block_statements.as_ref() { if rule.is_disabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[4])); - } - } - if let Some(rule) = self.no_empty_character_class_in_regex.as_ref() { - if rule.is_disabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[5])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[3])); } } if let Some(rule) = self.no_implicit_any_let.as_ref() { if rule.is_disabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[6])); - } - } - if let Some(rule) = self.no_interactive_element_to_noninteractive_role.as_ref() { - if rule.is_disabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[7])); - } - } - if let Some(rule) = self.no_invalid_new_builtin.as_ref() { - if rule.is_disabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[8])); - } - } - if let Some(rule) = self.no_misleading_instantiator.as_ref() { - if rule.is_disabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[9])); - } - } - if let Some(rule) = self.no_misrefactored_shorthand_assign.as_ref() { - if rule.is_disabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[10])); - } - } - if let Some(rule) = self.no_this_in_static.as_ref() { - if rule.is_disabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[11])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[4])); } } if let Some(rule) = self.no_unused_imports.as_ref() { if rule.is_disabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[12])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[5])); } } if let Some(rule) = self.no_unused_private_class_members.as_ref() { if rule.is_disabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[13])); - } - } - if let Some(rule) = self.no_useless_else.as_ref() { - if rule.is_disabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[14])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[6])); } } if let Some(rule) = self.no_useless_lone_block_statements.as_ref() { if rule.is_disabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[15])); - } - } - if let Some(rule) = self.use_aria_activedescendant_with_tabindex.as_ref() { - if rule.is_disabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[16])); - } - } - if let Some(rule) = self.use_arrow_function.as_ref() { - if rule.is_disabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[17])); - } - } - if let Some(rule) = self.use_as_const_assertion.as_ref() { - if rule.is_disabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[18])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[7])); } } if let Some(rule) = self.use_await.as_ref() { if rule.is_disabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[19])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[8])); } } if let Some(rule) = self.use_grouped_type_import.as_ref() { if rule.is_disabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[20])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[9])); } } if let Some(rule) = self.use_import_restrictions.as_ref() { if rule.is_disabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[21])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[10])); } } if let Some(rule) = self.use_regex_literals.as_ref() { if rule.is_disabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[22])); - } - } - if let Some(rule) = self.use_shorthand_assign.as_ref() { - if rule.is_disabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[23])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[11])); } } if let Some(rule) = self.use_valid_aria_role.as_ref() { if rule.is_disabled() { - index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[24])); + index_set.insert(RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[12])); } } index_set @@ -3217,10 +3097,10 @@ impl Nursery { pub(crate) fn is_recommended_rule(rule_name: &str) -> bool { Self::RECOMMENDED_RULES.contains(&rule_name) } - pub(crate) fn recommended_rules_as_filters() -> [RuleFilter<'static>; 12] { + pub(crate) fn recommended_rules_as_filters() -> [RuleFilter<'static>; 6] { Self::RECOMMENDED_RULES_AS_FILTERS } - pub(crate) fn all_rules_as_filters() -> [RuleFilter<'static>; 25] { + pub(crate) fn all_rules_as_filters() -> [RuleFilter<'static>; 13] { Self::ALL_RULES_AS_FILTERS } #[doc = r" Select preset rules"] @@ -3243,34 +3123,18 @@ impl Nursery { } pub(crate) fn get_rule_configuration(&self, rule_name: &str) -> Option<&RuleConfiguration> { match rule_name { - "noApproximativeNumericConstant" => self.no_approximative_numeric_constant.as_ref(), "noAriaHiddenOnFocusable" => self.no_aria_hidden_on_focusable.as_ref(), "noDefaultExport" => self.no_default_export.as_ref(), "noDuplicateJsonKeys" => self.no_duplicate_json_keys.as_ref(), "noEmptyBlockStatements" => self.no_empty_block_statements.as_ref(), - "noEmptyCharacterClassInRegex" => self.no_empty_character_class_in_regex.as_ref(), "noImplicitAnyLet" => self.no_implicit_any_let.as_ref(), - "noInteractiveElementToNoninteractiveRole" => { - self.no_interactive_element_to_noninteractive_role.as_ref() - } - "noInvalidNewBuiltin" => self.no_invalid_new_builtin.as_ref(), - "noMisleadingInstantiator" => self.no_misleading_instantiator.as_ref(), - "noMisrefactoredShorthandAssign" => self.no_misrefactored_shorthand_assign.as_ref(), - "noThisInStatic" => self.no_this_in_static.as_ref(), "noUnusedImports" => self.no_unused_imports.as_ref(), "noUnusedPrivateClassMembers" => self.no_unused_private_class_members.as_ref(), - "noUselessElse" => self.no_useless_else.as_ref(), "noUselessLoneBlockStatements" => self.no_useless_lone_block_statements.as_ref(), - "useAriaActivedescendantWithTabindex" => { - self.use_aria_activedescendant_with_tabindex.as_ref() - } - "useArrowFunction" => self.use_arrow_function.as_ref(), - "useAsConstAssertion" => self.use_as_const_assertion.as_ref(), "useAwait" => self.use_await.as_ref(), "useGroupedTypeImport" => self.use_grouped_type_import.as_ref(), "useImportRestrictions" => self.use_import_restrictions.as_ref(), "useRegexLiterals" => self.use_regex_literals.as_ref(), - "useShorthandAssign" => self.use_shorthand_assign.as_ref(), "useValidAriaRole" => self.use_valid_aria_role.as_ref(), _ => None, } @@ -3639,10 +3503,23 @@ pub struct Style { )] #[serde(skip_serializing_if = "Option::is_none")] pub no_unused_template_literal: Option, + #[doc = "Disallow else block when the if block breaks early."] + #[bpaf(long("no-useless-else"), argument("on|off|warn"), optional, hide)] + #[serde(skip_serializing_if = "Option::is_none")] + pub no_useless_else: Option, #[doc = "Disallow the use of var"] #[bpaf(long("no-var"), argument("on|off|warn"), optional, hide)] #[serde(skip_serializing_if = "Option::is_none")] pub no_var: Option, + #[doc = "Enforce the use of as const over literal type and type annotation."] + #[bpaf( + long("use-as-const-assertion"), + argument("on|off|warn"), + optional, + hide + )] + #[serde(skip_serializing_if = "Option::is_none")] + pub use_as_const_assertion: Option, #[doc = "Requires following curly brace conventions."] #[bpaf(long("use-block-statements"), argument("on|off|warn"), optional, hide)] #[serde(skip_serializing_if = "Option::is_none")] @@ -3716,6 +3593,10 @@ pub struct Style { )] #[serde(skip_serializing_if = "Option::is_none")] pub use_shorthand_array_type: Option, + #[doc = "Require assignment operator shorthand where possible."] + #[bpaf(long("use-shorthand-assign"), argument("on|off|warn"), optional, hide)] + #[serde(skip_serializing_if = "Option::is_none")] + pub use_shorthand_assign: Option, #[doc = "Enforces switch clauses have a single statement, emits a quick fix wrapping the statements in a block."] #[bpaf( long("use-single-case-statement"), @@ -3781,9 +3662,15 @@ impl MergeWith