index.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  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 all = require('./configs/all.js');
  6. const deprecatedRules = createDeprecatedRules({
  7. // {ruleId: ReplacementRuleId | ReplacementRuleId[]}, if no replacement, use `{ruleId: []}`
  8. 'no-array-instanceof': 'unicorn/no-instanceof-array',
  9. 'no-fn-reference-in-iterator': 'unicorn/no-array-callback-reference',
  10. 'no-reduce': 'unicorn/no-array-reduce',
  11. 'prefer-dataset': 'unicorn/prefer-dom-node-dataset',
  12. 'prefer-event-key': 'unicorn/prefer-keyboard-event-key',
  13. 'prefer-exponentiation-operator': 'prefer-exponentiation-operator',
  14. 'prefer-flat-map': 'unicorn/prefer-array-flat-map',
  15. 'prefer-node-append': 'unicorn/prefer-dom-node-append',
  16. 'prefer-node-remove': 'unicorn/prefer-dom-node-remove',
  17. 'prefer-replace-all': 'unicorn/prefer-string-replace-all',
  18. 'prefer-starts-ends-with': 'unicorn/prefer-string-starts-ends-with',
  19. 'prefer-text-content': 'unicorn/prefer-dom-node-text-content',
  20. 'prefer-trim-start-end': 'unicorn/prefer-string-trim-start-end',
  21. 'regex-shorthand': 'unicorn/better-regex',
  22. });
  23. module.exports = {
  24. rules: {
  25. ...loadRules(),
  26. ...deprecatedRules,
  27. },
  28. configs: {
  29. recommended: recommendedConfig,
  30. all,
  31. },
  32. };