-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
127 lines (126 loc) · 3.85 KB
/
eslint.config.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
const eslint = require('@eslint/js');
const lwc = require('@lwc/eslint-plugin-lwc');
const salesforceLwc = require('@salesforce/eslint-config-lwc/recommended');
const lightning = require('@salesforce/eslint-plugin-lightning');
const aura = require('@salesforce/eslint-plugin-aura');
module.exports = [
{
ignores: ['**/*.xml']
},
{
// Config file specific settings
files: ['*.config.js', '.eslintrc.js'],
languageOptions: {
globals: {
module: 'writable',
require: 'readonly'
}
}
},
eslint.configs.recommended,
{
files: ['**/lwc/**/*.js'],
plugins: {
'@lwc/lwc': lwc,
'@salesforce/lightning': lightning
},
languageOptions: {
globals: {
// Salesforce specific globals
$A: 'readonly',
sforce: 'readonly',
moment: 'readonly',
// Browser globals
window: 'readonly',
document: 'readonly',
console: 'readonly',
navigator: 'readonly',
Audio: 'readonly',
Blob: 'readonly',
MediaRecorder: 'readonly',
FileReader: 'readonly',
clearInterval: 'readonly',
setInterval: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
URL: 'readonly',
requestAnimationFrame: 'readonly',
atob: 'readonly',
fetch: 'readonly',
URLSearchParams: 'readonly',
EventSource: 'readonly',
Event: 'readonly',
Promise: 'readonly'
},
parser: require('@babel/eslint-parser'),
parserOptions: {
requireConfigFile: false,
ecmaVersion: 2022,
sourceType: 'module',
babelOptions: {
plugins: [
[
'@babel/plugin-proposal-decorators',
{
decoratorsBeforeExport: true,
version: '2018-09'
}
]
]
}
}
},
rules: {
...salesforceLwc.rules,
'@lwc/lwc/no-api-reassignments': 'error',
'@salesforce/lightning/valid-apex-method-invocation': 'error',
'@lwc/lwc/no-async-operation': 'off',
'no-return-await': 'off'
}
},
{
files: ['**/__tests__/**/*.js'],
languageOptions: {
globals: {
// Jest globals
describe: 'readonly',
beforeEach: 'readonly',
afterEach: 'readonly',
beforeAll: 'readonly',
afterAll: 'readonly',
it: 'readonly',
expect: 'readonly',
jest: 'readonly',
// Add testing utilities globals
createElement: 'readonly',
getNavigateCalledWith: 'readonly'
}
}
},
{
files: ['**/aura/**/*.js'],
plugins: {
'@salesforce/aura': aura
},
rules: {
// Aura specific rules
'@salesforce/aura/no-deprecated-apis': 'error',
'@salesforce/aura/no-async-operation': 'error'
}
},
{
files: ['*.html'],
rules: {
'css-rcurlyexpected': 'off',
'css-ruleorselectorexpected': 'off',
emptyRules: 'off'
}
},
{
files: ['**/lwc/**/*.js'],
rules: {
'@lwc/lwc/no-inner-html': 'off',
'no-console': 'off'
}
}
];