.eslintrc.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. module.exports = {
  2. root: true,
  3. env: {
  4. node: true,
  5. },
  6. extends: [
  7. 'plugin:vue/essential',
  8. '@vue/airbnb',
  9. '@vue/typescript',
  10. 'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
  11. ],
  12. parserOptions: {
  13. parser: '@typescript-eslint/parser',
  14. ecmaFeatures: {
  15. legacyDecorators: true,
  16. },
  17. },
  18. rules: {
  19. // "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
  20. 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
  21. 'vue/no-unused-component': 'off',
  22. 'no-console': 'off',
  23. 'no-irregular-whitespace': 'off',
  24. 'prefer-spread': 0,
  25. 'no-plusplus': 0,
  26. 'max-len': 0,
  27. 'eslint-disable-next-line': 'off',
  28. // 允许class中方法不使用this
  29. 'class-methods-use-this': 'off',
  30. // 允许下划线变量命名
  31. 'no-underscore-dangle': 'off',
  32. // 不强制返回值
  33. 'consistent-return': 'off',
  34. camelcase: 'off',
  35. // 允许循环引入
  36. 'import/no-cycle': 'off',
  37. },
  38. };