.eslintrc.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. module.exports = {
  2. root: true,
  3. env: {
  4. node: true
  5. },
  6. // parser: "@typescript-eslint/parser",
  7. // plugins: [
  8. // "@typescript-eslint"
  9. // ],
  10. extends: [
  11. "plugin:vue/essential",
  12. "@vue/standard",
  13. "@vue/typescript"
  14. // "eslint:recommended",
  15. // "plugin:@typescript-eslint/eslint-recommended",
  16. // "plugin:@typescript-eslint/recommended"
  17. ],
  18. // http://eslint.cn/docs/rules
  19. rules: {
  20. "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
  21. "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
  22. indent: ["error", 2, {
  23. SwitchCase: 1,
  24. VariableDeclarator: 1,
  25. outerIIFEBody: 1,
  26. MemberExpression: 1,
  27. ignoreComments: false,
  28. ObjectExpression: 1,
  29. ImportDeclaration: 1,
  30. flatTernaryExpressions: false,
  31. FunctionDeclaration: {
  32. parameters: 1,
  33. body: 1
  34. }
  35. }],
  36. quotes: ["error", "double"],
  37. semi: ["error", "always", { omitLastInOneLineBlock: true }],
  38. "space-before-function-paren": ["error", "never"]
  39. },
  40. parserOptions: {
  41. parser: "@typescript-eslint/parser"
  42. },
  43. overrides: [
  44. {
  45. files: [
  46. "**/__tests__/*.{j,t}s?(x)",
  47. "**/tests/unit/**/*.spec.{j,t}s?(x)"
  48. ],
  49. env: {
  50. jest: true
  51. }
  52. }
  53. ]
  54. };