Files
web/eslint.config.mjs

37 lines
1.0 KiB
JavaScript
Raw Normal View History

2025-06-06 16:20:23 +08:00
import {dirname} from 'path'
import {fileURLToPath} from 'url'
import {FlatCompat} from '@eslint/eslintrc'
2025-03-28 15:00:46 +08:00
import stylistic from '@stylistic/eslint-plugin'
2025-03-04 10:10:35 +08:00
2025-03-28 15:00:46 +08:00
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
2025-03-04 10:10:35 +08:00
const compat = new FlatCompat({
baseDirectory: __dirname,
2025-03-28 15:00:46 +08:00
})
2025-03-04 10:10:35 +08:00
2025-03-28 15:00:46 +08:00
// noinspection SpellCheckingInspection
2025-03-04 10:10:35 +08:00
const eslintConfig = [
2025-03-28 15:00:46 +08:00
...compat.extends('next/core-web-vitals', 'next/typescript'),
2025-06-06 16:20:23 +08:00
stylistic.configs.recommended,
2025-03-11 14:57:23 +08:00
{
rules: {
'@stylistic/indent': ['error', 2, {
SwitchCase: 0,
}],
2025-06-06 16:20:23 +08:00
'@stylistic/object-curly-spacing': ['error', 'never'],
'@stylistic/jsx-tag-spacing': ['error', {
beforeSelfClosing: 'never',
}],
'@stylistic/jsx-closing-bracket-location': 'off',
'@stylistic/jsx-curly-newline': 'off',
'@stylistic/multiline-ternary': 'off',
'@stylistic/block-spacing': 'off',
2025-03-11 14:57:23 +08:00
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
2025-03-28 15:00:46 +08:00
]
2025-03-04 10:10:35 +08:00
2025-03-28 15:00:46 +08:00
export default eslintConfig