-
Notifications
You must be signed in to change notification settings - Fork 5
/
.eslintrc.js
60 lines (55 loc) · 1.82 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
56
57
58
59
60
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from @typescript-eslint/eslint-plugin
'plugin:prettier/recommended',
],
plugins: ['sort-imports-es6-autofix'],
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
ecmaFeatures: {
jsx: true,
},
},
overrides: [
{
files: ['*.js', '*.jsx'],
rules: {
// And as mentioned here this rule will freak out on .js files as well
// https://github.com/typescript-eslint/typescript-eslint/issues/906
//
// So we disable it for .js files using overrides
'@typescript-eslint/explicit-function-return-type': 0,
// And the same goes for member accessibility
//
// See https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md
'@typescript-eslint/explicit-member-accessibility': 0,
// And last but not least require() calls are enabled in js files
'@typescript-eslint/no-var-requires': 0,
},
},
],
rules: {
// Prevent forgotten console.* statements
'no-console': 1,
// Make sure imports get sorted
'sort-imports-es6-autofix/sort-imports-es6': [
2,
{
ignoreCase: false,
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
},
],
'@typescript-eslint/no-use-before-define': [1, { functions: false }],
'@typescript-eslint/explicit-function-return-type': 0,
},
settings: {
'import/resolver': {
node: {
extensions: ['.ts', '.js'],
},
},
},
};