-
Notifications
You must be signed in to change notification settings - Fork 90
/
eslint.config.mjs
69 lines (66 loc) · 1.81 KB
/
eslint.config.mjs
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
/**
* Copyright Zendesk, Inc.
*
* Use of this source code is governed under the Apache License, Version 2.0
* found at http://www.apache.org/licenses/LICENSE-2.0.
*/
import prettierConfig from 'eslint-config-prettier';
import config from '@zendeskgarden/eslint-config';
import noticePlugin from '@zendeskgarden/eslint-config/plugins/notice.js';
import reactPlugin from '@zendeskgarden/eslint-config/plugins/react.js';
import typescriptPlugin from '@zendeskgarden/eslint-config/plugins/typescript.js';
import jestPlugin from '@zendeskgarden/eslint-config/plugins/jest.js';
const typescriptRules = {
...typescriptPlugin.rules,
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'logical-assignment-operators': 'off',
'prefer-object-has-own': 'off',
'react/prop-types': 'off'
};
export default [
...config,
noticePlugin,
reactPlugin,
prettierConfig,
{
ignores: ['**/dist']
},
{
rules: {
'sort-imports': 'off',
'react/no-set-state': 'error'
}
},
{
files: ['packages/*/src/**/*.{ts,tsx}'],
ignores: ['packages/.template/**/*.{ts,tsx}'],
...typescriptPlugin,
rules: {
...typescriptRules
}
},
{
files: ['packages/*/src/**/*.spec.{ts,tsx}'],
ignores: ['packages/.template/**/*.spec.{ts,tsx}'],
...typescriptPlugin,
...jestPlugin,
rules: {
...typescriptRules,
...jestPlugin.rules,
'no-console': 'off',
'react/button-has-type': 'off'
}
},
{
files: ['packages/*/demo/**/*.{ts,tsx}'],
ignores: ['packages/.template/**/*.{ts,tsx}'],
...typescriptPlugin,
rules: {
...typescriptRules,
'react/no-array-index-key': 'off'
}
}
];