-
Notifications
You must be signed in to change notification settings - Fork 2
/
eslint.config.mjs
46 lines (40 loc) · 1.54 KB
/
eslint.config.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
import * as os from 'os'
import nodev20 from '@strv/eslint-config-node/v20'
import nodeopt from '@strv/eslint-config-node/optional'
import nodestyle from '@strv/eslint-config-node/style'
import ts from '@strv/eslint-config-typescript'
import tsoptional from '@strv/eslint-config-typescript/optional'
import tsstyle from '@strv/eslint-config-typescript/style'
import mocha from '@strv/eslint-config-mocha'
const lbstyle = os.platform() === 'win32' ? 'windows' : 'unix'
const globs = {
mjs: '**/*.mjs',
ts: '**/*.ts',
tests: '**/*.test.ts',
}
/** @type {Array<import("eslint").Linter.FlatConfig>} */
const config = [
{ linterOptions: {
reportUnusedDisableDirectives: true,
} },
{ ignores: ['**/*.js', '**/*.d.ts', 'node_modules'] },
{ files: [globs.ts, globs.mjs], ...nodev20 },
{ files: [globs.ts, globs.mjs], ...nodeopt },
{ files: [globs.ts, globs.mjs], ...nodestyle },
{ files: [globs.ts], ...ts },
{ files: [globs.ts], ...tsoptional },
{ files: [globs.ts], ...tsstyle },
{ files: [globs.tests], ...mocha },
// Any custom settings to be applied
{ files: [globs.ts],
languageOptions: {
parserOptions: { project: './tsconfig.json' },
},
rules: {
// This repository is configured so that upon checkout, git should convert line endings to platform-specific
// defaults and convert them back to LF when checking in. As such, we must enforce CRLF endings on Windows,
// otherwise the lint task would fail on Windows systems.
'linebreak-style': ['error', lbstyle],
} },
]
export default config