Skip to content

Instantly share code, notes, and snippets.

@willin
Created November 25, 2021 08:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willin/1fdd8687f8dc12746bcfa8472c55e4da to your computer and use it in GitHub Desktop.
Save willin/1fdd8687f8dc12746bcfa8472c55e4da to your computer and use it in GitHub Desktop.
ESLint Config of Mix Typescript and Javascript Project
{
"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