-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
98 lines (87 loc) · 3.16 KB
/
index.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// Copyright (c) 2019 Ultimaker B.V.
module.exports = {
extends: 'airbnb',
env: {
node: true,
es6: true,
browser: true,
},
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
modules: true,
jsx: true,
},
},
plugins: ['import'],
rules: {
'indent': ['error', 4],
'no-underscore-dangle': 'off',
'import/no-unresolved': 'off',
'import/extensions': ['error', 'ignorePackages', {
ts: 'never',
tsx: 'never',
}],
'jsx-closing-tag-location': 'off',
'react/default-props-match-prop-types': 'off',
'react/jsx-indent': ['error', 4],
'react/jsx-indent-props': ['error', 4],
'react/no-array-index-key': 'off',
'class-methods-use-this': 'off',
'camelcase': 'off',
'max-len': 'off',
'no-useless-escape': 'off',
},
settings: {
'import/resolver': {
node: {
extensions: ['.ts', '.tsx', '.json'],
},
},
},
overrides: [
// Allow this file to use quotes on all ESLint rules for consistency
{
'files': ['./index.js'],
'rules': {
'quote-props': 'off',
},
},
// Create some special overrides for TypeScript files
{
files: ['**/*.ts', '**/*.tsx'],
parser: '@typescript-eslint/parser',
rules: {
// Required for interfaces
'no-undef': 'off',
'no-unused-vars': 'off',
'react/prop-types': 'off',
// Use .tsx instead of .jsx
'react/jsx-filename-extension': ['warn', {
extensions: ['.tsx'],
}],
// Allow using defaultProps at top of class declaration
'react/static-property-placement': ['error', 'static public field'],
// Allow prop spreading
'react/jsx-props-no-spreading': 'off',
// Not going to worry about keyboard navigation for now
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/no-static-element-interactions': 'off',
'jsx-a11y/interactive-supports-focus': 'off',
// https://humanwhocodes.com/blog/2019/01/stop-using-default-exports-javascript-module
'import/prefer-default-export': 'off',
/** We need to be able to export both normal and connected versions of components
* using named for the base component in tests, and default for connected/router
* component in the app-proper. */
'import/no-named-as-default': 'off',
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-use-before-define.md
'no-use-before-define': 'off',
},
settings: {
// Allow import of .ts and .tsx without specifying extension
'import/extensions': ['.ts', '.tsx'],
},
},
],
};