-
Notifications
You must be signed in to change notification settings - Fork 131
/
.eslintrc.js
54 lines (54 loc) · 1.66 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
module.exports = {
extends: '@redhat-cloud-services/eslint-config-redhat-cloud-services',
globals: {
insights: 'writable',
},
rules: {
'sort-imports': [
2,
{
ignoreDeclarationSort: true,
},
],
},
overrides: [
{
files: ['**/*.ts', '**/*.tsx', '**/*.js'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: ['plugin:@typescript-eslint/recommended'],
rules: {
'react/prop-types': 'off',
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true, args: 'after-used' }],
'@typescript-eslint/no-explicit-any': 'warn',
'no-restricted-imports': [
'error',
{
// restrict importing auth packages methods directly
// Use of the ChromeAuthContext must be enforced
paths: [
{
name: 'react-oidc-context',
message: 'Do not import react-oidc-context directly. Use the ChromeAuthContext instead!',
},
{
name: 'oidc-client-ts',
message: 'Do not import oidc-client-ts directly. Use the ChromeAuthContext instead!',
},
],
patterns: [
{
group: ['**/cognito/*'],
message: 'Do not import cognito auth methods directly. Use the ChromeAuthContext instead!',
},
{
group: ['**/OIDCConnector/utils'],
message: 'Do not OIDC auth utils directly. Use the ChromeAuthContext instead!',
},
],
},
],
},
},
],
};