From 0bc92404bbfda95f1db5fc0869edf9cdabaf16be Mon Sep 17 00:00:00 2001 From: Amir Zarrinkafsh Date: Tue, 8 Jun 2021 10:14:51 +1000 Subject: [PATCH] ci: update tsconfig and refactor eslintrc (#2069) --- web/{craco.config.js => .cracorc.js} | 0 web/.eslintrc.js | 63 +++++++++++----------------- web/tsconfig.json | 1 + 3 files changed, 25 insertions(+), 39 deletions(-) rename web/{craco.config.js => .cracorc.js} (100%) diff --git a/web/craco.config.js b/web/.cracorc.js similarity index 100% rename from web/craco.config.js rename to web/.cracorc.js diff --git a/web/.eslintrc.js b/web/.eslintrc.js index c0d63503e..0d0b115d4 100644 --- a/web/.eslintrc.js +++ b/web/.eslintrc.js @@ -1,49 +1,34 @@ module.exports = { - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json" + parser: "@typescript-eslint/parser", + parserOptions: { + project: "tsconfig.json", }, - "ignorePatterns": [ - "build/*", - "coverage/*" - ], - "settings": { + ignorePatterns: ["build/*", "coverage/*"], + settings: { "import/resolver": { - "typescript": {} - } + typescript: {}, + }, }, - "extends": [ - "react-app", - "plugin:import/errors", - "plugin:import/warnings", - "plugin:prettier/recommended", - "prettier" - ], - "rules": { + extends: ["react-app", "plugin:import/errors", "plugin:import/warnings", "plugin:prettier/recommended", "prettier"], + rules: { "import/order": [ "error", { - "groups": [ - "builtin", - "external", - "internal" - ], - "pathGroups": [ + groups: ["builtin", "external", "internal"], + pathGroups: [ { - "pattern": "react", - "group": "external", - "position": "before" - } - ], - "pathGroupsExcludedImportTypes": [ - "react" + pattern: "react", + group: "external", + position: "before", + }, ], + pathGroupsExcludedImportTypes: ["react"], "newlines-between": "always", - "alphabetize": { - "order": "asc", - "caseInsensitive": true - } - } - ] - } -}; \ No newline at end of file + alphabetize: { + order: "asc", + caseInsensitive: true, + }, + }, + ], + }, +}; diff --git a/web/tsconfig.json b/web/tsconfig.json index 8ba0c002f..8c812cc5e 100644 --- a/web/tsconfig.json +++ b/web/tsconfig.json @@ -21,6 +21,7 @@ "noFallthroughCasesInSwitch": true }, "include": [ + ".*.js", "src", "types" ]