-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy patheslint.config.mjs
More file actions
45 lines (42 loc) · 1.29 KB
/
eslint.config.mjs
File metadata and controls
45 lines (42 loc) · 1.29 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
/*
* Copyright (c) 2025, Salesforce, Inc.
* SPDX-License-Identifier: Apache-2
* For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0
*/
import {includeIgnoreFile} from '@eslint/compat';
import headerPlugin from 'eslint-plugin-header';
import path from 'node:path';
import {fileURLToPath} from 'node:url';
import tseslint from 'typescript-eslint';
import {copyrightHeader, sharedRules, prettierPlugin} from '../../eslint.config.mjs';
const gitignorePath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '.gitignore');
headerPlugin.rules.header.meta.schema = false;
export default [
includeIgnoreFile(gitignorePath),
{
ignores: ['src/template/**'],
},
...tseslint.configs.recommended,
prettierPlugin,
{
files: ['**/*.ts'],
plugins: {
header: headerPlugin,
},
languageOptions: {
parserOptions: {ecmaVersion: 2022, sourceType: 'module'},
},
rules: {
'header/header': ['error', 'block', copyrightHeader],
...sharedRules,
},
},
{
files: ['src/test/**/*.ts'],
rules: {
// Extension tests run in VS Code test env; allow common test patterns
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
},
},
];