eslint.config.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import js from '@eslint/js';
  2. import vue from 'eslint-plugin-vue';
  3. import vueParser from 'vue-eslint-parser';
  4. import globals from 'globals';
  5. export default [
  6. { ignores: ['node_modules/**', '../web/dist/**'] },
  7. js.configs.recommended,
  8. ...vue.configs['flat/recommended'],
  9. {
  10. files: ['**/*.{js,vue}'],
  11. languageOptions: {
  12. ecmaVersion: 2022,
  13. sourceType: 'module',
  14. parser: vueParser,
  15. parserOptions: {
  16. ecmaFeatures: { jsx: false },
  17. },
  18. globals: {
  19. ...globals.browser,
  20. ...globals.node,
  21. },
  22. },
  23. rules: {
  24. 'no-unused-vars': ['warn', {
  25. argsIgnorePattern: '^_',
  26. varsIgnorePattern: '^_',
  27. caughtErrorsIgnorePattern: '^_',
  28. }],
  29. 'no-empty': ['error', { allowEmptyCatch: true }],
  30. 'no-case-declarations': 'off',
  31. // Stylistic rules from vue/recommended that don't match the
  32. // existing codebase formatting. Disable rather than churn the
  33. // whole tree to satisfy them.
  34. 'vue/multi-word-component-names': 'off',
  35. 'vue/no-v-html': 'off',
  36. 'vue/html-self-closing': 'off',
  37. 'vue/max-attributes-per-line': 'off',
  38. 'vue/singleline-html-element-content-newline': 'off',
  39. 'vue/multiline-html-element-content-newline': 'off',
  40. 'vue/html-indent': 'off',
  41. 'vue/html-closing-bracket-newline': 'off',
  42. 'vue/attributes-order': 'off',
  43. 'vue/first-attribute-linebreak': 'off',
  44. 'vue/one-component-per-file': 'off',
  45. 'vue/order-in-components': 'off',
  46. 'vue/attribute-hyphenation': 'off',
  47. 'vue/v-on-event-hyphenation': 'off',
  48. // Pervasive in form components ported from the Vue 2 codebase
  49. // (parent passes a reactive object; child mutates it in place).
  50. // Properly fixing this means rewiring those components to emit
  51. // updates — a meaningful architectural change, separate task.
  52. 'vue/no-mutating-props': 'off',
  53. },
  54. },
  55. ];