-
Notifications
You must be signed in to change notification settings - Fork 317
/
.eslintrc.js
166 lines (166 loc) · 4.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
module.exports = {
'root': true,
'extends': [
'plugin:@okta/okta/courage-app', // apply courage-app rules to all files including properties
],
'parser': '@babel/eslint-parser',
'parserOptions': {
'sourceType': 'module',
'ecmaVersion': 2017
},
'plugins': [
'@typescript-eslint',
'import',
'compat'
],
'settings': {
'import/parsers': {
'@typescript-eslint/parser': ['.ts']
},
},
'overrides': [
{
// temporarily ignoring files that violate the @okta/okta/no-exclusive-language rule
'files': [
'packages/**/login*.properties', // "oktamastered"
'packages/**/country_fr.properties', // "yougoslave"
],
'rules': {
'@okta/okta/no-exclusive-language': 0,
},
},
{
'files': [
// ignore all translations except for login.properties
'packages/**/login_*.properties',
'packages/**/country*.properties',
],
'rules': {
'@okta/okta/no-missing-i18n-comments': 'off',
},
},
{
'files': ['*.js'],
'extends': [
'eslint:recommended',
],
'env': {
'browser': true,
'jasmine': true,
'node': true,
'amd': true
},
'plugins': [
'eslint-plugin-local-rules',
'eslint-plugin-no-only-tests'
],
'globals': {
'spyOnEvent': false,
'JSON': true,
'DEBUG': true,
'Promise': true
},
'rules': {
'camelcase': 2,
'complexity': [2, 10],
'curly': 2,
'eqeqeq': 2,
'guard-for-in': 2,
'indent': [2, 2, { 'VariableDeclarator': 2 }],
'max-depth': [2, 2],
'max-len': [2, 120],
'max-params': [2, 10],
'max-statements': [2, 20],
'new-cap': [2, { 'properties': false, 'capIsNewExceptions': ['Q'] }],
'no-caller': 2,
'no-eval': 2,
'no-implied-eval': 2,
'no-new': 2,
'no-unused-expressions': [2, { 'allowShortCircuit': true, 'allowTernary': true }],
'no-use-before-define': [2, 'nofunc'],
'no-only-tests/no-only-tests': 'error',
'quotes': [2, 'single'],
'semi': 2,
'space-before-function-paren': [2, {
'anonymous': 'never',
'named': 'never',
'asyncArrow': 'always'
}],
'strict': 0,
},
},
{
'files': ['src/**/*'],
'extends': [
'plugin:compat/recommended',
'plugin:import/recommended'
],
'settings': {
'import/resolver': {
'typescript': {
'project': './'
}
},
'polyfills': [
'Promise' // Assume Promise is polyfilled for IE11
]
},
'rules': {
'import/no-named-as-default-member': 0, // TODO: enable and fix usage with Q
'local-rules/no-bare-templates': 2, // we dont want no-bare-templates rule to be applied to test files
},
'env': {
// Setting browser to true enables many global variables which may obscure actual errors
// Instead we specifically enumerate globals below
'browser': false,
},
'globals': {
'window': true,
'document': true,
'navigator': true,
'localStorage': true,
'sessionStorage': true,
'AbortController': true,
},
'overrides': [
{
// temporarily ignoring files that violate @okta/okta/no-unlocalized-text-in-templates rule
'files': [
'src/**/CustomButtons.js',
'src/**/SignInWithIdps.js',
],
'rules': {
'@okta/okta/no-unlocalized-text-in-templates': 0,
},
},
]
},
{
'files': ['playground/**/*.json', 'packages/**/*.json'],
'extends': [
'plugin:json/recommended',
],
'rules': {
'local-rules/no-missing-keys': 2,
'local-rules/no-missing-api-keys': 2,
},
},
{
files: ['**/*.ts'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020
},
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
],
rules: {
// TODO: enable these rules
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/explicit-module-boundary-types': 0
}
},
],
};