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

Commit

Permalink
chore: apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Mar 1, 2023
1 parent 13ffd85 commit 285c963
Show file tree
Hide file tree
Showing 39 changed files with 537 additions and 420 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,51 @@ internalError/io ━━━━━━━━━━━━━━━━━━━━━

# Emitted Messages

```block
Found errors in the configuration file, Rome will use its defaults for the sections that are incorrect.
```

```block
/Users/ema/www/tools/rome.json:20:5 configuration ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Found an unknown key `noNonNullAssertion`
18 │ "recommended": true,
19 │ "suspicious": {
> 20 │ "noNonNullAssertion": "off"
│ ^^^^^^^^^^^^^^^^^^^^
21 │ }
22 │ }
i Accepted keys
- recommended
- noArrayIndexKey
- noAsyncPromiseExecutor
- noCatchAssign
- noCommentText
- noCompareNegZero
- noConstEnum
- noDebugger
- noDoubleEquals
- noDuplicateObjectKeys
- noDuplicateParameters
- noEmptyInterface
- noExplicitAny
- noExtraNonNullAssertion
- noFunctionAssign
- noImportAssign
- noLabelVar
- noRedundantUseStrict
- noShadowRestrictedNames
- noSparseArray
- noUnsafeNegation
- useDefaultSwitchClauseLast
- useValidTypeof
```

```block
<TEMP_DIR>/rome_test_broken_symlink/broken_symlink internalError/fs ━━━━━━━━━━━━━━━━━━━━
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,51 @@ internalError/io ━━━━━━━━━━━━━━━━━━━━━

# Emitted Messages

```block
Found errors in the configuration file, Rome will use its defaults for the sections that are incorrect.
```

```block
/Users/ema/www/tools/rome.json:20:5 configuration ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Found an unknown key `noNonNullAssertion`
18 │ "recommended": true,
19 │ "suspicious": {
> 20 │ "noNonNullAssertion": "off"
│ ^^^^^^^^^^^^^^^^^^^^
21 │ }
22 │ }
i Accepted keys
- recommended
- noArrayIndexKey
- noAsyncPromiseExecutor
- noCatchAssign
- noCommentText
- noCompareNegZero
- noConstEnum
- noDebugger
- noDoubleEquals
- noDuplicateObjectKeys
- noDuplicateParameters
- noEmptyInterface
- noExplicitAny
- noExtraNonNullAssertion
- noFunctionAssign
- noImportAssign
- noLabelVar
- noRedundantUseStrict
- noShadowRestrictedNames
- noSparseArray
- noUnsafeNegation
- useDefaultSwitchClauseLast
- useValidTypeof
```

```block
<TEMP_DIR>/rome_test_infinite_symlink_exapansion/prefix internalError/fs ━━━━━━━━━━━━━━━━━━━━
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ try {

# Emitted Messages

```block
Skipped 1 suggested fixes.
If you wish to apply the suggested (unsafe) fixes, use the command rome check --apply-unsafe
```

```block
Fixed 1 file(s) in <TIME>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,6 @@ internalError/io ━━━━━━━━━━━━━━━━━━━━━

# Emitted Messages

```block
file.js:1:9 lint/complexity/useSimplifiedLogicExpression FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
× Logical expression contains unnecessary complexity.
> 1 │ let a = !b || !c
│ ^^^^^^^^
i Suggested fix: Reduce the complexity of the logical expression.
- let·a·=·!b·||·!c
+ let·a·=·!(b·&&·c)
```

```block
file.js:1:1 lint/style/useConst FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ rome.json:6:13 configuration ━━━━━━━━━━━━━━━━━
- noChildrenProp
- noConstAssign
- noConstructorReturn
- noDuplicateObjectKeys
- noEmptyPattern
- noNewSymbol
- noPrecisionLoss
- noRenderReturnValue
- noSetterReturn
- noStringCaseMismatch
- noUndeclaredVariables
- noUnnecessaryContinue
Expand All @@ -68,7 +68,6 @@ rome.json:6:13 configuration ━━━━━━━━━━━━━━━━━
- noUnusedVariables
- noVoidElementsWithChildren
- noVoidTypeReturn
- useEnumInitializers
- useValidForDirection
Expand Down
10 changes: 6 additions & 4 deletions crates/rome_diagnostics_categories/src/categories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,11 @@ define_categories! {
"lint/correctness/noVoidElementsWithChildren": "https://docs.rome.tools/lint/rules/noVoidElementsWithChildren",
"lint/correctness/useValidForDirection": "https://docs.rome.tools/lint/rules/useValidForDirection",
"lint/correctness/noUnsafeFinally": "https://docs.rome.tools/lint/rules/noUnsafeFinally",
"lint/correctness/noDuplicateObjectKeys":"https://docs.rome.tools/lint/rules/noDuplicateObjectKeys",
"lint/correctness/noConstructorReturn": "https://docs.rome.tools/lint/rules/noConstructorReturn",
"lint/correctness/useEnumInitializers":"https://docs.rome.tools/lint/rules/useEnumInitializers",
"lint/correctness/noPrecisionLoss": "https://docs.rome.tools/lint/rules/noPrecisionLoss",
"lint/correctness/noVoidTypeReturn": "https://docs.rome.tools/lint/rules/noVoidTypeReturn",
"lint/correctness/noStringCaseMismatch": "https://docs.rome.tools/lint/rules/noStringCaseMismatch",
"lint/correctness/noSetterReturn": "https://docs.rome.tools/lint/rules/noSetterReturn",


// nursery
Expand Down Expand Up @@ -126,6 +125,9 @@ define_categories! {
"lint/style/useDefaultParameterLast":"https://docs.rome.tools/lint/rules/useDefaultParameterLast",
"lint/style/useConst":"https://docs.rome.tools/lint/rules/useConst",
"lint/style/noVar": "https://docs.rome.tools/lint/rules/noVar",
"lint/style/noNonNullAssertion": "https://docs.rome.tools/lint/rules/noNonNullAssertion",
"lint/style/useEnumInitializers":"https://docs.rome.tools/lint/rules/useEnumInitializers",


// suspicious
"lint/suspicious/noArrayIndexKey": "https://docs.rome.tools/lint/rules/noArrayIndexKey",
Expand All @@ -147,10 +149,10 @@ define_categories! {
"lint/suspicious/noEmptyInterface": "https://docs.rome.tools/lint/rules/noEmptyInterface",
"lint/suspicious/noExtraNonNullAssertion":"https://docs.rome.tools/lint/rules/noExtraNonNullAssertion",
"lint/suspicious/noRedundantUseStrict": "https://docs.rome.tools/lint/rules/noRedundantUseStrict",
"lint/suspicious/noNonNullAssertion": "https://docs.rome.tools/lint/rules/noNonNullAssertion",
"lint/suspicious/noConstEnum": "https://docs.rome.tools/lint/rules/noConstEnum",
"lint/suspicious/noSetterReturn": "https://docs.rome.tools/lint/rules/noSetterReturn",
"lint/suspicious/useDefaultSwitchClauseLast":"https://docs.rome.tools/lint/rules/useDefaultSwitchClauseLast",
"lint/suspicious/noDuplicateObjectKeys":"https://docs.rome.tools/lint/rules/noDuplicateObjectKeys",



;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ declare_rule! {
pub(crate) UseSimplifiedLogicExpression {
version: "0.7.0",
name: "useSimplifiedLogicExpression",
recommended: true,
recommended: false,
}
}

Expand Down
5 changes: 2 additions & 3 deletions crates/rome_js_analyze/src/analyzers/correctness.rs

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

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

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

5 changes: 2 additions & 3 deletions crates/rome_js_analyze/src/analyzers/suspicious.rs

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

Loading

0 comments on commit 285c963

Please sign in to comment.