12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- module.exports = {
- root: true,
- env: {
- browser: true,
- commonjs: true,
- es6: true,
- jest: true,
- jquery: true,
- node: true,
- },
- 'extends': [
- 'eslint:recommended',
- 'plugin:vue/recommended',
- ],
- parserOptions: {
- parser: 'babel-eslint'
- },
- rules: {
- 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
- 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
- 'semi': ['error', 'never'],
- "no-unused-vars": ["warn", {
- "vars": "all",
- "args": "after-used",
- "ignoreRestSiblings": false
- }],
- "keyword-spacing": ["error", { "before": true, "after": true }],
- "object-curly-spacing": ["error", "always"],
- "space-infix-ops": ["error"],
- 'key-spacing': ["error", {
- "mode": "strict"
- }],
- "indent": ["error", 2],
- 'no-trailing-spaces': 'error',
- 'no-empty': 'off',
- // 默认不启用:为了避免细微的 bug,最好直接从 Object.prototype 调用挂载于prototype上的方法方法。例如,foo.hasOwnProperty("bar") 应该替换为 Object.prototype.hasOwnProperty.call(foo, "bar")。
- 'no-prototype-builtins': "off",
- },
- globals: {
- // api: true,
- // config: true,
- // mapGetters: true,
- // store: true,
- utils: true,
- Hammer: true,
- }
- }
|