eslint.config.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import js from "@eslint/js";
  2. import pluginVue from "eslint-plugin-vue";
  3. import globals from "globals";
  4. export default [
  5. { ignores: ["dist/**", "node_modules/**"] },
  6. js.configs.recommended,
  7. ...pluginVue.configs["flat/recommended"],
  8. {
  9. files: ["**/*.{js,vue}"],
  10. languageOptions: {
  11. ecmaVersion: "latest",
  12. sourceType: "module",
  13. // __APP_VERSION__ é injetado pelo `define` do vite.config.js
  14. globals: { ...globals.browser, __APP_VERSION__: "readonly" }
  15. },
  16. rules: {
  17. // o que esta config existe para pegar: o `npm run build` passa com identificador
  18. // inexistente no template, e não havia nada apontando símbolo morto
  19. "vue/no-undef-properties": "error",
  20. "vue/no-unused-properties": ["error", { groups: ["props", "setup"] }],
  21. "no-unused-vars": ["error", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
  22. // catch vazio é o idioma correto ao redor de localStorage/JSON.parse, que podem
  23. // falhar em navegação privada e não têm tratamento útil
  24. "no-empty": ["error", { allowEmptyCatch: true }],
  25. // o design system tem componentes de uma palavra por convenção (Spinner)
  26. "vue/multi-word-component-names": "off",
  27. // formatação fica com o editor; aqui só o que indica defeito
  28. "vue/max-attributes-per-line": "off",
  29. "vue/singleline-html-element-content-newline": "off",
  30. "vue/html-self-closing": "off",
  31. "vue/html-indent": "off",
  32. "vue/html-closing-bracket-newline": "off",
  33. "vue/attributes-order": "off",
  34. "vue/first-attribute-linebreak": "off",
  35. "vue/multiline-html-element-content-newline": "off"
  36. }
  37. },
  38. {
  39. files: ["vite.config.js", "eslint.config.js", "scripts/**"],
  40. languageOptions: { globals: { ...globals.node } }
  41. }
  42. ];