From 5ad4b10c7ed108c6e21d65035da7efc97b01fd5a Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 25 Apr 2020 20:53:28 +1000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7Eslint,=20prettier=20and=20tsconfig?= =?UTF-8?q?=20setup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/.prettierrc => .prettierrc | 0 tsconfig.json | 21 +++++++-------------- web/.eslintrc.js | 33 +++++++++++++++++++++++---------- 3 files changed, 30 insertions(+), 24 deletions(-) rename web/.prettierrc => .prettierrc (100%) diff --git a/web/.prettierrc b/.prettierrc similarity index 100% rename from web/.prettierrc rename to .prettierrc diff --git a/tsconfig.json b/tsconfig.json index bddc3bc..6b40de0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,13 +3,9 @@ "noEmit": true, "allowJs": true, "esModuleInterop": true, - "baseUrl": ".", + "baseUrl": "web/src", "target": "es5", - "lib": [ - "es2015", - "es2017", - "DOM" - ], + "lib": ["es2019", "DOM"], "skipLibCheck": true, "strict": false, "forceConsistentCasingInFileNames": true, @@ -17,12 +13,9 @@ "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, - "jsx": "preserve" + "jsx": "preserve", + "sourceMap": true }, - "include": [ - "." - ], - "exclude": [ - "node_modules" - ] -} \ No newline at end of file + "include": ["."], + "exclude": ["node_modules"] +} diff --git a/web/.eslintrc.js b/web/.eslintrc.js index 1a8bd45..650cea3 100644 --- a/web/.eslintrc.js +++ b/web/.eslintrc.js @@ -1,13 +1,26 @@ module.exports = { - "extends": ["airbnb-typescript", "prettier"], - "plugins": ["prettier"], - "parserOptions": { - "project": "./tsconfig.json" + extends: [ + 'airbnb-typescript', + 'prettier', + 'prettier/react', + 'prettier/@typescript-eslint', + ], + plugins: ['prettier', '@typescript-eslint'], + parser: '@typescript-eslint/parser', + parserOptions: { + project: './web/tsconfig.json', + }, + settings: { + react: { + version: 'detect', + }, + }, + rules: { + 'import/prefer-default-export': 'off', + 'react/react-in-jsx-scope': 'off', + 'react/jsx-props-no-spreading': 'off', + '@typescript-eslint/no-dupe-class-members': 'off', + '@typescript-eslint/no-implied-eval': 'off', + '@typescript-eslint/no-throw-literal': 'off', }, - "rules": { - "prettier/prettier": ["error"], - "import/prefer-default-export": "off", - "react/react-in-jsx-scope": "off", - "react/jsx-props-no-spreading": "off" - } };