.eslintrc.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. module.exports = {
  2. root: true,
  3. env: {
  4. browser: true,
  5. node: true,
  6. commonjs: true,
  7. es6: true,
  8. amd: true,
  9. },
  10. globals: {},
  11. extends: ['plugin:vue/vue3-essential', 'airbnb-base'],
  12. parserOptions: {
  13. ecmaVersion: 2020,
  14. sourceType: 'module'
  15. },
  16. settings: {
  17. 'import/resolver': {
  18. node: {
  19. extensions: ['.js', '.jsx', 'vue'],
  20. },
  21. },
  22. },
  23. plugins: ['prettier'],
  24. rules: {
  25. // 0表示不不处理,1表示警告,2表示错误并退出
  26. 'vue/multi-word-component-names': 'off', // 要求组件名称始终为多字
  27. "no-tabs":"off",
  28. // camelcase: 1, // 驼峰命名
  29. // 'prettier/prettier': 0, // 会优先采用prettierrc.json的配置,不符合规则会提示错误
  30. // 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
  31. // 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
  32. // 'comma-dangle': 'off',
  33. // 'import/prefer-default-export': 'off', // 优先export default导出
  34. // 'no-param-reassign': 'off', // 函数参数属性的赋值
  35. // semi: [2, 'never'],
  36. // 'no-unused-expressions': 'off', // 联式调用使用?
  37. // 'import/no-cycle': 'off', // 导入循环引用报错
  38. // 'arrow-parens': 'off', // 箭头函数一个参数可以不要括号
  39. // 'no-underscore-dangle': 'off', // 无下划线
  40. // 'no-plusplus': 'off', // 使用一元运算符
  41. // 'object-curly-newline': 'off',
  42. // 'no-restricted-syntax': 'off', // 使用for of
  43. // 'operator-linebreak': 'off', // after
  44. // 'arrow-body-style': 'off',
  45. // // 暂时屏蔽检测@别名
  46. // 'import/no-useless-path-segments': 'off',
  47. // 'import/no-unresolved': 'off',
  48. // 'import/extensions': 'off',
  49. // 'import/no-absolute-path': 'off',
  50. // 'import/no-extraneous-dependencies': 'off',
  51. // 'newline-per-chained-call': ['error', { ignoreChainWithDepth: 10 }],
  52. // 'linebreak-style': [0, 'error', 'windows'],
  53. // 'no-shadow': 'off', // 注意你必须禁用基本规则,因为它可以报告不正确的错误
  54. // 'keyword-spacing': [
  55. // 2,
  56. // {
  57. // before: true,
  58. // after: true,
  59. // },
  60. // ] // 强制在关键字前后使用一致的空格
  61. }
  62. }