forked from salesforce/sfdx-lwc-jest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
57 lines (55 loc) · 1.94 KB
/
eslint.config.mjs
File metadata and controls
57 lines (55 loc) · 1.94 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
import { defineConfig } from 'eslint/config';
import js from '@eslint/js';
import globals from 'globals';
import header from 'eslint-plugin-header';
import babelParser from '@babel/eslint-parser';
// Workaround for plugin schema validation failing in eslint v9
// Ref: https://github.com/Stuk/eslint-plugin-header/issues/57#issuecomment-2378485611
header.rules.header.meta.schema = false;
export default defineConfig([
js.configs.recommended,
{
languageOptions: {
globals: {
...globals.node,
...globals.jest,
},
},
plugins: { header },
rules: {
'header/header': [
'error',
'block',
[
'',
{
pattern:
'^ \\* Copyright \\(c\\) \\d{4}, ([sS]alesforce.com, inc|Salesforce, Inc)\\.$',
// This copyright text should match the text used in the rollup config
template: ` * Copyright (c) ${new Date().getFullYear()}, Salesforce, Inc.`,
},
' * All rights reserved.',
' * SPDX-License-Identifier: MIT',
' * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT',
' ',
],
1 /* newline after header */,
],
},
},
{
files: ['src/lightning-stubs/**'],
languageOptions: {
globals: { ...globals.browser },
sourceType: 'module',
// Use babel parser for decorator support
parser: babelParser,
parserOptions: {
requireConfigFile: false,
babelOptions: {
plugins: [['@babel/plugin-proposal-decorators', { legacy: true }]],
},
},
},
},
]);