index.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. /**
  2. * @fileoverview Collects the built-in rules into a map structure so that they can be imported all at once and without
  3. * using the file-system directly.
  4. * @author Peter (Somogyvari) Metz
  5. */
  6. "use strict";
  7. /* eslint sort-keys: ["error", "asc"] -- More readable for long list */
  8. const { LazyLoadingRuleMap } = require("./utils/lazy-loading-rule-map");
  9. /** @type {Map<string, import("../shared/types").Rule>} */
  10. module.exports = new LazyLoadingRuleMap(Object.entries({
  11. "accessor-pairs": () => require("./accessor-pairs"),
  12. "array-bracket-newline": () => require("./array-bracket-newline"),
  13. "array-bracket-spacing": () => require("./array-bracket-spacing"),
  14. "array-callback-return": () => require("./array-callback-return"),
  15. "array-element-newline": () => require("./array-element-newline"),
  16. "arrow-body-style": () => require("./arrow-body-style"),
  17. "arrow-parens": () => require("./arrow-parens"),
  18. "arrow-spacing": () => require("./arrow-spacing"),
  19. "block-scoped-var": () => require("./block-scoped-var"),
  20. "block-spacing": () => require("./block-spacing"),
  21. "brace-style": () => require("./brace-style"),
  22. "callback-return": () => require("./callback-return"),
  23. camelcase: () => require("./camelcase"),
  24. "capitalized-comments": () => require("./capitalized-comments"),
  25. "class-methods-use-this": () => require("./class-methods-use-this"),
  26. "comma-dangle": () => require("./comma-dangle"),
  27. "comma-spacing": () => require("./comma-spacing"),
  28. "comma-style": () => require("./comma-style"),
  29. complexity: () => require("./complexity"),
  30. "computed-property-spacing": () => require("./computed-property-spacing"),
  31. "consistent-return": () => require("./consistent-return"),
  32. "consistent-this": () => require("./consistent-this"),
  33. "constructor-super": () => require("./constructor-super"),
  34. curly: () => require("./curly"),
  35. "default-case": () => require("./default-case"),
  36. "default-case-last": () => require("./default-case-last"),
  37. "default-param-last": () => require("./default-param-last"),
  38. "dot-location": () => require("./dot-location"),
  39. "dot-notation": () => require("./dot-notation"),
  40. "eol-last": () => require("./eol-last"),
  41. eqeqeq: () => require("./eqeqeq"),
  42. "for-direction": () => require("./for-direction"),
  43. "func-call-spacing": () => require("./func-call-spacing"),
  44. "func-name-matching": () => require("./func-name-matching"),
  45. "func-names": () => require("./func-names"),
  46. "func-style": () => require("./func-style"),
  47. "function-call-argument-newline": () => require("./function-call-argument-newline"),
  48. "function-paren-newline": () => require("./function-paren-newline"),
  49. "generator-star-spacing": () => require("./generator-star-spacing"),
  50. "getter-return": () => require("./getter-return"),
  51. "global-require": () => require("./global-require"),
  52. "grouped-accessor-pairs": () => require("./grouped-accessor-pairs"),
  53. "guard-for-in": () => require("./guard-for-in"),
  54. "handle-callback-err": () => require("./handle-callback-err"),
  55. "id-blacklist": () => require("./id-blacklist"),
  56. "id-denylist": () => require("./id-denylist"),
  57. "id-length": () => require("./id-length"),
  58. "id-match": () => require("./id-match"),
  59. "implicit-arrow-linebreak": () => require("./implicit-arrow-linebreak"),
  60. indent: () => require("./indent"),
  61. "indent-legacy": () => require("./indent-legacy"),
  62. "init-declarations": () => require("./init-declarations"),
  63. "jsx-quotes": () => require("./jsx-quotes"),
  64. "key-spacing": () => require("./key-spacing"),
  65. "keyword-spacing": () => require("./keyword-spacing"),
  66. "line-comment-position": () => require("./line-comment-position"),
  67. "linebreak-style": () => require("./linebreak-style"),
  68. "lines-around-comment": () => require("./lines-around-comment"),
  69. "lines-around-directive": () => require("./lines-around-directive"),
  70. "lines-between-class-members": () => require("./lines-between-class-members"),
  71. "logical-assignment-operators": () => require("./logical-assignment-operators"),
  72. "max-classes-per-file": () => require("./max-classes-per-file"),
  73. "max-depth": () => require("./max-depth"),
  74. "max-len": () => require("./max-len"),
  75. "max-lines": () => require("./max-lines"),
  76. "max-lines-per-function": () => require("./max-lines-per-function"),
  77. "max-nested-callbacks": () => require("./max-nested-callbacks"),
  78. "max-params": () => require("./max-params"),
  79. "max-statements": () => require("./max-statements"),
  80. "max-statements-per-line": () => require("./max-statements-per-line"),
  81. "multiline-comment-style": () => require("./multiline-comment-style"),
  82. "multiline-ternary": () => require("./multiline-ternary"),
  83. "new-cap": () => require("./new-cap"),
  84. "new-parens": () => require("./new-parens"),
  85. "newline-after-var": () => require("./newline-after-var"),
  86. "newline-before-return": () => require("./newline-before-return"),
  87. "newline-per-chained-call": () => require("./newline-per-chained-call"),
  88. "no-alert": () => require("./no-alert"),
  89. "no-array-constructor": () => require("./no-array-constructor"),
  90. "no-async-promise-executor": () => require("./no-async-promise-executor"),
  91. "no-await-in-loop": () => require("./no-await-in-loop"),
  92. "no-bitwise": () => require("./no-bitwise"),
  93. "no-buffer-constructor": () => require("./no-buffer-constructor"),
  94. "no-caller": () => require("./no-caller"),
  95. "no-case-declarations": () => require("./no-case-declarations"),
  96. "no-catch-shadow": () => require("./no-catch-shadow"),
  97. "no-class-assign": () => require("./no-class-assign"),
  98. "no-compare-neg-zero": () => require("./no-compare-neg-zero"),
  99. "no-cond-assign": () => require("./no-cond-assign"),
  100. "no-confusing-arrow": () => require("./no-confusing-arrow"),
  101. "no-console": () => require("./no-console"),
  102. "no-const-assign": () => require("./no-const-assign"),
  103. "no-constant-binary-expression": () => require("./no-constant-binary-expression"),
  104. "no-constant-condition": () => require("./no-constant-condition"),
  105. "no-constructor-return": () => require("./no-constructor-return"),
  106. "no-continue": () => require("./no-continue"),
  107. "no-control-regex": () => require("./no-control-regex"),
  108. "no-debugger": () => require("./no-debugger"),
  109. "no-delete-var": () => require("./no-delete-var"),
  110. "no-div-regex": () => require("./no-div-regex"),
  111. "no-dupe-args": () => require("./no-dupe-args"),
  112. "no-dupe-class-members": () => require("./no-dupe-class-members"),
  113. "no-dupe-else-if": () => require("./no-dupe-else-if"),
  114. "no-dupe-keys": () => require("./no-dupe-keys"),
  115. "no-duplicate-case": () => require("./no-duplicate-case"),
  116. "no-duplicate-imports": () => require("./no-duplicate-imports"),
  117. "no-else-return": () => require("./no-else-return"),
  118. "no-empty": () => require("./no-empty"),
  119. "no-empty-character-class": () => require("./no-empty-character-class"),
  120. "no-empty-function": () => require("./no-empty-function"),
  121. "no-empty-pattern": () => require("./no-empty-pattern"),
  122. "no-empty-static-block": () => require("./no-empty-static-block"),
  123. "no-eq-null": () => require("./no-eq-null"),
  124. "no-eval": () => require("./no-eval"),
  125. "no-ex-assign": () => require("./no-ex-assign"),
  126. "no-extend-native": () => require("./no-extend-native"),
  127. "no-extra-bind": () => require("./no-extra-bind"),
  128. "no-extra-boolean-cast": () => require("./no-extra-boolean-cast"),
  129. "no-extra-label": () => require("./no-extra-label"),
  130. "no-extra-parens": () => require("./no-extra-parens"),
  131. "no-extra-semi": () => require("./no-extra-semi"),
  132. "no-fallthrough": () => require("./no-fallthrough"),
  133. "no-floating-decimal": () => require("./no-floating-decimal"),
  134. "no-func-assign": () => require("./no-func-assign"),
  135. "no-global-assign": () => require("./no-global-assign"),
  136. "no-implicit-coercion": () => require("./no-implicit-coercion"),
  137. "no-implicit-globals": () => require("./no-implicit-globals"),
  138. "no-implied-eval": () => require("./no-implied-eval"),
  139. "no-import-assign": () => require("./no-import-assign"),
  140. "no-inline-comments": () => require("./no-inline-comments"),
  141. "no-inner-declarations": () => require("./no-inner-declarations"),
  142. "no-invalid-regexp": () => require("./no-invalid-regexp"),
  143. "no-invalid-this": () => require("./no-invalid-this"),
  144. "no-irregular-whitespace": () => require("./no-irregular-whitespace"),
  145. "no-iterator": () => require("./no-iterator"),
  146. "no-label-var": () => require("./no-label-var"),
  147. "no-labels": () => require("./no-labels"),
  148. "no-lone-blocks": () => require("./no-lone-blocks"),
  149. "no-lonely-if": () => require("./no-lonely-if"),
  150. "no-loop-func": () => require("./no-loop-func"),
  151. "no-loss-of-precision": () => require("./no-loss-of-precision"),
  152. "no-magic-numbers": () => require("./no-magic-numbers"),
  153. "no-misleading-character-class": () => require("./no-misleading-character-class"),
  154. "no-mixed-operators": () => require("./no-mixed-operators"),
  155. "no-mixed-requires": () => require("./no-mixed-requires"),
  156. "no-mixed-spaces-and-tabs": () => require("./no-mixed-spaces-and-tabs"),
  157. "no-multi-assign": () => require("./no-multi-assign"),
  158. "no-multi-spaces": () => require("./no-multi-spaces"),
  159. "no-multi-str": () => require("./no-multi-str"),
  160. "no-multiple-empty-lines": () => require("./no-multiple-empty-lines"),
  161. "no-native-reassign": () => require("./no-native-reassign"),
  162. "no-negated-condition": () => require("./no-negated-condition"),
  163. "no-negated-in-lhs": () => require("./no-negated-in-lhs"),
  164. "no-nested-ternary": () => require("./no-nested-ternary"),
  165. "no-new": () => require("./no-new"),
  166. "no-new-func": () => require("./no-new-func"),
  167. "no-new-native-nonconstructor": () => require("./no-new-native-nonconstructor"),
  168. "no-new-object": () => require("./no-new-object"),
  169. "no-new-require": () => require("./no-new-require"),
  170. "no-new-symbol": () => require("./no-new-symbol"),
  171. "no-new-wrappers": () => require("./no-new-wrappers"),
  172. "no-nonoctal-decimal-escape": () => require("./no-nonoctal-decimal-escape"),
  173. "no-obj-calls": () => require("./no-obj-calls"),
  174. "no-octal": () => require("./no-octal"),
  175. "no-octal-escape": () => require("./no-octal-escape"),
  176. "no-param-reassign": () => require("./no-param-reassign"),
  177. "no-path-concat": () => require("./no-path-concat"),
  178. "no-plusplus": () => require("./no-plusplus"),
  179. "no-process-env": () => require("./no-process-env"),
  180. "no-process-exit": () => require("./no-process-exit"),
  181. "no-promise-executor-return": () => require("./no-promise-executor-return"),
  182. "no-proto": () => require("./no-proto"),
  183. "no-prototype-builtins": () => require("./no-prototype-builtins"),
  184. "no-redeclare": () => require("./no-redeclare"),
  185. "no-regex-spaces": () => require("./no-regex-spaces"),
  186. "no-restricted-exports": () => require("./no-restricted-exports"),
  187. "no-restricted-globals": () => require("./no-restricted-globals"),
  188. "no-restricted-imports": () => require("./no-restricted-imports"),
  189. "no-restricted-modules": () => require("./no-restricted-modules"),
  190. "no-restricted-properties": () => require("./no-restricted-properties"),
  191. "no-restricted-syntax": () => require("./no-restricted-syntax"),
  192. "no-return-assign": () => require("./no-return-assign"),
  193. "no-return-await": () => require("./no-return-await"),
  194. "no-script-url": () => require("./no-script-url"),
  195. "no-self-assign": () => require("./no-self-assign"),
  196. "no-self-compare": () => require("./no-self-compare"),
  197. "no-sequences": () => require("./no-sequences"),
  198. "no-setter-return": () => require("./no-setter-return"),
  199. "no-shadow": () => require("./no-shadow"),
  200. "no-shadow-restricted-names": () => require("./no-shadow-restricted-names"),
  201. "no-spaced-func": () => require("./no-spaced-func"),
  202. "no-sparse-arrays": () => require("./no-sparse-arrays"),
  203. "no-sync": () => require("./no-sync"),
  204. "no-tabs": () => require("./no-tabs"),
  205. "no-template-curly-in-string": () => require("./no-template-curly-in-string"),
  206. "no-ternary": () => require("./no-ternary"),
  207. "no-this-before-super": () => require("./no-this-before-super"),
  208. "no-throw-literal": () => require("./no-throw-literal"),
  209. "no-trailing-spaces": () => require("./no-trailing-spaces"),
  210. "no-undef": () => require("./no-undef"),
  211. "no-undef-init": () => require("./no-undef-init"),
  212. "no-undefined": () => require("./no-undefined"),
  213. "no-underscore-dangle": () => require("./no-underscore-dangle"),
  214. "no-unexpected-multiline": () => require("./no-unexpected-multiline"),
  215. "no-unmodified-loop-condition": () => require("./no-unmodified-loop-condition"),
  216. "no-unneeded-ternary": () => require("./no-unneeded-ternary"),
  217. "no-unreachable": () => require("./no-unreachable"),
  218. "no-unreachable-loop": () => require("./no-unreachable-loop"),
  219. "no-unsafe-finally": () => require("./no-unsafe-finally"),
  220. "no-unsafe-negation": () => require("./no-unsafe-negation"),
  221. "no-unsafe-optional-chaining": () => require("./no-unsafe-optional-chaining"),
  222. "no-unused-expressions": () => require("./no-unused-expressions"),
  223. "no-unused-labels": () => require("./no-unused-labels"),
  224. "no-unused-private-class-members": () => require("./no-unused-private-class-members"),
  225. "no-unused-vars": () => require("./no-unused-vars"),
  226. "no-use-before-define": () => require("./no-use-before-define"),
  227. "no-useless-backreference": () => require("./no-useless-backreference"),
  228. "no-useless-call": () => require("./no-useless-call"),
  229. "no-useless-catch": () => require("./no-useless-catch"),
  230. "no-useless-computed-key": () => require("./no-useless-computed-key"),
  231. "no-useless-concat": () => require("./no-useless-concat"),
  232. "no-useless-constructor": () => require("./no-useless-constructor"),
  233. "no-useless-escape": () => require("./no-useless-escape"),
  234. "no-useless-rename": () => require("./no-useless-rename"),
  235. "no-useless-return": () => require("./no-useless-return"),
  236. "no-var": () => require("./no-var"),
  237. "no-void": () => require("./no-void"),
  238. "no-warning-comments": () => require("./no-warning-comments"),
  239. "no-whitespace-before-property": () => require("./no-whitespace-before-property"),
  240. "no-with": () => require("./no-with"),
  241. "nonblock-statement-body-position": () => require("./nonblock-statement-body-position"),
  242. "object-curly-newline": () => require("./object-curly-newline"),
  243. "object-curly-spacing": () => require("./object-curly-spacing"),
  244. "object-property-newline": () => require("./object-property-newline"),
  245. "object-shorthand": () => require("./object-shorthand"),
  246. "one-var": () => require("./one-var"),
  247. "one-var-declaration-per-line": () => require("./one-var-declaration-per-line"),
  248. "operator-assignment": () => require("./operator-assignment"),
  249. "operator-linebreak": () => require("./operator-linebreak"),
  250. "padded-blocks": () => require("./padded-blocks"),
  251. "padding-line-between-statements": () => require("./padding-line-between-statements"),
  252. "prefer-arrow-callback": () => require("./prefer-arrow-callback"),
  253. "prefer-const": () => require("./prefer-const"),
  254. "prefer-destructuring": () => require("./prefer-destructuring"),
  255. "prefer-exponentiation-operator": () => require("./prefer-exponentiation-operator"),
  256. "prefer-named-capture-group": () => require("./prefer-named-capture-group"),
  257. "prefer-numeric-literals": () => require("./prefer-numeric-literals"),
  258. "prefer-object-has-own": () => require("./prefer-object-has-own"),
  259. "prefer-object-spread": () => require("./prefer-object-spread"),
  260. "prefer-promise-reject-errors": () => require("./prefer-promise-reject-errors"),
  261. "prefer-reflect": () => require("./prefer-reflect"),
  262. "prefer-regex-literals": () => require("./prefer-regex-literals"),
  263. "prefer-rest-params": () => require("./prefer-rest-params"),
  264. "prefer-spread": () => require("./prefer-spread"),
  265. "prefer-template": () => require("./prefer-template"),
  266. "quote-props": () => require("./quote-props"),
  267. quotes: () => require("./quotes"),
  268. radix: () => require("./radix"),
  269. "require-atomic-updates": () => require("./require-atomic-updates"),
  270. "require-await": () => require("./require-await"),
  271. "require-jsdoc": () => require("./require-jsdoc"),
  272. "require-unicode-regexp": () => require("./require-unicode-regexp"),
  273. "require-yield": () => require("./require-yield"),
  274. "rest-spread-spacing": () => require("./rest-spread-spacing"),
  275. semi: () => require("./semi"),
  276. "semi-spacing": () => require("./semi-spacing"),
  277. "semi-style": () => require("./semi-style"),
  278. "sort-imports": () => require("./sort-imports"),
  279. "sort-keys": () => require("./sort-keys"),
  280. "sort-vars": () => require("./sort-vars"),
  281. "space-before-blocks": () => require("./space-before-blocks"),
  282. "space-before-function-paren": () => require("./space-before-function-paren"),
  283. "space-in-parens": () => require("./space-in-parens"),
  284. "space-infix-ops": () => require("./space-infix-ops"),
  285. "space-unary-ops": () => require("./space-unary-ops"),
  286. "spaced-comment": () => require("./spaced-comment"),
  287. strict: () => require("./strict"),
  288. "switch-colon-spacing": () => require("./switch-colon-spacing"),
  289. "symbol-description": () => require("./symbol-description"),
  290. "template-curly-spacing": () => require("./template-curly-spacing"),
  291. "template-tag-spacing": () => require("./template-tag-spacing"),
  292. "unicode-bom": () => require("./unicode-bom"),
  293. "use-isnan": () => require("./use-isnan"),
  294. "valid-jsdoc": () => require("./valid-jsdoc"),
  295. "valid-typeof": () => require("./valid-typeof"),
  296. "vars-on-top": () => require("./vars-on-top"),
  297. "wrap-iife": () => require("./wrap-iife"),
  298. "wrap-regex": () => require("./wrap-regex"),
  299. "yield-star-spacing": () => require("./yield-star-spacing"),
  300. yoda: () => require("./yoda")
  301. }));