From 78cc089ec2426a2c4c9d3e29ce05c5ed435f431f Mon Sep 17 00:00:00 2001 From: Ashokaditya Date: Mon, 9 Aug 2021 09:40:09 +0200 Subject: [PATCH] update linting doc (#105748) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- docs/developer/contributing/linting.asciidoc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/developer/contributing/linting.asciidoc b/docs/developer/contributing/linting.asciidoc index 0d05afa504538..eb7c22c517e4b 100644 --- a/docs/developer/contributing/linting.asciidoc +++ b/docs/developer/contributing/linting.asciidoc @@ -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 @@ -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. \ No newline at end of file +errors that are actually OK.