Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
eslint.config.js 1.06 KB
Copy Edit Raw Blame History
yujinliang authored 2024-07-16 16:05 . 处理eslint与prettier兼容
import globals from 'globals'
import pluginJs from '@eslint/js'
import tseslint from 'typescript-eslint'
import pluginVue from 'eslint-plugin-vue'
import eslintConfigPrettier from 'eslint-config-prettier'
import eslintPluginPrettier from 'eslint-plugin-prettier'
export default [
{ files: ['**/*.{js,mjs,cjs,ts,vue}'] },
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
...pluginVue.configs['flat/essential'],
// ...pluginVue.configs['flat/recommended'],
{
files: ['*.vue', '**/*.vue'],
languageOptions: {
parserOptions: {
parser: '@typescript-eslint/parser'
}
}
},
{
// 忽略配置
ignores: [
// "src/components/**/*",
],
plugins: {
prettier: eslintPluginPrettier
},
rules: {
'prettier/prettier': ['error'], // 开启 prettier 规则,设置为 error 表示不遵守 prettier 将被视为错误
...eslintConfigPrettier.rules,
...eslintPluginPrettier.configs.recommended.rules
}
}
]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化