-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
64 lines (54 loc) · 1.49 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
module.exports = {
plugins: ['@typescript-eslint', 'react', 'jsx-a11y'],
extends: [
'eslint:recommended',
'airbnb-base',
'plugin:@typescript-eslint/recommended',
'plugin:react/jsx-runtime',
'plugin:jsx-a11y/recommended',
],
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
ecmaFeatures: {
jsx: true,
},
},
rules: {
/* Common rules */
// Avoid using extensions in import e.g. "import Component from './component.tsx'"
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
// Ignore default export requirement
'import/prefer-default-export': 'off',
/* Typescript rules */
// Allow to use exclamation point from typescript
'@typescript-eslint/no-non-null-assertion': 'off',
/* React rules */
// Boolean props start with "is" or "has" e.g. "isActivated" or "hasBorder"
'react/boolean-prop-naming': ['error', { validateNested: true }],
// Prefer destructing for props state or context
'react/destructuring-assignment': [
'error',
'always',
{ destructureInSignature: 'always' },
],
// Use arrow functions to declare components
'react/function-component-definition': [
'error',
{ namedComponents: 'arrow-function' },
],
/* A11y rules */
// Allow autofocus
'jsx-a11y/no-autofocus': 'off',
},
};