feat(init): init project
This commit is contained in:
39
eslint.config.js
Normal file
39
eslint.config.js
Normal file
@@ -0,0 +1,39 @@
|
||||
import js from '@eslint/js'
|
||||
import globals from 'globals'
|
||||
import reactHooks from 'eslint-plugin-react-hooks'
|
||||
import reactRefresh from 'eslint-plugin-react-refresh'
|
||||
import tseslint from 'typescript-eslint'
|
||||
import { defineConfig, globalIgnores } from 'eslint/config'
|
||||
|
||||
export default defineConfig([
|
||||
globalIgnores(['dist']),
|
||||
{
|
||||
files: ['**/*.{ts,tsx}'],
|
||||
extends: [
|
||||
js.configs.recommended,
|
||||
tseslint.configs.recommended,
|
||||
reactHooks.configs['recommended-latest'],
|
||||
reactRefresh.configs.vite,
|
||||
],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2020,
|
||||
globals: globals.browser,
|
||||
},
|
||||
rules: {
|
||||
// Prettier 规则
|
||||
"prettier/prettier": [
|
||||
"error",
|
||||
{
|
||||
semi: true, // 自动加分号
|
||||
singleQuote: true, // 单引号
|
||||
trailingComma: "all", // 尾逗号
|
||||
tabWidth: 2, // 缩进 2 空格
|
||||
printWidth: 100, // 每行最大长度
|
||||
},
|
||||
],
|
||||
// ESLint 规则覆盖
|
||||
semi: ["error", "always"],
|
||||
|
||||
}
|
||||
},
|
||||
])
|
||||
Reference in New Issue
Block a user