forked from uber/baseweb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
99 lines (97 loc) · 2.4 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
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
99
/*
Copyright (c) Uber Technologies, Inc.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
// @flow
/* eslint-env node */
module.exports = {
parser: 'babel-eslint',
plugins: [
'flowtype',
'eslint-plugin-react',
'eslint-plugin-import',
'header',
'jsx-a11y',
'prettier',
'import',
'jest',
],
env: {
jest: true,
},
globals: {
page: true,
browser: true,
context: true,
},
settings: {
react: {
version: 'detect',
},
},
extends: [
'plugin:react/recommended',
'plugin:jsx-a11y/recommended',
'plugin:prettier/recommended',
],
rules: {
'react/jsx-filename-extension': 0,
'react/prop-types': 0,
// Enforces imports of external modules to be declared in the package.json
'import/no-extraneous-dependencies': [
'error',
{ optionalDependencies: false, devDependencies: true },
],
'prettier/prettier': [
'error',
{
printWidth: 100,
tabWidth: 2,
useTabs: false,
semi: true,
singleQuote: true,
trailingComma: 'es5',
bracketSpacing: true,
bracketSameLine: false,
},
],
'import/prefer-default-export': ['off'],
'header/header': [2, 'LICENSE-HEAD'],
'jsx-a11y/no-autofocus': [2, { ignoreNonDOM: true }],
'import/no-duplicates': 2,
'import/newline-after-import': 2,
'import/first': 2,
'dot-notation': 2,
},
overrides: [
{
files: ['documentation-site/**/*.js'],
rules: {
'react/display-name': 'off',
},
},
{
files: ['**/*.ts', '**/*.tsx', '**/*.d.ts'],
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/typescript',
],
plugins: ['@typescript-eslint'],
rules: {
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/consistent-type-imports': 'error',
'prefer-rest-params': 'off',
'prefer-const': 'off',
'no-var': 'off',
},
},
],
};