-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
55 lines (55 loc) · 1.83 KB
/
.eslintrc.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
53
54
55
module.exports = {
env: {
browser: true,
amd: true,
node: true,
},
// Specifies the ESLint parser for TS
parser: '@typescript-eslint/parser',
parserOptions: {
// Allows for the parsing of modern ECMAScript features
ecmaVersion: 2018,
// Allows for the use of imports
sourceType: 'module',
project: './tsconfig.json',
},
ignorePatterns: ['**/notes/*.{js,json,md,ts}'],
extends: [
// Uses the recommended rules from Jest
// 'plugin:jest/recommended',
// Uses the recommended rules from eslint
'eslint:recommended',
// Uses the recommended rules from @typescript-eslint/eslint-plugin
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
// Enables eslint-plugin-prettier and eslint-config-prettier.
// This will display prettier errors as ESLint errors.
// Make sure this is always the last configuration in the extends array.
'plugin:prettier/recommended',
],
rules: {
// 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",
// Turned off due to conflict with the second rule below, which should be used with TS
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error', { variables: false }],
// Turns off rule that conflicts with Prettier
'comma-dangle': 'off',
// Turns off rule that conflicts with Prettier
'object-curly-newline': 'off',
// Allows for iterable Promises with void return
'@typescript-eslint/no-misused-promises': [
'error',
{
checksVoidReturn: false,
},
],
},
settings: {
'import/resolver': {
// This loads <rootdir>/tsconfig.json to eslint
typescript: {},
},
},
};