Skip to content

Commit 283cce1

Browse files
committed
Update Readme
1 parent 38f96ec commit 283cce1

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
"editor.codeActionsOnSave": {
2020
"source.fixAll.eslint": true
2121
},
22+
"eslint.codeActionsOnSave.rules": [
23+
"@typescript-eslint/semi",
24+
"@typescript-eslint/indent",
25+
"!@typescript-eslint/*",
26+
"*"
27+
],
2228
"editor.codeActionsOnSaveTimeout": 2000,
2329
"eslint.workingDirectories": [
2430
"./client",

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ On new folders you might also need to create a `.eslintrc` configuration file. Y
1212

1313
This section describes major releases and their improvements. For a detailed list of changes please refer to the [change log](./CHANGELOG.md).
1414

15+
### Version 2.2.0
16+
17+
Added support for ESLint V8.0 Beta. This release also switch to the ESLint class API that got introduced in version 7. In addition the rules taken into consideration during code action on save can now be configured.
18+
1519
### Version 2.1.22
1620

1721
Adapt VS Code's workspace trust model. As a consequence the custom dialog ESLint introduced in version `2.1.7` got removed. In addition the `off` value got added to the eslint rule customization support.
@@ -180,6 +184,36 @@ This extension contributes the following variables to the [settings](https://cod
180184
- `all`: fixes all possible problems by revalidating the file's content. This executes the same code path as running eslint with the `--fix` option in the terminal and therefore can take some time. This is the default value.
181185
- `problems`: fixes only the currently known fixable problems as long as their textual edits are non overlapping. This mode is a lot faster but very likely only fixes parts of the problems.
182186
187+
- `eslint.codeActionsOnSave.rules` (@since 2.2.0): controls the rules which are taken into consideration during code action on save execution. If not specified all rules specified via the normal ESLint configuration mechanism are consider. An empty array results in no rules being considered. If the array contains more than one entry the order matters and the first match determines the rule's on / off state.
188+
189+
In this example only semicolon related rules are considered:
190+
191+
```json
192+
"eslint.codeActionsOnSave.rules": [
193+
"*semi*"
194+
]
195+
```
196+
197+
This example removes all TypeScript ESLint specific rules from the code action on save pass but keeps all other rules:
198+
199+
```json
200+
"eslint.codeActionsOnSave.rules": [
201+
"!@typescript-eslint/*",
202+
"*"
203+
]
204+
```
205+
206+
This example keeps the indent and semi rule from TypeScript ESLint, disables all other TypeScript ESLint rules and keeps the rest:
207+
208+
```json
209+
"eslint.codeActionsOnSave.rules": [
210+
"@typescript-eslint/semi",
211+
"@typescript-eslint/indent",
212+
"!@typescript-eslint/*",
213+
"*"
214+
]
215+
```
216+
183217
- `eslint.rules.customizations` (@since 2.1.20): force rules to report a different severity within VS Code compared to the project's true ESLint configuration. Contains two properties:
184218
- `"rule`": Select on rules with names that match, factoring in asterisks as wildcards: `{ "rule": "no-*", "severity": "warn" }`
185219
- Prefix the name with a `"!"` to target all rules that _don't_ match the name: `{ "rule": "!no-*", "severity": "info" }`

0 commit comments

Comments
 (0)