-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
29 lines (26 loc) · 1001 Bytes
/
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
import upleveled, {
noRestrictedSyntaxOptions as upleveledNoRestrictedSyntaxOptions,
} from 'eslint-config-upleveled';
/** @type {import('@typescript-eslint/utils').TSESLint.Linter.RuleLevelAndOptions} */
const noRestrictedSyntaxOptions = [
// 'warn' included
// eslint-disable-next-line rest-spread-spacing -- Allow JSDoc type cast
.../** @type {import('@typescript-eslint/utils').TSESLint.Linter.RuleLevelAndOptions} */ (
upleveledNoRestrictedSyntaxOptions.filter(
(option) =>
!/^Using document\.querySelector\(\) can lead to problems|Using document\.querySelectorAll\(\) can lead to problems|Using document\.getElementById\(\) can lead to problems/.test(
/** @type {{message: string}} */ (option).message,
),
)
),
];
/** @type {import('@typescript-eslint/utils/ts-eslint').FlatConfig.ConfigArray} */
const config = [
...upleveled,
{
rules: {
'no-restricted-syntax': noRestrictedSyntaxOptions,
},
},
];
export default config;