Project Amber web / mobile client https://git.tdem.in/tdemin/amber
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

146 lines
5.4 KiB

  1. {
  2. // Thanks, BoresXP@github.com !
  3. // https://gist.github.com/BoresXP/e404f16a0e153eeb6ce15ce06848f36e
  4. "extends": ["react-app"],
  5. "parserOptions": {
  6. "project": "tsconfig.json",
  7. "tsconfigRootDir": ".",
  8. "ecmaVersion": 6,
  9. "sourceType": "module",
  10. "ecmaFeatures": {
  11. "jsx": true
  12. }
  13. },
  14. "plugins": ["react", "@typescript-eslint"],
  15. "rules": {
  16. "semi": "error",
  17. "indent": [
  18. "error",
  19. 4,
  20. {
  21. "SwitchCase": 1
  22. }
  23. ],
  24. "quotes": ["warn", "double"],
  25. "max-len": [
  26. "error",
  27. {
  28. "code": 80,
  29. "tabWidth": 4
  30. }
  31. ],
  32. "no-shadow": ["error", { "builtinGlobals": false }],
  33. "no-duplicate-imports": ["error", { "includeExports": true }],
  34. "no-template-curly-in-string": "error",
  35. "block-scoped-var": "error",
  36. "curly": ["error", "all"],
  37. "eqeqeq": "error",
  38. "max-classes-per-file": ["error", 2],
  39. "no-alert": "warn",
  40. "no-console": "warn",
  41. "no-else-return": ["error", { "allowElseIf": false }],
  42. "no-implicit-coercion": "error",
  43. "no-labels": "error",
  44. "no-lone-blocks": "error",
  45. "no-multi-spaces": "error",
  46. "no-new": "error",
  47. "no-new-func": "error",
  48. "no-new-wrappers": "error",
  49. "no-return-await": "error",
  50. "no-self-compare": "error",
  51. "no-sequences": "error",
  52. "no-throw-literal": "error",
  53. "no-unused-expressions": "error",
  54. "no-useless-call": "error",
  55. "no-useless-concat": "error",
  56. "no-useless-return": "error",
  57. "prefer-promise-reject-errors": "error",
  58. "no-undefined": "error",
  59. "array-bracket-newline": ["error", { "multiline": true }],
  60. "comma-dangle": ["error", "always-multiline"],
  61. "comma-style": "error",
  62. "eol-last": "error",
  63. "key-spacing": "error",
  64. "keyword-spacing": "error",
  65. "new-parens": "error",
  66. "no-bitwise": "warn",
  67. "no-lonely-if": "warn",
  68. "no-multiple-empty-lines": "error",
  69. "no-nested-ternary": "error",
  70. "no-new-object": "error",
  71. "no-tabs": ["error", { "allowIndentationTabs": true }],
  72. "no-trailing-spaces": "error",
  73. "no-unneeded-ternary": "error",
  74. "no-whitespace-before-property": "error",
  75. "object-curly-newline": "error",
  76. "object-curly-spacing": ["error", "always"],
  77. "semi-spacing": "error",
  78. "space-before-blocks": "error",
  79. "space-before-function-paren": [
  80. "error",
  81. {
  82. "anonymous": "always",
  83. "named": "never",
  84. "asyncArrow": "always"
  85. }
  86. ],
  87. "space-in-parens": "error",
  88. "space-infix-ops": "error",
  89. "space-unary-ops": "error",
  90. "spaced-comment": ["error", "always"],
  91. "switch-colon-spacing": "error",
  92. "arrow-body-style": ["error", "as-needed"],
  93. "arrow-parens": ["error", "always"],
  94. "arrow-spacing": "error",
  95. "generator-star-spacing": ["error", "after"],
  96. "no-confusing-arrow": "error",
  97. "no-useless-computed-key": "error",
  98. "no-useless-rename": "error",
  99. "object-shorthand": ["error", "always"],
  100. "prefer-arrow-callback": "warn",
  101. "prefer-destructuring": "error",
  102. "rest-spread-spacing": ["error", "never"],
  103. "template-curly-spacing": "error",
  104. "@typescript-eslint/semi": ["error", "always"],
  105. "@typescript-eslint/member-ordering": "warn",
  106. "@typescript-eslint/no-magic-numbers": [
  107. "error",
  108. {
  109. "ignoreNumericLiteralTypes": true,
  110. "ignoreEnums": true,
  111. "enforceConst": true,
  112. "ignoreReadonlyClassProperties": true,
  113. "ignore": [0, 1, 2, 1000]
  114. }
  115. ],
  116. "@typescript-eslint/brace-style": ["error", "1tbs"],
  117. "@typescript-eslint/quotes": [
  118. "error",
  119. "double",
  120. { "avoidEscape": true }
  121. ],
  122. "@typescript-eslint/func-call-spacing": ["error", "never"],
  123. "@typescript-eslint/no-useless-constructor": "error",
  124. "@typescript-eslint/prefer-for-of": "warn",
  125. "@typescript-eslint/no-parameter-properties": "error",
  126. "@typescript-eslint/no-unnecessary-type-arguments": "warn",
  127. "@typescript-eslint/prefer-function-type": "warn",
  128. "@typescript-eslint/prefer-readonly": "warn",
  129. "@typescript-eslint/no-explicit-any": "off",
  130. "@typescript-eslint/camelcase": ["error", { "properties": "never" }],
  131. "@typescript-eslint/interface-name-prefix": "off",
  132. "@typescript-eslint/no-unused-vars": [
  133. "error",
  134. { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_$" }
  135. ],
  136. "react/no-access-state-in-setstate": "error",
  137. "react/no-danger": "error",
  138. "react/no-this-in-sfc": "error",
  139. "react/prefer-stateless-function": "error",
  140. "react/jsx-filename-extension": ["error", { "extensions": [".tsx"] }],
  141. "react/jsx-no-bind": "error",
  142. "react/jsx-no-literals": "warn",
  143. "react/jsx-pascal-case": "error"
  144. }
  145. }