Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lint): rename noSemicolonInJsx to noSuspiciousSemicolonInJsx #2220

Merged
merged 4 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b

- Add rule [noEvolvingAny](https://biomejs.dev/linter/rules/no-evolving-any) to disallow variables from evolving into `any` type through reassignments. Contributed by @fujiyamaorange

#### Enhancements

- Rename `noSemicolonInJsx` to `noSuspiciousSemicolonInJsx`. Contributed by @fujiyamaorange

### LSP

#### Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_diagnostics_categories/src/categories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ define_categories! {
"lint/nursery/noNodejsModules": "https://biomejs.dev/linter/rules/no-nodejs-modules",
"lint/nursery/noReExportAll": "https://biomejs.dev/linter/rules/no-re-export-all",
"lint/nursery/noRestrictedImports": "https://biomejs.dev/linter/rules/no-restricted-imports",
"lint/nursery/noSemicolonInJsx": "https://biomejs.dev/linter/rules/no-semicolons-in-jsx",
"lint/nursery/noSkippedTests": "https://biomejs.dev/linter/rules/no-skipped-tests",
"lint/nursery/noSuspiciousSemicolonInJsx": "https://biomejs.dev/linter/rules/no-suspicious-semicolon-in-jsx",
"lint/nursery/noTypeOnlyImportAttributes": "https://biomejs.dev/linter/rules/no-type-only-import-attributes",
"lint/nursery/noUndeclaredDependencies": "https://biomejs.dev/linter/rules/no-undeclared-dependencies",
"lint/nursery/noUselessTernary": "https://biomejs.dev/linter/rules/no-useless-ternary",
Expand Down
4 changes: 2 additions & 2 deletions crates/biome_js_analyze/src/lint/nursery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ pub mod no_namespace_import;
pub mod no_nodejs_modules;
pub mod no_re_export_all;
pub mod no_restricted_imports;
pub mod no_semicolon_in_jsx;
pub mod no_skipped_tests;
pub mod no_suspicious_semicolon_in_jsx;
pub mod no_undeclared_dependencies;
pub mod no_useless_ternary;
pub mod use_import_restrictions;
Expand All @@ -43,8 +43,8 @@ declare_group! {
self :: no_nodejs_modules :: NoNodejsModules ,
self :: no_re_export_all :: NoReExportAll ,
self :: no_restricted_imports :: NoRestrictedImports ,
self :: no_semicolon_in_jsx :: NoSemicolonInJsx ,
self :: no_skipped_tests :: NoSkippedTests ,
self :: no_suspicious_semicolon_in_jsx :: NoSuspiciousSemicolonInJsx ,
self :: no_undeclared_dependencies :: NoUndeclaredDependencies ,
self :: no_useless_ternary :: NoUselessTernary ,
self :: use_import_restrictions :: UseImportRestrictions ,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ declare_rule! {
/// }
/// ```
///
pub NoSemicolonInJsx {
version: "1.6.0",
name: "noSemicolonInJsx",
pub NoSuspiciousSemicolonInJsx {
version: "next",
name: "noSuspiciousSemicolonInJsx",
recommended: true,
}
}

impl Rule for NoSemicolonInJsx {
impl Rule for NoSuspiciousSemicolonInJsx {
type Query = Ast<AnyJsxElement>;
type State = TextRange;
type Signals = Option<Self::State>;
Expand Down
3 changes: 1 addition & 2 deletions crates/biome_js_analyze/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,6 @@ pub type NoSelfAssign =
<lint::correctness::no_self_assign::NoSelfAssign as biome_analyze::Rule>::Options;
pub type NoSelfCompare =
<lint::suspicious::no_self_compare::NoSelfCompare as biome_analyze::Rule>::Options;
pub type NoSemicolonInJsx =
<lint::nursery::no_semicolon_in_jsx::NoSemicolonInJsx as biome_analyze::Rule>::Options;
pub type NoSetterReturn =
<lint::correctness::no_setter_return::NoSetterReturn as biome_analyze::Rule>::Options;
pub type NoShadowRestrictedNames = < lint :: suspicious :: no_shadow_restricted_names :: NoShadowRestrictedNames as biome_analyze :: Rule > :: Options ;
Expand All @@ -182,6 +180,7 @@ pub type NoSparseArray =
pub type NoStaticOnlyClass =
<lint::complexity::no_static_only_class::NoStaticOnlyClass as biome_analyze::Rule>::Options;
pub type NoStringCaseMismatch = < lint :: correctness :: no_string_case_mismatch :: NoStringCaseMismatch as biome_analyze :: Rule > :: Options ;
pub type NoSuspiciousSemicolonInJsx = < lint :: nursery :: no_suspicious_semicolon_in_jsx :: NoSuspiciousSemicolonInJsx as biome_analyze :: Rule > :: Options ;
pub type NoSvgWithoutTitle =
<lint::a11y::no_svg_without_title::NoSvgWithoutTitle as biome_analyze::Rule>::Options;
pub type NoSwitchDeclarations = < lint :: correctness :: no_switch_declarations :: NoSwitchDeclarations as biome_analyze :: Rule > :: Options ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const Component3 = () => (

# Diagnostics
```
invalid.jsx:4:18 lint/nursery/noSemicolonInJsx ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.jsx:4:18 lint/nursery/noSuspiciousSemicolonInJsx ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

! There is a suspicious semicolon in the JSX element.

Expand All @@ -53,7 +53,7 @@ invalid.jsx:4:18 lint/nursery/noSemicolonInJsx ━━━━━━━━━━━
```

```
invalid.jsx:14:23 lint/nursery/noSemicolonInJsx ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.jsx:14:23 lint/nursery/noSuspiciousSemicolonInJsx ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

! There is a suspicious semicolon in the JSX element.

Expand All @@ -74,7 +74,7 @@ invalid.jsx:14:23 lint/nursery/noSemicolonInJsx ━━━━━━━━━━
```

```
invalid.jsx:21:22 lint/nursery/noSemicolonInJsx ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
invalid.jsx:21:22 lint/nursery/noSuspiciousSemicolonInJsx ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

! There is a suspicious semicolon in the JSX element.

Expand Down
28 changes: 14 additions & 14 deletions crates/biome_service/src/configuration/linter/rules.rs

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

10 changes: 5 additions & 5 deletions packages/@biomejs/backend-jsonrpc/src/workspace.ts

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

8 changes: 4 additions & 4 deletions packages/@biomejs/biome/configuration_schema.json

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

4 changes: 4 additions & 0 deletions website/src/content/docs/internals/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b

- Add rule [noEvolvingAny](https://biomejs.dev/linter/rules/no-evolving-any) to disallow variables from evolving into `any` type through reassignments. Contributed by @fujiyamaorange

#### Enhancements

- Rename `noSemicolonInJsx` to `noSuspiciousSemicolonInJsx`. Contributed by @fujiyamaorange

### LSP

#### Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion website/src/content/docs/linter/rules/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ Rules that belong to this group <strong>are not subject to semantic version</str
| [noNodejsModules](/linter/rules/no-nodejs-modules) | Forbid the use of Node.js builtin modules. | |
| [noReExportAll](/linter/rules/no-re-export-all) | Avoid re-export all. | |
| [noRestrictedImports](/linter/rules/no-restricted-imports) | Disallow specified modules when loaded by import or require. | |
| [noSemicolonInJsx](/linter/rules/no-semicolon-in-jsx) | It detects possible &quot;wrong&quot; semicolons inside JSX elements. | |
| [noSkippedTests](/linter/rules/no-skipped-tests) | Disallow disabled tests. | <span aria-label="The rule has an unsafe fix" role="img" title="The rule has an unsafe fix">⚠️ </span> |
| [noSuspiciousSemicolonInJsx](/linter/rules/no-suspicious-semicolon-in-jsx) | It detects possible &quot;wrong&quot; semicolons inside JSX elements. | |
| [noUndeclaredDependencies](/linter/rules/no-undeclared-dependencies) | Disallow the use of dependencies that aren't specified in the <code>package.json</code>. | |
| [noUselessTernary](/linter/rules/no-useless-ternary) | Disallow ternary operators when simpler alternatives exist. | <span aria-label="The rule has an unsafe fix" role="img" title="The rule has an unsafe fix">⚠️ </span> |
| [useImportRestrictions](/linter/rules/use-import-restrictions) | Disallows package private imports. | |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
---
title: noSemicolonInJsx (since v1.6.0)
title: noSuspiciousSemicolonInJsx (not released)
---

**Diagnostic Category: `lint/nursery/noSemicolonInJsx`**
**Diagnostic Category: `lint/nursery/noSuspiciousSemicolonInJsx`**

:::danger
This rule hasn't been released yet.
:::

:::caution
This rule is part of the [nursery](/linter/rules/#nursery) group.
Expand All @@ -26,7 +30,7 @@ const Component = () => {
}
```

<pre class="language-text"><code class="language-text">nursery/noSemicolonInJsx.js:4:14 <a href="https://biomejs.dev/linter/rules/no-semicolons-in-jsx">lint/nursery/noSemicolonInJsx</a> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
<pre class="language-text"><code class="language-text">nursery/noSuspiciousSemicolonInJsx.js:4:14 <a href="https://biomejs.dev/linter/rules/no-suspicious-semicolon-in-jsx">lint/nursery/noSuspiciousSemicolonInJsx</a> ━━━━━━━━━━━━━━━━━

<strong><span style="color: Tomato;"> </span></strong><strong><span style="color: Tomato;">✖</span></strong> <span style="color: Tomato;">There is a suspicious </span><span style="color: Tomato;"><strong>semicolon</strong></span><span style="color: Tomato;"> in the JSX element.</span>

Expand Down