-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy patheslint.config.js
More file actions
57 lines (52 loc) · 1.59 KB
/
eslint.config.js
File metadata and controls
57 lines (52 loc) · 1.59 KB
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
'use strict';
const { defineConfig } = require('eslint/config');
const eslintJs = require('@eslint/js');
const jestPlugin = require('eslint-plugin-jest');
const salesforceLwcConfig = require('@salesforce/eslint-config-lwc/recommended');
const globals = require('globals');
module.exports = defineConfig([
// Global ignores
{
ignores: [
'src/main/default/staticresources/**', // Ignore third party libraries
'src/test/jest-mocks/lightning/modal.js' // Ignore modal mock as it contains decorators (unsupported by ESLint)
]
},
// LWC configuration for src/main/default/lwc
{
files: ['src/main/default/lwc/**/*.js'],
extends: [salesforceLwcConfig]
},
// LWC configuration with override for LWC test files
{
files: ['src/main/default/lwc/**/*.test.js'],
extends: [salesforceLwcConfig],
rules: {
'@lwc/lwc/no-unexpected-wire-adapter-usages': 'off'
},
languageOptions: {
globals: {
...globals.node
}
}
},
// Jest mocks configuration
{
files: ['src/test/jest-mocks/**/*.js'],
languageOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
globals: {
...globals.node,
...globals.es2021,
...jestPlugin.environments.globals.globals,
CustomEvent: 'readonly',
window: 'readonly'
}
},
plugins: {
eslintJs
},
extends: ['eslintJs/recommended']
}
]);