forked from researchspace/researchspace
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.js
More file actions
43 lines (39 loc) · 1.98 KB
/
Copy path.eslintrc.js
File metadata and controls
43 lines (39 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
module.exports = {
env: {
browser: true, // to enable globals like window that are available in the browser
es6: true // to enable usage of es6 specific features like Maps, etc.
},
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
extends: [
"eslint:recommended",
"plugin:react/recommended", // Uses the recommended rules from @eslint-plugin-react
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from @typescript-eslint/eslint-plugin
"prettier/@typescript-eslint", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
"plugin:@typescript-eslint/recommended-requiring-type-checking",
],
parserOptions: {
// these two rules are needed for typed eslint rules
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: "module", // Allows for the use of imports
ecmaFeatures: {
jsx: true // Allows for the parsing of JSX
}
},
rules: {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
// disable for now until something like https://github.com/typescript-eslint/typescript-eslint/issues/541 is fixed, it produces too much noice
"@typescript-eslint/explicit-function-return-type": "off",
// explicit any is sometimes OK, implicit any is not OK
// we can re-enable this rule later when codebase is a bit more clean
"@typescript-eslint/no-explicit-any": "off",
// quite useless and confusing, because typescript is doing scope checks anyway
"@typescript-eslint/no-use-before-define": "off"
},
settings: {
react: {
version: "detect" // Tells eslint-plugin-react to automatically detect the version of React to use
}
}
};