-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
65 lines (65 loc) · 1.79 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
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./tsconfig.eslint.json', './packages/*/tsconfig.json'],
tsconfigRootDir: __dirname,
},
ignorePatterns: [
'**/storybook-static/**',
'**/.expo/**',
'**/.yarn/**',
'.eslintrc.js',
],
plugins: [
'@typescript-eslint',
'eslint-plugin-tsdoc',
'sort-imports-es6-autofix',
],
extends: [
// For what this sets, see: https://typescript-eslint.io/linting/configs#recommended
'plugin:@typescript-eslint/recommended',
'prettier',
],
env: {
commonjs: true,
es6: true,
node: true,
browser: false,
},
root: true,
rules: {
// Simple rules (one line)
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/no-empty-function': 'warn',
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/no-unused-vars': 'warn',
'linebreak-style': ['error', 'unix'],
// See https://eslint.org/docs/latest/rules/max-len for details/options
'max-len': ['error', { code: 120, ignoreUrls: true, ignoreStrings: true }],
'no-console': 'off',
'no-multiple-empty-lines': 'off',
'no-shadow': 'off', // Handled by @typescript-eslint
semi: 'off',
'sort-imports-es6-autofix/sort-imports-es6': 'error',
'tsdoc/syntax': 'warn',
// Complex rules (multiline)
'@typescript-eslint/naming-convention': [
'warn',
{
selector: 'function',
format: ['camelCase', 'PascalCase'],
},
],
},
overrides: [
{
// Component test files only
files: [
'packages/components/**/__tests__/**/*.[jt]s?(x)',
'packages/components/**/?(*.)+(spec|test).[jt]s?(x)',
],
extends: ['plugin:testing-library/react'],
},
],
}