From 60f3cf655237f863a342d7611618821179843b97 Mon Sep 17 00:00:00 2001 From: G r e y Date: Sun, 13 Mar 2022 20:02:49 -0400 Subject: [PATCH] chore: configure eslint vs code plugin (#423) Summary: The .eslintrc.yaml is located in site, rather than the root of the repository. The VS Code plugin has a CWD of the repository root, so it looks for tsconfig.test.json in the root rather in site. See Also: - https://github.com/microsoft/vscode-eslint/issues/196 - https://github.com/typescript-eslint/typescript-eslint/issues/251 --- .vscode/settings.json | 3 ++- site/.eslintrc.yaml | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index a503c49b57..1f737aeec2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -75,5 +75,6 @@ "webrtc", "xerrors", "yamux" - ] + ], + "eslint.workingDirectories": ["./site"] } diff --git a/site/.eslintrc.yaml b/site/.eslintrc.yaml index d6c6be9eb6..436bd1a2e4 100644 --- a/site/.eslintrc.yaml +++ b/site/.eslintrc.yaml @@ -17,11 +17,12 @@ extends: parser: "@typescript-eslint/parser" parserOptions: ecmaVersion: 2018 - project: - - "./tsconfig.test.json" + project: "./tsconfig.test.json" sourceType: module ecmaFeatures: jsx: true + # REMARK(Grey): We might want to move this to repository root eventually to + # lint multiple projects (supply array to project property). tsconfigRootDir: "./" plugins: - "@typescript-eslint"