Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

137 rader
4.6 KiB

  1. {
  2. "env": {
  3. "es6": true,
  4. "node": true
  5. },
  6. "extends": [
  7. "eslint:recommended",
  8. "plugin:@typescript-eslint/recommended",
  9. "plugin:@typescript-eslint/recommended-requiring-type-checking",
  10. "plugin:@typescript-eslint/eslint-recommended",
  11. "plugin:import/errors",
  12. "plugin:import/warnings",
  13. "plugin:import/typescript",
  14. "prettier",
  15. "prettier/@typescript-eslint"
  16. ],
  17. "parser": "@typescript-eslint/parser",
  18. "parserOptions": {
  19. "ecmaVersion": 2018,
  20. "sourceType": "module",
  21. "ecmaFeatures": {
  22. "impliedStrict": true
  23. },
  24. "project": "tsconfig.eslint.json"
  25. },
  26. "plugins": ["import", "@typescript-eslint"],
  27. "rules": {
  28. "arrow-parens": ["off"],
  29. "brace-style": ["off", "stroustrup"],
  30. "consistent-return": "error",
  31. "curly": ["error", "multi-line", "consistent"],
  32. "eol-last": "error",
  33. "linebreak-style": ["error", "unix"],
  34. "new-parens": "error",
  35. "no-console": "off",
  36. "no-constant-condition": ["warn", { "checkLoops": false }],
  37. "no-caller": "error",
  38. "no-debugger": "warn",
  39. "no-dupe-class-members": "off",
  40. "no-duplicate-imports": "error",
  41. "no-else-return": "warn",
  42. "no-empty": ["warn", { "allowEmptyCatch": true }],
  43. "no-eval": "error",
  44. "no-ex-assign": "warn",
  45. "no-extend-native": "error",
  46. "no-extra-bind": "error",
  47. "no-floating-decimal": "error",
  48. "no-implicit-coercion": "error",
  49. "no-implied-eval": "error",
  50. // Turn off until fix for: https://github.com/typescript-eslint/typescript-eslint/issues/239
  51. "no-inner-declarations": "off",
  52. "no-lone-blocks": "error",
  53. "no-lonely-if": "error",
  54. "no-loop-func": "error",
  55. "no-multi-spaces": "error",
  56. "no-return-assign": "error",
  57. "no-return-await": "warn",
  58. "no-self-compare": "error",
  59. "no-sequences": "error",
  60. "no-template-curly-in-string": "warn",
  61. "no-throw-literal": "error",
  62. "no-unmodified-loop-condition": "warn",
  63. "no-unneeded-ternary": "error",
  64. "no-use-before-define": "off",
  65. "no-useless-call": "error",
  66. "no-useless-catch": "error",
  67. "no-useless-computed-key": "error",
  68. "no-useless-concat": "error",
  69. "no-useless-rename": "error",
  70. "no-useless-return": "error",
  71. "no-var": "error",
  72. "no-with": "error",
  73. "object-shorthand": ["error", "never"],
  74. "one-var": ["error", "never"],
  75. "prefer-arrow-callback": "error",
  76. "prefer-const": "error",
  77. "prefer-numeric-literals": "error",
  78. "prefer-object-spread": "error",
  79. "prefer-rest-params": "error",
  80. "prefer-spread": "error",
  81. "prefer-template": "error",
  82. "quotes": ["error", "single", { "avoidEscape": true }],
  83. // Turn off until fix for: https://github.com/eslint/eslint/issues/11899
  84. "require-atomic-updates": "off",
  85. "semi": ["error", "always"],
  86. "semi-style": ["error", "last"],
  87. "sort-imports": [
  88. "error",
  89. {
  90. "ignoreCase": true,
  91. "ignoreDeclarationSort": true,
  92. "ignoreMemberSort": false,
  93. "memberSyntaxSortOrder": ["none", "all", "multiple", "single"]
  94. }
  95. ],
  96. "yoda": "error",
  97. "import/export": "off",
  98. "import/extensions": ["error", "never"],
  99. "import/named": "off",
  100. "import/namespace": "off",
  101. "import/newline-after-import": "warn",
  102. "import/no-cycle": "off",
  103. "import/no-dynamic-require": "error",
  104. "import/no-default-export": "error",
  105. "import/no-duplicates": "error",
  106. "import/no-self-import": "error",
  107. "import/no-unresolved": ["warn", { "ignore": ["vscode"] }],
  108. "import/order": [
  109. "warn",
  110. {
  111. "groups": ["builtin", "external", "internal", ["index", "sibling", "parent"]],
  112. "newlines-between": "never"
  113. }
  114. ],
  115. "@typescript-eslint/consistent-type-assertions": [
  116. "error",
  117. {
  118. "assertionStyle": "as",
  119. "objectLiteralTypeAssertions": "allow-as-parameter"
  120. }
  121. ],
  122. "@typescript-eslint/explicit-function-return-type": "off",
  123. "@typescript-eslint/explicit-member-accessibility": "off",
  124. "@typescript-eslint/no-empty-function": ["warn", { "allow": ["constructors"] }],
  125. "@typescript-eslint/no-empty-interface": "off",
  126. "@typescript-eslint/no-explicit-any": "off",
  127. "@typescript-eslint/no-inferrable-types": ["warn", { "ignoreParameters": true, "ignoreProperties": true }],
  128. "@typescript-eslint/no-misused-promises": ["error", { "checksVoidReturn": false }],
  129. "@typescript-eslint/no-namespace": "off",
  130. "@typescript-eslint/no-non-null-assertion": "off",
  131. "@typescript-eslint/no-parameter-properties": "off",
  132. "@typescript-eslint/no-unused-expressions": ["warn", { "allowShortCircuit": true }],
  133. "@typescript-eslint/no-unused-vars": ["warn", { "args": "none" }],
  134. "@typescript-eslint/no-use-before-define": "off",
  135. "@typescript-eslint/unbound-method": "off" // Too many bugs right now: https://github.com/typescript-eslint/typescript-eslint/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+unbound-method
  136. }
  137. }