54 lines
1.3 KiB
JavaScript
54 lines
1.3 KiB
JavaScript
// @ts-check
|
|
|
|
import eslint from '@eslint/js';
|
|
import tseslint from 'typescript-eslint';
|
|
import * as path from 'node:path';
|
|
import * as url from 'node:url';
|
|
|
|
export default tseslint.config(
|
|
eslint.configs.recommended,
|
|
tseslint.configs.strictTypeChecked,
|
|
tseslint.configs.stylisticTypeChecked,
|
|
{
|
|
languageOptions: {
|
|
parserOptions: {
|
|
projectService: {
|
|
allowDefaultProject: [
|
|
'eslint.config.mjs'
|
|
]
|
|
},
|
|
tsconfigRootDir: path.dirname(url.fileURLToPath(import.meta.url))
|
|
}
|
|
},
|
|
rules: {
|
|
'@typescript-eslint/no-unnecessary-condition': [
|
|
'error',
|
|
{
|
|
allowConstantLoopConditions: 'only-allowed-literals'
|
|
}
|
|
],
|
|
quotes: [
|
|
'error',
|
|
'single',
|
|
{
|
|
allowTemplateLiterals: true
|
|
}
|
|
],
|
|
semi: 'error',
|
|
indent: [
|
|
'error',
|
|
4,
|
|
{
|
|
SwitchCase: 1
|
|
}
|
|
],
|
|
eqeqeq: 'error'
|
|
}
|
|
},
|
|
{
|
|
ignores: [
|
|
'build/',
|
|
'node_modules/'
|
|
]
|
|
}
|
|
); |