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

Update linting doc #105748

Merged
merged 2 commits into from
Aug 9, 2021
Merged
Changes from 1 commit
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
12 changes: 8 additions & 4 deletions docs/developer/contributing/linting.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,21 @@ file types.
"eslint.validate": [
"javascript",
"javascriptreact",
{ "language": "typescript", "autoFix": true },
{ "language": "typescriptreact", "autoFix": true }
"typescript",
"typescriptreact",
]
----

Although, starting with https://github.com/microsoft/vscode-eslint#version-204[ESLint v2.0.4], there is no need to use `eslint.validate` to parse typescript files as it works out of the box.

`eslint` can automatically fix trivial lint errors when you save a
file by adding this line in your setting.

[source,json]
----
"eslint.autoFixOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
----

:warning: It is *not* recommended to use the
Expand All @@ -67,4 +71,4 @@ the multiple `.eslintrc.js` files across the project and some of them
use the https://www.npmjs.com/package/prettier[NPM version of Prettier].
Using the IDE extension might cause conflicts, applying the formatting
to too many files that shouldn’t be prettier-ized and/or highlighting
errors that are actually OK.
errors that are actually OK.