UI for Zipcoin Blue

all.js 8.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. "use strict";
  2. /**
  3. * @license
  4. * Copyright 2017 Palantir Technologies, Inc.
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the "License");
  7. * you may not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. Object.defineProperty(exports, "__esModule", { value: true });
  19. var path_1 = require("path");
  20. var ruleLoader_1 = require("../ruleLoader");
  21. var utils_1 = require("../utils");
  22. // tslint:disable object-literal-sort-keys
  23. // tslint:disable object-literal-key-quotes
  24. exports.rules = {
  25. // TypeScript Specific
  26. "adjacent-overload-signatures": true,
  27. "ban-types": {
  28. options: [
  29. ["Object", "Avoid using the `Object` type. Did you mean `object`?"],
  30. ["Function", "Avoid using the `Function` type. Prefer a specific function type, like `() => void`."],
  31. ["Boolean", "Avoid using the `Boolean` type. Did you mean `boolean`?"],
  32. ["Number", "Avoid using the `Number` type. Did you mean `number`?"],
  33. ["String", "Avoid using the `String` type. Did you mean `string`?"],
  34. ["Symbol", "Avoid using the `Symbol` type. Did you mean `symbol`?"],
  35. ],
  36. },
  37. "member-access": [true, "check-accessor", "check-constructor", "check-parameter-property"],
  38. "member-ordering": [true, {
  39. "order": "statics-first",
  40. "alphabetize": true,
  41. }],
  42. "no-any": true,
  43. "no-empty-interface": true,
  44. "no-import-side-effect": true,
  45. // Technically this is not the strictest setting, but don't want to conflict with "typedef"
  46. "no-inferrable-types": [true, "ignore-params"],
  47. "no-internal-module": true,
  48. "no-magic-numbers": true,
  49. "no-namespace": true,
  50. "no-non-null-assertion": true,
  51. "no-reference": true,
  52. "no-this-assignment": true,
  53. "no-var-requires": true,
  54. "only-arrow-functions": true,
  55. "prefer-for-of": true,
  56. "prefer-readonly": true,
  57. "promise-function-async": true,
  58. "typedef": [
  59. true,
  60. "call-signature",
  61. "arrow-call-signature",
  62. "parameter",
  63. "arrow-parameter",
  64. "property-declaration",
  65. "variable-declaration",
  66. "member-variable-declaration",
  67. ],
  68. "typedef-whitespace": [
  69. true,
  70. {
  71. "call-signature": "nospace",
  72. "index-signature": "nospace",
  73. "parameter": "nospace",
  74. "property-declaration": "nospace",
  75. "variable-declaration": "nospace",
  76. },
  77. {
  78. "call-signature": "onespace",
  79. "index-signature": "onespace",
  80. "parameter": "onespace",
  81. "property-declaration": "onespace",
  82. "variable-declaration": "onespace",
  83. },
  84. ],
  85. "unified-signatures": true,
  86. // Functionality
  87. "await-promise": true,
  88. // "ban": no sensible default
  89. "ban-comma-operator": true,
  90. "curly": true,
  91. "forin": true,
  92. // "import-blacklist": no sensible default
  93. "label-position": true,
  94. "no-arg": true,
  95. "no-bitwise": true,
  96. "no-conditional-assignment": true,
  97. "no-console": true,
  98. "no-construct": true,
  99. "no-debugger": true,
  100. "no-duplicate-super": true,
  101. "no-duplicate-switch-case": true,
  102. "no-duplicate-variable": [
  103. true,
  104. "check-parameters",
  105. ],
  106. "no-dynamic-delete": true,
  107. "no-empty": true,
  108. "no-eval": true,
  109. "no-floating-promises": true,
  110. "no-for-in-array": true,
  111. "no-implicit-dependencies": true,
  112. "no-inferred-empty-object-type": true,
  113. "no-invalid-template-strings": true,
  114. // "no-invalid-this": Won't this be deprecated?
  115. "no-misused-new": true,
  116. "no-null-keyword": true,
  117. "no-object-literal-type-assertion": true,
  118. "no-return-await": true,
  119. "no-shadowed-variable": true,
  120. "no-string-literal": true,
  121. "no-string-throw": true,
  122. "no-sparse-arrays": true,
  123. "no-submodule-imports": true,
  124. "no-unbound-method": true,
  125. "no-unnecessary-class": [true, "allow-empty-class"],
  126. "no-unsafe-any": true,
  127. "no-unsafe-finally": true,
  128. "no-unused-expression": true,
  129. "no-unused-variable": true,
  130. "no-use-before-declare": true,
  131. "no-var-keyword": true,
  132. "no-void-expression": true,
  133. "prefer-conditional-expression": true,
  134. "radix": true,
  135. "restrict-plus-operands": true,
  136. "strict-boolean-expressions": true,
  137. "strict-type-predicates": true,
  138. "switch-default": true,
  139. "triple-equals": true,
  140. "use-default-type-parameter": true,
  141. "use-isnan": true,
  142. // Maintainability
  143. "cyclomatic-complexity": true,
  144. "eofline": true,
  145. "indent": [true, "spaces"],
  146. "linebreak-style": [true, "LF"],
  147. "max-classes-per-file": [true, 1],
  148. "max-file-line-count": [true, 1000],
  149. "max-line-length": [true, 120],
  150. "no-default-export": true,
  151. "no-duplicate-imports": true,
  152. "no-irregular-whitespace": true,
  153. "no-mergeable-namespace": true,
  154. "no-parameter-reassignment": true,
  155. "no-require-imports": true,
  156. "no-trailing-whitespace": true,
  157. "object-literal-sort-keys": true,
  158. "prefer-const": true,
  159. "trailing-comma": [true, {
  160. "multiline": "always",
  161. "singleline": "never",
  162. }],
  163. // Style
  164. "align": [
  165. true,
  166. "parameters",
  167. "arguments",
  168. "statements",
  169. "elements",
  170. "members",
  171. ],
  172. "array-type": [true, "array-simple"],
  173. "arrow-parens": true,
  174. "arrow-return-shorthand": [true, "multiline"],
  175. "binary-expression-operand-order": true,
  176. "callable-types": true,
  177. "class-name": true,
  178. "comment-format": [
  179. true,
  180. "check-space",
  181. "check-uppercase",
  182. ],
  183. "completed-docs": true,
  184. // "file-header": No sensible default
  185. "deprecation": true,
  186. "encoding": true,
  187. "file-name-casing": [true, "camel-case"],
  188. "import-spacing": true,
  189. "interface-name": true,
  190. "interface-over-type-literal": true,
  191. "jsdoc-format": [true, "check-multiline-start"],
  192. "match-default-export-name": true,
  193. "new-parens": true,
  194. "newline-before-return": true,
  195. "newline-per-chained-call": true,
  196. "no-angle-bracket-type-assertion": true,
  197. "no-boolean-literal-compare": true,
  198. "no-consecutive-blank-lines": true,
  199. "no-parameter-properties": true,
  200. "no-redundant-jsdoc": true,
  201. "no-reference-import": true,
  202. "no-unnecessary-callback-wrapper": true,
  203. "no-unnecessary-initializer": true,
  204. "no-unnecessary-qualifier": true,
  205. "no-unnecessary-type-assertion": true,
  206. "number-literal-format": true,
  207. "object-literal-key-quotes": [true, "consistent-as-needed"],
  208. "object-literal-shorthand": true,
  209. "one-line": [
  210. true,
  211. "check-catch",
  212. "check-else",
  213. "check-finally",
  214. "check-open-brace",
  215. "check-whitespace",
  216. ],
  217. "one-variable-per-declaration": true,
  218. "ordered-imports": [true, {
  219. "import-sources-order": "case-insensitive",
  220. "named-imports-order": "case-insensitive",
  221. "module-source-path": "full",
  222. }],
  223. "prefer-function-over-method": true,
  224. "prefer-method-signature": true,
  225. "prefer-object-spread": true,
  226. "prefer-switch": true,
  227. "prefer-template": true,
  228. "prefer-while": true,
  229. "quotemark": [
  230. true,
  231. "double",
  232. "avoid-escape",
  233. "avoid-template",
  234. ],
  235. "return-undefined": true,
  236. "semicolon": [true, "always"],
  237. "space-before-function-paren": [true, {
  238. "anonymous": "never",
  239. "asyncArrow": "always",
  240. "constructor": "never",
  241. "method": "never",
  242. "named": "never",
  243. }],
  244. "space-within-parens": [true, 0],
  245. "switch-final-break": true,
  246. "type-literal-delimiter": true,
  247. "variable-name": [
  248. true,
  249. "ban-keywords",
  250. "check-format",
  251. ],
  252. "whitespace": [
  253. true,
  254. "check-branch",
  255. "check-decl",
  256. "check-operator",
  257. "check-module",
  258. "check-separator",
  259. "check-type",
  260. "check-typecast",
  261. "check-preblock",
  262. "check-type-operator",
  263. "check-rest-spread",
  264. ],
  265. };
  266. exports.RULES_EXCLUDED_FROM_ALL_CONFIG = ["ban", "fileHeader", "importBlacklist", "noInvalidThis", "noSwitchCaseFallThrough", "typeofCompare"];
  267. // Exclude typescript-only rules from jsRules, otherwise it's identical.
  268. exports.jsRules = {};
  269. for (var key in exports.rules) {
  270. if (!utils_1.hasOwnProperty(exports.rules, key)) {
  271. continue;
  272. }
  273. var Rule = ruleLoader_1.findRule(key, path_1.join(__dirname, "..", "rules"));
  274. if (Rule === undefined) {
  275. throw new Error("Couldn't find rule '" + key + "'.");
  276. }
  277. if (!Rule.metadata.typescriptOnly) {
  278. exports.jsRules[key] = exports.rules[key];
  279. }
  280. }