This repository has been archived by the owner on Mar 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 83
/
.eslintrc.js
119 lines (117 loc) · 2.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
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/**
* @license
*
* Copyright IBM Corp. 2019, 2021
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
const restrictedGlobals = require('eslint-restricted-globals');
module.exports = {
extends: ['airbnb-base', 'plugin:prettier/recommended'],
plugins: ['babel'],
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 6,
sourceType: 'script',
},
env: {
node: true,
es6: true,
browser: true,
},
rules: {
'max-len': [2, 130, 4],
'no-param-reassign': [
2,
{
props: false,
},
],
'no-plusplus': 0,
'no-underscore-dangle': 0,
'prefer-rest-params': 0,
'no-restricted-globals': ['error', 'isFinite'].concat(restrictedGlobals),
'no-unused-expressions': 0,
'babel/no-unused-expressions': 2,
'import/extensions': 0,
'import/no-extraneous-dependencies': [
2,
{
devDependencies: true,
optionalDependencies: false,
peerDependencies: false,
},
],
'import/no-unresolved': [2, { ignore: ['^carbon-web-components/es/icons/'] }],
'max-classes-per-file': 0,
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.ts', '.d.ts'],
},
},
},
overrides: [
{
files: ['**/*.ts'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
rules: {
'no-unused-vars': 0,
'@typescript-eslint/no-unused-vars': 2,
},
},
{
files: ['**/*-react.tsx'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'react'],
rules: {
'no-unused-vars': 0,
'@typescript-eslint/no-unused-vars': 2,
'import/no-unresolved': [2, { ignore: ['^carbon-web-components/es/(components-react|icons)/'] }],
'react/jsx-uses-react': 2,
'react/jsx-uses-vars': 2,
},
},
{
files: ['**/defs.ts'],
rules: {
'import/prefer-default-export': 0,
},
},
{
files: ['examples/codesandbox/**/*.js', 'examples/codesandbox/**/*.ts'],
parserOptions: {
sourceType: 'module',
},
rules: {
'import/no-unresolved': 0,
},
},
{
files: ['examples/codesandbox/{react*,next,form/redux-form}/**/*.js'],
plugins: ['react'],
rules: {
'react/jsx-uses-react': 2,
'react/jsx-uses-vars': 2,
},
},
{
files: ['examples/codesandbox/**/app.js', 'examples/codesandbox/**/babel-plugin-*.js'],
parserOptions: {
sourceType: 'script',
},
rules: {
'import/no-unresolved': 2,
},
},
{
files: ['examples/codesandbox/**/*.config.js'],
parserOptions: {
sourceType: 'script',
},
},
],
};