15 Star 101 Fork 64

337547038/vue-form-design

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
eslint.config.js 2.14 KB
一键复制 编辑 原始数据 按行查看 历史
337547038 提交于 2个月前 . v3.4
import eslint from '@eslint/js'
import globals from 'globals'
import tseslint from 'typescript-eslint'
import eslintPluginVue from 'eslint-plugin-vue'
import stylistic from '@stylistic/eslint-plugin'
export default tseslint.config(
{
ignores: [
'node_modules',
'dist',
'docs',
'public',
],
},
/** js推荐配置 */
eslint.configs.recommended,
/** ts推荐配置 */
...tseslint.configs.recommended,
/** vue推荐配置 */
...eslintPluginVue.configs['flat/recommended'],
stylistic.configs.customize({
indent: 2,
quotes: 'single',
semi: false,
jsx: true,
braceStyle: '1tbs',
arrowParens: 'always',
}),
/**
* javascript 规则
*/
{
files: ['**/*.{js,mjs,cjs,vue}'],
rules: {
'no-console': 'error',
},
},
/**
* 配置全局变量
*/
{
languageOptions: {
globals: {
...globals.browser,
/** 追加一些其他自定义全局规则 */
ace: true,
tinymce: true,
AMap: true,
echarts: true,
getScreenGlobal: true,
},
},
},
/**
* vue 规则
*/
{
files: ['**/*.vue'],
languageOptions: {
parserOptions: {
/** typescript项目需要用到这个 */
parser: tseslint.parser,
ecmaVersion: 'latest',
/** 允许在.vue 文件中使用 JSX */
ecmaFeatures: {
jsx: true,
},
},
},
rules: {
// 在这里追加 vue 规则
'vue/no-mutating-props': [
'error',
{
shallowOnly: true,
},
],
},
},
/**
* typescript 规则
*/
{
files: ['**/*.{ts,tsx,vue}'],
rules: {
'@typescript-eslint/no-explicit-any': ['off'], // 允许使用any
'comma-dangle': 'off', // 最后不加逗号
'@stylistic/comma-dangle': 'off', // 最后不加逗号
'no-case-declarations': 'off', // 允许switch case里使用const
'no-console': 'off',
'@stylistic/indent': ['off', 2],
'vue/multi-word-component-names': 'off',
'@typescript-eslint/no-unused-expressions': 'off', // 允许使用a&&a()这种简单写法
},
},
)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/q337547038/vue-form-design.git
git@gitee.com:q337547038/vue-form-design.git
q337547038
vue-form-design
vue-form-design
main

搜索帮助