eslint.config.cjs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // eslint.config.cjs
  2. module.exports = {
  3. root: true,
  4. parser: 'vue-eslint-parser',
  5. parserOptions: {
  6. parser: '@typescript-eslint/parser',
  7. sourceType: 'module',
  8. ecmaVersion: 2020,
  9. ecmaFeatures: {
  10. jsx: true,
  11. },
  12. },
  13. env: {
  14. 'browser': true,
  15. 'node': true,
  16. 'vue/setup-compiler-macros': true,
  17. 'es2020': true
  18. },
  19. plugins: ['@typescript-eslint'],
  20. extends: [
  21. 'airbnb-base',
  22. 'plugin:@typescript-eslint/recommended',
  23. 'plugin:import/recommended',
  24. 'plugin:import/typescript',
  25. 'plugin:vue/vue3-recommended',
  26. 'plugin:prettier/recommended',
  27. ],
  28. settings: {
  29. 'import/resolver': {
  30. typescript: {
  31. project: './tsconfig.json',
  32. },
  33. },
  34. },
  35. rules: {
  36. 'prettier/prettier': 1,
  37. // Vue: Recommended rules to be closed or modify
  38. 'vue/require-default-prop': 0,
  39. 'vue/singleline-html-element-content-newline': 0,
  40. 'vue/max-attributes-per-line': 0,
  41. // Vue: Add extra rules
  42. 'vue/custom-event-name-casing': [2, 'camelCase'],
  43. 'vue/no-v-text': 1,
  44. 'vue/padding-line-between-blocks': 1,
  45. 'vue/require-direct-export': 1,
  46. 'vue/multi-word-component-names': ['error', {
  47. ignores: ['index', 'Index']
  48. }],
  49. // Allow @ts-ignore comment
  50. '@typescript-eslint/ban-ts-comment': 0,
  51. '@typescript-eslint/no-unused-vars': 1,
  52. '@typescript-eslint/no-empty-function': 1,
  53. '@typescript-eslint/no-explicit-any': 0,
  54. '@typescript-eslint/no-require-imports': 0,
  55. 'no-undef': 0,
  56. 'import/extensions': [
  57. 2,
  58. 'ignorePackages',
  59. {
  60. js: 'never',
  61. jsx: 'never',
  62. ts: 'never',
  63. tsx: 'never',
  64. },
  65. ],
  66. 'no-debugger': 'off',
  67. 'no-param-reassign': 0,
  68. 'prefer-regex-literals': 0,
  69. 'import/no-extraneous-dependencies': 0,
  70. },
  71. };