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

Commit

Permalink
rename rule to useValidTypeof
Browse files Browse the repository at this point in the history
  • Loading branch information
leops committed Jun 9, 2022
1 parent f6b686a commit 445c4e5
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions crates/rome_analyze/src/analyzers.rs

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

Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ use crate::{
ActionCategory, RuleCategory,
};

pub(crate) enum ValidTypeof {}
pub(crate) enum UseValidTypeof {}

impl Rule for ValidTypeof {
const NAME: &'static str = "validTypeof";
impl Rule for UseValidTypeof {
const NAME: &'static str = "useValidTypeof";
const CATEGORY: RuleCategory = RuleCategory::Lint;

type Query = JsBinaryExpression;
Expand Down
2 changes: 1 addition & 1 deletion crates/rome_analyze/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ impl_registry_builders!(
NoDelete,
NoDoubleEquals,
UseSingleVarDeclarator,
UseValidTypeof,
UseWhile,
ValidTypeof,
// Assists
FlipBinExp,
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: crates/rome_analyze/tests/spec_tests.rs
expression: validTypeof.js
expression: useValidTypeof.js
---
# Input
```js
Expand All @@ -26,8 +26,8 @@ typeof foo == -5

# Diagnostics
```
error[validTypeof]: Invalid typeof comparison value
┌─ validTypeof.js:7:1
error[useValidTypeof]: Invalid typeof comparison value
┌─ useValidTypeof.js:7:1
7 │ typeof foo === "strnig"
│ ^^^^^^^^^^^^^^^^^^^^^^^ Invalid typeof comparison value
Expand All @@ -36,8 +36,8 @@ error[validTypeof]: Invalid typeof comparison value
```

```
error[validTypeof]: Invalid typeof comparison value
┌─ validTypeof.js:8:1
error[useValidTypeof]: Invalid typeof comparison value
┌─ useValidTypeof.js:8:1
8 │ typeof foo == "undefimed"
│ ^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid typeof comparison value
Expand All @@ -46,8 +46,8 @@ error[validTypeof]: Invalid typeof comparison value
```

```
error[validTypeof]: Invalid typeof comparison value
┌─ validTypeof.js:9:1
error[useValidTypeof]: Invalid typeof comparison value
┌─ useValidTypeof.js:9:1
9 │ typeof bar != "nunber"
│ ^^^^^^^^^^^^^^^^^^^^^^ Invalid typeof comparison value
Expand All @@ -56,8 +56,8 @@ error[validTypeof]: Invalid typeof comparison value
```

```
error[validTypeof]: Invalid typeof comparison value
┌─ validTypeof.js:10:1
error[useValidTypeof]: Invalid typeof comparison value
┌─ useValidTypeof.js:10:1
10 │ typeof bar !== "fucntion"
│ ^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid typeof comparison value
Expand All @@ -66,8 +66,8 @@ error[validTypeof]: Invalid typeof comparison value
```

```
error[validTypeof]: Invalid typeof comparison value
┌─ validTypeof.js:13:1
error[useValidTypeof]: Invalid typeof comparison value
┌─ useValidTypeof.js:13:1
13 │ typeof foo === undefined
│ ^^^^^^^^^^^^^^^^^^^^^^^^ Invalid typeof comparison value
Expand All @@ -87,8 +87,8 @@ Compare the result of `typeof` with a valid type name
```

```
error[validTypeof]: Invalid typeof comparison value
┌─ validTypeof.js:14:1
error[useValidTypeof]: Invalid typeof comparison value
┌─ useValidTypeof.js:14:1
14 │ typeof bar == Object
│ ^^^^^^^^^^^^^^^^^^^^ Invalid typeof comparison value
Expand All @@ -108,8 +108,8 @@ Compare the result of `typeof` with a valid type name
```

```
error[validTypeof]: Invalid typeof comparison value
┌─ validTypeof.js:15:1
error[useValidTypeof]: Invalid typeof comparison value
┌─ useValidTypeof.js:15:1
15 │ typeof foo === baz
│ ^^^^^^^^^^^^^^^^^^ Invalid typeof comparison value
Expand All @@ -118,8 +118,8 @@ error[validTypeof]: Invalid typeof comparison value
```

```
error[validTypeof]: Invalid typeof comparison value
┌─ validTypeof.js:16:1
error[useValidTypeof]: Invalid typeof comparison value
┌─ useValidTypeof.js:16:1
16 │ typeof foo == 5
│ ^^^^^^^^^^^^^^^ Invalid typeof comparison value
Expand All @@ -128,8 +128,8 @@ error[validTypeof]: Invalid typeof comparison value
```

```
error[validTypeof]: Invalid typeof comparison value
┌─ validTypeof.js:17:1
error[useValidTypeof]: Invalid typeof comparison value
┌─ useValidTypeof.js:17:1
17 │ typeof foo == -5
│ ^^^^^^^^^^^^^^^^ Invalid typeof comparison value
Expand Down

0 comments on commit 445c4e5

Please sign in to comment.