From fccd24d55292ec55ea942c3f27860318a2869a80 Mon Sep 17 00:00:00 2001 From: Chris Wilkinson Date: Tue, 2 Nov 2021 16:04:34 +0000 Subject: [PATCH] fix(eslint): recognise type usage I'm not sure why @typescript-eslint/typescript-estree has been used: I can't see any useful information about it. All documentation points to using @typescript-eslint/parser, which has been installed already. The only noticeable difference is that it doesn't understand when a type has been used, leading to @typescript-eslint/no-unused-vars errors. I've added a separate TypeScript config file that includes all files in the codebase, as the new parser will error if it tries to load a file that hasn't been included. Refs #398, #422, ba132cc --- .eslintrc.json | 6 ++---- Dockerfile | 1 + tsconfig.dev.json | 7 +++++++ 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 tsconfig.dev.json diff --git a/.eslintrc.json b/.eslintrc.json index 399d95f7..ac549aa7 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -39,11 +39,9 @@ "**/*.ts", "**/*.tsx" ], - "parser": "@typescript-eslint/typescript-estree", + "parser": "@typescript-eslint/parser", "parserOptions": { - "sourceType": "module", - "project": "./tsconfig.json", - "allowImportExportEverywhere": true + "project": "./tsconfig.dev.json" }, "extends": [ "plugin:react/recommended", diff --git a/Dockerfile b/Dockerfile index 5e644b67..68e6d86e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -108,6 +108,7 @@ COPY \ .proxyrc \ docker-entrypoint.sh \ jest.config.ts \ + tsconfig.dev.json \ ./ COPY --from=scripts /app/dist/scripts/ dist/scripts/ diff --git a/tsconfig.dev.json b/tsconfig.dev.json new file mode 100644 index 00000000..a0c8e3f2 --- /dev/null +++ b/tsconfig.dev.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "include": [ + "**/*", + "**/.*" + ] +}