-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.typed.mjs
55 lines (54 loc) · 1.71 KB
/
eslint.config.typed.mjs
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
import eslintConfig, { NAMING_CONVENTION_SELECTORS } from './eslint.config.mjs'
import tsEslint from 'typescript-eslint'
// noinspection JSUnusedGlobalSymbols
export default tsEslint.config(
...eslintConfig,
{
files: ['**/*.ts'],
extends: [
...tsEslint.configs.recommendedTypeCheckedOnly,
...tsEslint.configs.stylisticTypeCheckedOnly,
],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
'@typescript-eslint/naming-convention': [
'error',
...NAMING_CONVENTION_SELECTORS,
// https://github.com/typescript-eslint/typescript-eslint/blob/v8.16.0/packages/eslint-plugin/docs/rules/naming-convention.mdx#enforce-that-boolean-variables-are-prefixed-with-an-allowed-verb
{
selector: [
// `member-like` without:
// - `property`: will be specified later, with exceptions
// - `enumMember`: no types allowed
// - `method`: no types allowed
'classicAccessor',
'autoAccessor',
'parameterProperty',
// All `property` but `objectLiteralProperty`
'classProperty',
'typeProperty',
// The rest
'parameter',
'variable',
],
types: ['boolean'],
format: ['PascalCase'],
prefix: ['is', 'should', 'has', 'can', 'did', 'will'],
leadingUnderscore: 'allow',
},
],
},
},
{
files: ['src/**/*.spec.ts'],
rules: {
// 👇 To refer to spied object methods (i.e.: created with `createSpyObj`)
'@typescript-eslint/unbound-method': 'off',
},
},
)