.eslintrc.cjs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  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. "./.eslintrc-auto-import.json",
  13. ],
  14. parserOptions: {
  15. ecmaVersion: 2020,
  16. },
  17. rules: {
  18. indent: ["off", 2],
  19. "@typescript-eslint/no-var-requires": "off",
  20. "@typescript-eslint/no-explicit-any": ["off"],
  21. // 关闭名称校验
  22. "vue/multi-word-component-names": "off",
  23. "no-unused-vars": "off",
  24. "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
  25. "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
  26. "@typescript-eslint/no-this-alias": [
  27. "error",
  28. {
  29. allowDestructuring: false, // Disallow `const { props, state } = this`; true by default
  30. allowedNames: ["that"], // Allow `const self = this`; `[]` by default
  31. },
  32. ],
  33. },
  34. }