更新 eslint 配置
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { dirname } from 'path'
|
||||
import { fileURLToPath } from 'url'
|
||||
import { FlatCompat } from '@eslint/eslintrc'
|
||||
import {dirname} from 'path'
|
||||
import {fileURLToPath} from 'url'
|
||||
import {FlatCompat} from '@eslint/eslintrc'
|
||||
import stylistic from '@stylistic/eslint-plugin'
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
@@ -13,25 +13,15 @@ const compat = new FlatCompat({
|
||||
// noinspection SpellCheckingInspection
|
||||
const eslintConfig = [
|
||||
...compat.extends('next/core-web-vitals', 'next/typescript'),
|
||||
stylistic.configs.recommended,
|
||||
{
|
||||
plugins: {
|
||||
'@stylistic': stylistic,
|
||||
},
|
||||
rules: {
|
||||
'@stylistic/semi': ['error', 'never'],
|
||||
'@stylistic/indent': ['error', 2],
|
||||
'@stylistic/object-curly-spacing': ['error', 'never'],
|
||||
'@stylistic/jsx-tag-spacing': ['error', {
|
||||
beforeSelfClosing: 'never',
|
||||
}],
|
||||
'@typescript-eslint/no-empty-object-type': 'off',
|
||||
'@typescript-eslint/no-unused-vars': 'off',
|
||||
'@stylistic/member-delimiter-style': ['error', {
|
||||
multiline: {
|
||||
delimiter: 'none',
|
||||
requireLast: true,
|
||||
},
|
||||
singleline: {
|
||||
delimiter: 'comma',
|
||||
requireLast: false,
|
||||
},
|
||||
}],
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user