-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.js
67 lines (67 loc) · 2.13 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
61
62
63
64
65
66
67
module.exports = {
extends: [
'airbnb-typescript',
'plugin:jest/recommended',
'plugin:prettier/recommended',
'prettier/react',
'prettier/@typescript-eslint',
],
env: {
es6: true,
'jest/globals': true,
node: true,
},
parserOptions: {
project: './tsconfig.eslint.json',
},
rules: {
'import/extensions': 'off',
'import/no-default-export': 'error',
'import/prefer-default-export': 'off',
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: ['**/*.stories.tsx', 'scripts/**/*', '**/*.test.*'],
},
],
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/no-magic-numbers': [
'error',
{ ignoreEnums: true, ignoreNumericLiteralTypes: true },
],
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'react/jsx-props-no-spreading': 'off',
'react/prop-types': 'off',
'jest/no-mocks-import': 'off',
'prettier/prettier': [
'error',
{
semi: true, // https://github.com/airbnb/javascript#21.1
singleQuote: true, // https://github.com/airbnb/javascript#6.1
trailingComma: 'all', // https://github.com/airbnb/javascript#20.2
printWidth: 100, // https://github.com/airbnb/javascript#19.13
jsxBracketSameLine: false, // https://github.com/airbnb/javascript/tree/master/react#alignment
jsxSingleQuote: false, // https://github.com/airbnb/javascript/tree/master/react#quotes
tabWidth: 2, // https://github.com/airbnb/javascript#19.1
useTabs: false, // https://github.com/airbnb/javascript#19.1
quoteProps: 'as-needed', // https://github.com/airbnb/javascript#3.6
bracketSpacing: true, // https://github.com/airbnb/javascript#19.12
arrowParens: 'always', // https://github.com/airbnb/javascript#8.4
},
],
},
overrides: [
{
files: ['**/*.test.{ts,tsx}', '**/*.stories.tsx'],
rules: {
'@typescript-eslint/no-magic-numbers': 'off',
},
},
{
files: ['**/*.stories.tsx'],
rules: {
'import/no-default-export': 'off',
},
},
],
};