eslint.config.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. globals: { ...globals.browser }
  14. },
  15. rules: {
  16. // o que esta config existe para pegar: o `npm run build` passa com identificador
  17. // inexistente no template, e não havia nada apontando símbolo morto
  18. "vue/no-undef-properties": "error",
  19. "vue/no-unused-properties": ["error", { groups: ["props", "setup"] }],
  20. "no-unused-vars": ["error", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
  21. // catch vazio é o idioma correto ao redor de localStorage/JSON.parse, que podem
  22. // falhar em navegação privada e não têm tratamento útil
  23. "no-empty": ["error", { allowEmptyCatch: true }],
  24. // o design system tem componentes de uma palavra por convenção (Spinner)
  25. "vue/multi-word-component-names": "off",
  26. // formatação fica com o editor; aqui só o que indica defeito
  27. "vue/max-attributes-per-line": "off",
  28. "vue/singleline-html-element-content-newline": "off",
  29. "vue/html-self-closing": "off",
  30. "vue/html-indent": "off",
  31. "vue/html-closing-bracket-newline": "off",
  32. "vue/attributes-order": "off",
  33. "vue/first-attribute-linebreak": "off",
  34. "vue/multiline-html-element-content-newline": "off"
  35. }
  36. },
  37. {
  38. files: ["vite.config.js", "eslint.config.js", "scripts/**"],
  39. languageOptions: { globals: { ...globals.node } }
  40. }
  41. ];