-
-
Notifications
You must be signed in to change notification settings - Fork 495
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: style recommendation and new recommended severity (#4730)
- Loading branch information
Showing
90 changed files
with
974 additions
and
1,755 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
cli: minor | ||
--- | ||
|
||
# Enable rule with default severity | ||
|
||
You can now enable lint rules using the default severity suggested by Biome using the new variant `"on"`, when enabling a rule. | ||
|
||
For example, the default severity of the rule `style.noVar` is `error`, so you would use `"on"`, and then linting a code that uses `var`, will result in an error: | ||
|
||
```json | ||
{ | ||
"linter": { | ||
"recommended": false, | ||
"rules": { | ||
"style": { | ||
"noVar": "on" | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
```js | ||
// main.js | ||
var name = "tobias" | ||
``` | ||
|
||
The command `biome lint main.js` will result in an error due to the default severity assigned to `noVar`. | ||
|
||
Refer to the documentation page of each rule to know their suggested diagnostic severity, or use the command `biome explain <RULE_NAME>`: | ||
|
||
```shell | ||
biome explain noVar | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
cli: major | ||
--- | ||
|
||
# `style` rules aren't recommended anymore | ||
|
||
Linting rules that belong to the group `style` aren't recommended anymore. Here's the list of rules that aren't recommended anymore: | ||
|
||
- `useNumberNamespace` | ||
- `noNonnullAssertion` | ||
- `useAsConstAssertion` | ||
- `noParameterAssign` | ||
- `noInferrableTypes` | ||
- `useNodejsImportProtocol` | ||
- `useExportType` | ||
- `useDefaultParameterLast` | ||
- `noUnusedTemplateLiteral` | ||
- `useExponentiationOperator` | ||
- `useEnumInitializers` | ||
- `useShorthandFunctionType` | ||
- `useLiteralEnumMembers` | ||
- `noVar` | ||
- `noUselessElse` | ||
- `useNumericLiterals` | ||
- `noCommaOperator` | ||
- `useConst` | ||
- `noArguments` | ||
- `useSelfClosingElements` | ||
- `useImportType` | ||
- `useTemplate` | ||
- `useSingleVarDeclarator` | ||
- `useWhile` | ||
- `use_while` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.