Created
November 25, 2021 08:09
-
-
Save willin/1fdd8687f8dc12746bcfa8472c55e4da to your computer and use it in GitHub Desktop.
ESLint Config of Mix Typescript and Javascript Project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"env": { "browser": true, "es6": true, "node": true }, | |
"extends": ["eslint:recommended", "plugin:react/recommended"], | |
"globals": { "Atomics": "readonly", "SharedArrayBuffer": "readonly" }, | |
"parser": "babel-eslint", | |
"parserOptions": { | |
"ecmaFeatures": { "jsx": true }, | |
"ecmaVersion": 2018, | |
"sourceType": "module" | |
}, | |
"plugins": ["react"], | |
"rules": { | |
"indent": ["error", 2, { "SwitchCase": 1 }], | |
"linebreak-style": ["error", "unix"], | |
"quotes": ["error", "single"], | |
"comma-dangle": ["error", "always-multiline"], | |
"semi": ["error", "always"] | |
}, | |
"settings": { "react": { "version": "detect" } }, | |
"overrides": [ | |
{ | |
"files": ["**/*.ts", "**/*.tsx"], | |
"env": { "browser": true, "es6": true, "node": true }, | |
"extends": [ | |
"eslint:recommended", | |
"plugin:react/recommended", | |
"plugin:@typescript-eslint/eslint-recommended", | |
"plugin:@typescript-eslint/recommended" | |
], | |
"globals": { "Atomics": "readonly", "SharedArrayBuffer": "readonly" }, | |
"parser": "@typescript-eslint/parser", | |
"parserOptions": { | |
"ecmaFeatures": { "jsx": true }, | |
"ecmaVersion": 2018, | |
"sourceType": "module", | |
"project": "./tsconfig.json" | |
}, | |
"plugins": ["react", "@typescript-eslint"], | |
"rules": { | |
"indent": ["error", 2, { "SwitchCase": 1 }], | |
"linebreak-style": ["error", "unix"], | |
"quotes": ["error", "single"], | |
"comma-dangle": ["error", "always-multiline"], | |
"@typescript-eslint/no-explicit-any": 0 | |
}, | |
"settings": { "react": { "version": "detect" } } | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment