1
0

eslint.config.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. // Legacy script tags inject a couple of helpers on window before
  22. // the SPA boots; declared here so no-undef stops flagging them.
  23. getRandomRealityTarget: 'readonly',
  24. },
  25. },
  26. rules: {
  27. 'no-unused-vars': ['warn', {
  28. argsIgnorePattern: '^_',
  29. varsIgnorePattern: '^_',
  30. caughtErrorsIgnorePattern: '^_',
  31. }],
  32. 'no-empty': ['error', { allowEmptyCatch: true }],
  33. 'no-case-declarations': 'off',
  34. // Stylistic rules from vue/recommended that don't match the
  35. // existing codebase formatting. Disable rather than churn the
  36. // whole tree to satisfy them.
  37. 'vue/multi-word-component-names': 'off',
  38. 'vue/no-v-html': 'off',
  39. 'vue/html-self-closing': 'off',
  40. 'vue/max-attributes-per-line': 'off',
  41. 'vue/singleline-html-element-content-newline': 'off',
  42. 'vue/multiline-html-element-content-newline': 'off',
  43. 'vue/html-indent': 'off',
  44. 'vue/html-closing-bracket-newline': 'off',
  45. 'vue/attributes-order': 'off',
  46. 'vue/first-attribute-linebreak': 'off',
  47. 'vue/one-component-per-file': 'off',
  48. 'vue/order-in-components': 'off',
  49. 'vue/attribute-hyphenation': 'off',
  50. 'vue/v-on-event-hyphenation': 'off',
  51. // Pervasive in form components ported from the Vue 2 codebase
  52. // (parent passes a reactive object; child mutates it in place).
  53. // Properly fixing this means rewiring those components to emit
  54. // updates — a meaningful architectural change, separate task.
  55. 'vue/no-mutating-props': 'off',
  56. },
  57. },
  58. ];