index.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.configs = exports.rules = void 0;
  4. const sonarjsRules = [
  5. 'cognitive-complexity',
  6. 'elseif-without-else',
  7. 'max-switch-cases',
  8. 'no-all-duplicated-branches',
  9. 'no-collapsible-if',
  10. 'no-collection-size-mischeck',
  11. 'no-duplicate-string',
  12. 'no-duplicated-branches',
  13. 'no-element-overwrite',
  14. 'no-empty-collection',
  15. 'no-extra-arguments',
  16. 'no-gratuitous-expressions',
  17. 'no-identical-conditions',
  18. 'no-identical-expressions',
  19. 'no-identical-functions',
  20. 'no-ignored-return',
  21. 'no-inverted-boolean-check',
  22. 'no-nested-switch',
  23. 'no-nested-template-literals',
  24. 'no-one-iteration-loop',
  25. 'no-redundant-boolean',
  26. 'no-redundant-jump',
  27. 'no-same-line-conditional',
  28. 'no-small-switch',
  29. 'no-unused-collection',
  30. 'no-use-of-empty-return-value',
  31. 'no-useless-catch',
  32. 'non-existent-operator',
  33. 'prefer-immediate-return',
  34. 'prefer-object-literal',
  35. 'prefer-single-boolean-return',
  36. 'prefer-while',
  37. ];
  38. const sonarjsRuleModules = {};
  39. exports.rules = sonarjsRuleModules;
  40. const configs = {
  41. recommended: { plugins: ['sonarjs'], rules: {} },
  42. };
  43. exports.configs = configs;
  44. sonarjsRules.forEach(rule => {
  45. sonarjsRuleModules[rule] = require(`./rules/${rule}`);
  46. const { meta: { docs: { recommended }, }, } = sonarjsRuleModules[rule];
  47. configs.recommended.rules[`sonarjs/${rule}`] = recommended === false ? 'off' : recommended;
  48. });
  49. //# sourceMappingURL=index.js.map