npm-cts-ui
Version:
UI KIT for Taro
44 lines (38 loc) • 1.61 kB
JavaScript
// https://eslint.org/docs/user-guide/configuring
module.exports = {
root: true, // 一旦发现配置文件中有root: true,它就会停止在父级目录中寻找。除了.eslintrc.js文件
parserOptions: {
parser: 'babel-eslint'
},
env: {
browser: true
},
extends: [
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules. 考虑切换到“plugin:vue/strongly-recommended”或“plugin:vue/recommended”以获得更严格的规则。
// "plugin:vue/essential",
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
// 'standard'
// 'eslint:recommended',
// '@vue/prettier'
// "plugin:prettier/recommended",
'plugin:react/essential',
'eslint:recommended'
],
// required to lint *.vue files
plugins: ['react'],
// add your custom rules here
rules: {
// allow async-await 强制 generator 函数中 * 号周围使用一致的空格
'generator-star-spacing': 'off',
// allow debugger during development 禁用 debugger
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
// 要求或禁止文件末尾存在空行
// "eol-last": ["off", "never"]
// 是否分号结尾,always:默认,要求在语句末尾使用分号,never:禁止在语句末尾使用分号
semi: [2, 'never'],
// 引号类型,使用单引号
quotes: [2, 'single'],
'prettier/prettier': 'off'
}
}