This repository has been archived by the owner on Nov 4, 2022. It is now read-only.
/
.eslintrc.base.js
52 lines (51 loc) · 2.03 KB
/
.eslintrc.base.js
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
44
45
46
47
48
49
50
51
52
const path = require("path")
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
parserOptions: {
// NOTE: These need to be set in each apps/* and packages/* projects.
//tsconfigRootDir: __dirname,
//project: ['./tsconfig.json'],
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
},
settings: {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
typescript: {
"alwaysTryTypes": true
}, // this loads <rootdir>/tsconfig.json to eslint
},
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:jest/recommended",
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
plugins: [
"import",
"sort-destructure-keys",
],
rules: {
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/unbound-method": "warn",
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_"}],
"@typescript-eslint/no-empty-interface": [
"error",
{
"allowSingleExtends": true
}
],
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
"sort-destructure-keys/sort-destructure-keys": "error", // Mainly to sort render props
"import/no-unresolved": "error"
},
};