.eslintrc.cjs 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. /* eslint-env node */
  2. require("@rushstack/eslint-patch/modern-module-resolution")
  3. module.exports = {
  4. root: true,
  5. extends: [
  6. "plugin:vue/vue3-essential",
  7. "eslint:recommended",
  8. "@vue/eslint-config-typescript",
  9. "@vue/eslint-config-prettier",
  10. "@vue/typescript/recommended",
  11. "plugin:prettier/recommended",
  12. ],
  13. parserOptions: {
  14. ecmaVersion: 2020,
  15. },
  16. rules: {
  17. indent: ["off", 2],
  18. "@typescript-eslint/no-var-requires": "off",
  19. "@typescript-eslint/no-explicit-any": ["off"],
  20. // 关闭名称校验
  21. "vue/multi-word-component-names": "off",
  22. "no-unused-vars": "off",
  23. "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
  24. "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
  25. "@typescript-eslint/no-this-alias": [
  26. "error",
  27. {
  28. allowDestructuring: false, // Disallow `const { props, state } = this`; true by default
  29. allowedNames: ["that"], // Allow `const self = this`; `[]` by default
  30. },
  31. ],
  32. },
  33. }