index.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. 'use strict';
  2. const createDeprecatedRules = require('./rules/utils/create-deprecated-rules.js');
  3. const {loadRules} = require('./rules/utils/rule.js');
  4. const recommendedConfig = require('./configs/recommended.js');
  5. const allRulesEnabledConfig = require('./configs/all.js');
  6. const deprecatedRules = createDeprecatedRules({
  7. // {ruleId: ReplacementRuleId | ReplacementRuleId[]}, if no replacement, use `{ruleId: []}`
  8. 'import-index': [],
  9. 'no-array-instanceof': 'unicorn/no-instanceof-array',
  10. 'no-fn-reference-in-iterator': 'unicorn/no-array-callback-reference',
  11. 'no-reduce': 'unicorn/no-array-reduce',
  12. 'prefer-dataset': 'unicorn/prefer-dom-node-dataset',
  13. 'prefer-event-key': 'unicorn/prefer-keyboard-event-key',
  14. 'prefer-exponentiation-operator': 'prefer-exponentiation-operator',
  15. 'prefer-flat-map': 'unicorn/prefer-array-flat-map',
  16. 'prefer-node-append': 'unicorn/prefer-dom-node-append',
  17. 'prefer-node-remove': 'unicorn/prefer-dom-node-remove',
  18. 'prefer-object-has-own': 'prefer-object-has-own',
  19. 'prefer-replace-all': 'unicorn/prefer-string-replace-all',
  20. 'prefer-starts-ends-with': 'unicorn/prefer-string-starts-ends-with',
  21. 'prefer-text-content': 'unicorn/prefer-dom-node-text-content',
  22. 'prefer-trim-start-end': 'unicorn/prefer-string-trim-start-end',
  23. 'regex-shorthand': 'unicorn/better-regex',
  24. });
  25. module.exports = {
  26. rules: {
  27. ...loadRules(),
  28. ...deprecatedRules,
  29. },
  30. configs: {
  31. recommended: recommendedConfig,
  32. all: allRulesEnabledConfig,
  33. },
  34. };