.eslintrc.cjs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* eslint-env node */
  2. require('@rushstack/eslint-patch/modern-module-resolution')
  3. module.exports = {
  4. root: true,
  5. extends: [
  6. 'plugin:vue/vue3-essential',
  7. 'eslint:recommended',
  8. '@vue/eslint-config-typescript'
  9. ],
  10. parserOptions: {
  11. ecmaVersion: 'latest'
  12. },
  13. rules: {
  14. 'curly': ['error', 'multi-line'],
  15. 'eqeqeq': ['error', 'always'],
  16. 'semi': ['error', 'never'],
  17. 'indent': ['error', 2, {
  18. 'SwitchCase': 1,
  19. }],
  20. 'quotes': ['error', 'single', {
  21. 'avoidEscape': true,
  22. 'allowTemplateLiterals': true,
  23. }],
  24. 'key-spacing': ['error', {
  25. 'beforeColon': false,
  26. 'afterColon': true,
  27. 'mode': 'strict',
  28. }],
  29. 'no-empty': 'error',
  30. 'no-else-return': 'error',
  31. 'no-multi-spaces': 'error',
  32. 'require-await': 'error',
  33. 'brace-style': ['error', 'stroustrup'],
  34. 'spaced-comment': ['error', 'always'],
  35. 'arrow-spacing': 'error',
  36. 'no-duplicate-imports': 'error',
  37. 'comma-spacing': ['error', {
  38. 'before': false,
  39. 'after': true,
  40. }],
  41. 'default-case': 'error',
  42. 'consistent-this': ['error', '_this'],
  43. 'max-depth': ['error', 8],
  44. 'max-lines': ['error', 1000],
  45. 'no-multi-str': 'error',
  46. 'space-infix-ops': 'error',
  47. 'space-before-blocks': ['error', 'always'],
  48. 'space-before-function-paren': ['error', {
  49. 'named': 'never',
  50. 'anonymous': 'never',
  51. 'asyncArrow': 'always',
  52. }],
  53. 'keyword-spacing': ['error'],
  54. 'prefer-const': 'error',
  55. 'no-useless-return': 'error',
  56. 'array-bracket-spacing': 'error',
  57. 'no-useless-escape': 'off',
  58. 'no-eval': 'error',
  59. 'no-var': 'error',
  60. 'no-with': 'error',
  61. 'no-alert': 'warn',
  62. 'no-console': 'warn',
  63. 'no-debugger': 'error',
  64. '@typescript-eslint/explicit-module-boundary-types': 'off',
  65. '@typescript-eslint/ban-types': ['error', {
  66. 'extendDefaults': true,
  67. 'types': {
  68. '{}': false,
  69. },
  70. }],
  71. '@typescript-eslint/no-non-null-assertion': 'off',
  72. '@typescript-eslint/consistent-type-imports': 'error',
  73. 'vue/multi-word-component-names': 'off',
  74. 'vue/no-reserved-component-names': 'off',
  75. }
  76. }