Open FoushWare opened 3 years ago
update the eslintrc and add parser/eslint
{ "settings": { "react":{ "version":"detect" } }, "parser": "@babel/eslint-parser", "parserOptions": { "ecmaVersion": 2019, "sourceType": "module", "ecmaFeatures": { "jsx": true } }, "extends": ["eslint:recommended", "eslint-config-prettier","plugin:react/recommended"], "rules": { "strict": ["error", "never"], "no-debugger":"off" }, "env": { "browser": true, "jest":true, "node": true, "es6": true }, "globals": { "React":true, "ReactDOM":true }, // overrides eslint to work with typescript "overrides": [ { "files": "**/*.+(ts|tsx)", "parser": "@typescript-eslint/parser", "parserOptions": { "project": "./tsconfig.json" }, "plugins": ["@typescript-eslint/eslint-plugin"], "extends": [ "plugin:@typescript-eslint/eslint-recommended", // removes redundant warnings between TS & ESLint "plugin:@typescript-eslint/recommended", // rules specific to typescript, e.g., writing interfaces "prettier" // "eslint-config-prettier/@typescript-eslint" // ensure rule set doesn't conflict with prettier for TS files too ] } ] }
update the eslintrc and add parser/eslint