2025-03-28 15:00:46 +08:00
|
|
|
import { dirname } from 'path'
|
|
|
|
|
import { fileURLToPath } from 'url'
|
|
|
|
|
import { FlatCompat } from '@eslint/eslintrc'
|
|
|
|
|
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-03-11 14:57:23 +08:00
|
|
|
{
|
2025-03-28 15:00:46 +08:00
|
|
|
plugins: {
|
|
|
|
|
'@stylistic': stylistic,
|
|
|
|
|
},
|
2025-03-11 14:57:23 +08:00
|
|
|
rules: {
|
2025-03-28 15:00:46 +08:00
|
|
|
'semi': ['error', 'never'],
|
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
|
|
|
'@stylistic/member-delimiter-style': ['error', {
|
|
|
|
|
multiline: {
|
|
|
|
|
delimiter: 'none',
|
|
|
|
|
requireLast: true,
|
|
|
|
|
},
|
|
|
|
|
singleline: {
|
|
|
|
|
delimiter: 'comma',
|
|
|
|
|
requireLast: false,
|
|
|
|
|
},
|
|
|
|
|
}],
|
2025-03-11 14:57:23 +08:00
|
|
|
},
|
|
|
|
|
},
|
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
|