.eslintrc 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. {
  2. "parser": "@babel/eslint-parser",
  3. "plugins": ["babel", "vue", "import", "node", "promise"],
  4. "env": {
  5. "browser": true,
  6. "node": true,
  7. "es6": true,
  8. "jest": true
  9. },
  10. "extends": [
  11. "plugin:vue/vue3-essential",
  12. "eslint:recommended"
  13. ],
  14. "parserOptions": {
  15. "ecmaVersion": "latest"
  16. },
  17. "rules": {
  18. "radix": "off",
  19. "array-callback-return": "error",
  20. "object-curly-spacing": ["error", "always"],
  21. "curly": ["error", "all"],
  22. "brace-style": ["error", "1tbs"],
  23. "space-before-blocks": "error",
  24. "space-before-function-paren": ["error", {
  25. "anonymous": "never",
  26. "named": "never",
  27. "asyncArrow": "always"
  28. }],
  29. "keyword-spacing": ["error", { "before": true, "after": true }],
  30. "no-undef": "error",
  31. "no-trailing-spaces": "error",
  32. "semi": "error",
  33. "arrow-parens": ["error", "always"],
  34. "camelcase": "error",
  35. "arrow-body-style": "off",
  36. "array-bracket-spacing": "error",
  37. "quotes": ["error", "single", { "avoidEscape": true }],
  38. "prefer-template": "error",
  39. "no-tabs": "error",
  40. "import/no-duplicates": "error",
  41. "no-unused-vars": "error",
  42. "no-unused-expressions": "off",
  43. "no-useless-rename": "off",
  44. "no-await-in-loop": "off",
  45. "no-lonely-if": "off",
  46. "guard-for-in": "off",
  47. "function-paren-newline": "off",
  48. "indent": ["error", 2, { "SwitchCase": 1 }],
  49. "no-case-declarations": "off",
  50. "no-restricted-syntax": "off",
  51. "no-new": "off",
  52. "symbol-description": "off",
  53. "comma-dangle": "off",
  54. "no-empty": [2, { "allowEmptyCatch": true }],
  55. "lines-between-class-members": "off",
  56. "no-fallthrough": "off",
  57. "func-names": "off",
  58. "operator-linebreak": "off",
  59. "no-var": 2,
  60. "quote-props": "off",
  61. "prefer-arrow-callback": "off", // would like to remove this rule https://eslint.org/docs/rules/prefer-arrow-callback#require-using-arrow-functions-for-callbacks-prefer-arrow-callback
  62. "dot-notation": "off",
  63. "class-methods-use-this": "off",
  64. "object-curly-newline": "off",
  65. "vars-on-top": "off",
  66. "prefer-destructuring": "off",
  67. "eol-last": "off",
  68. "max-len": "off",
  69. "prefer-rest-params": "off", // would like to remove this rule https://eslint.org/docs/rules/prefer-rest-params#suggest-using-the-rest-parameters-instead-of-arguments-prefer-rest-params
  70. "no-underscore-dangle": "off",
  71. "object-shorthand": "off", // would like to remove this rule https://eslint.org/docs/rules/object-shorthand#require-object-literal-shorthand-syntax-object-shorthand
  72. "no-console": ["error", { "allow": ["warn", "error"] }],
  73. "no-param-reassign": "off",
  74. "no-plusplus": "off",
  75. "consistent-return": "off",
  76. "new-cap": "off",
  77. "linebreak-style": "off",
  78. "no-throw-literal": "off",
  79. "no-script-url": "off",
  80. "no-restricted-globals": "off", // would like to remove this rule https://eslint.org/docs/rules/no-restricted-globals#disallow-specific-global-variables-no-restricted-globals
  81. "no-multi-assign": "off", // would like to remove this rule https://eslint.org/docs/rules/no-multi-assign#disallow-use-of-chained-assignment-expressions-no-multi-assign
  82. "no-bitwise": "off",
  83. "no-prototype-builtins": "off",
  84. "no-nested-ternary": "off",
  85. "prefer-promise-reject-errors": "off",
  86. "prefer-spread": "off", // would like to remove this rule https://eslint.org/docs/rules/prefer-spread#suggest-using-spread-syntax-instead-of-apply-prefer-spread
  87. "no-mixed-operators": "off",
  88. "no-cond-assign": "off",
  89. "no-extend-native": "off", // would be nice to remove, not critical https://eslint.org/docs/rules/no-extend-native#disallow-extending-of-native-objects-no-extend-native
  90. "no-restricted-properties": "off",
  91. "no-proto": "off", // would like to remove this rule https://eslint.org/docs/rules/no-proto#disallow-use-of-__proto__-no-proto
  92. "no-continue": "off",
  93. "default-case": "off",
  94. "no-shadow": "off", // would like to eventually remove this but its super hard right now https://eslint.org/docs/rules/no-shadow#disallow-variable-declarations-from-shadowing-variables-declared-in-the-outer-scope-no-shadow
  95. "no-useless-escape": "off",
  96. "wrap-iife": "off",
  97. "import/no-cycle": "off",
  98. "import/order": "off",
  99. "import/named": "off",
  100. "import/no-named-as-default": "off",
  101. "import/prefer-default-export": "off",
  102. "import/no-extraneous-dependencies": "off",
  103. "import/no-unresolved": "off",
  104. "import/no-webpack-loader-syntax": "off",
  105. "import/extensions": [
  106. "error",
  107. "ignorePackages",
  108. {
  109. "js": "never",
  110. "ts": "never"
  111. }
  112. ],
  113. "@typescript-eslint/no-useless-constructor": "off",
  114. "@typescript-eslint/explicit-function-return-type": "off",
  115. "@typescript-eslint/no-this-alias": "off",
  116. "@typescript-eslint/no-empty-function": "off",
  117. "@typescript-eslint/camelcase": "off",
  118. "@typescript-eslint/ban-ts-ignore": "off",
  119. "@typescript-eslint/no-explicit-any": "off",
  120. "@typescript-eslint/no-empty-interface": "off",
  121. "@typescript-eslint/no-use-before-define": "off",
  122. "@typescript-eslint/class-name-casing": "off",
  123. "@typescript-eslint/no-unused-vars": "off",
  124. "@pdftron/webviewer/no-string-events": "off",
  125. "react/prop-types": "off"
  126. },
  127. "overrides": [
  128. {
  129. "files": "**/*.ts",
  130. "rules": {
  131. "no-useless-constructor": "off"
  132. }
  133. },
  134. {
  135. "files": "**/*.stories.js",
  136. "rules": {
  137. "no-console": "off",
  138. "react/prop-types": "off",
  139. "no-alert": "off",
  140. "no-unused-vars": "off",
  141. "@typescript-eslint/no-useless-constructor": "off",
  142. "no-useless-constructor": "off"
  143. }
  144. },
  145. {
  146. "files": "**/*.spec.js",
  147. "rules": {
  148. "no-console": "off",
  149. "no-undef": "off",
  150. "no-unused-vars": "off",
  151. "no-alert": "off",
  152. "@typescript-eslint/no-useless-constructor": "off",
  153. "no-useless-constructor": "off"
  154. }
  155. },
  156. {
  157. "files": "**/*.test.js",
  158. "rules": {
  159. "no-console": "off",
  160. "no-undef": "off",
  161. "no-unused-vars": "off",
  162. "no-alert": "off",
  163. "@typescript-eslint/no-useless-constructor": "off",
  164. "no-useless-constructor": "off"
  165. }
  166. }
  167. ]
  168. }