@@ -6,7 +6,7 @@ import { readFileSync } from 'fs'
66import eslintPluginJs from '@eslint/js'
77import eslintPluginStylistic from '@stylistic/eslint-plugin'
88import eslintPluginCypress from 'eslint-plugin-cypress'
9- import eslintPluginImport from 'eslint-plugin-import'
9+ import eslintPluginImport from 'eslint-plugin-import-x '
1010import eslintPluginJSDoc from 'eslint-plugin-jsdoc'
1111import eslintPluginMocha from 'eslint-plugin-mocha'
1212import eslintPluginN from 'eslint-plugin-n'
@@ -265,7 +265,7 @@ export default [
265265 'import/no-self-import' : 'error' ,
266266 'import/order' : [ 'error' , {
267267 // `dd-trace` must be allowed first (and is often intentionally required before any other module).
268- // eslint-plugin-import defaults can exclude some import types (notably `builtin`) from `pathGroups`,
268+ // eslint-plugin-import-x defaults can exclude some import types (notably `builtin`) from `pathGroups`,
269269 // which would make the `dd-trace` exception below a no-op. Make this explicit.
270270 pathGroupsExcludedImportTypes : [ ] ,
271271 pathGroups : [
@@ -324,6 +324,9 @@ export default [
324324 'no-sequences' : 'error' ,
325325 'no-template-curly-in-string' : 'error' ,
326326 'no-throw-literal' : 'error' ,
327+ // Surfaces pre-existing latent bugs (always-undefined vars in tests/intake helpers)
328+ // unrelated to this tooling bump; worth a focused follow-up.
329+ 'no-unassigned-vars' : 'off' ,
327330 'no-undef-init' : 'error' ,
328331 'no-unmodified-loop-condition' : 'error' ,
329332 'no-unneeded-ternary' : [ 'error' , { defaultAssignment : false } ] ,
@@ -353,6 +356,8 @@ export default [
353356 'prefer-const' : [ 'error' , { destructuring : 'all' } ] ,
354357 'prefer-promise-reject-errors' : 'error' ,
355358 'prefer-regex-literals' : [ 'error' , { disallowRedundantWrapping : true } ] ,
359+ // Newly enabled by the ESLint 10 bump; deferred with no-unassigned-vars above.
360+ 'preserve-caught-error' : 'off' ,
356361 'promise/param-names' : 'error' ,
357362 'symbol-description' : 'error' ,
358363 'unicode-bom' : [ 'error' , 'never' ] ,
@@ -580,42 +585,120 @@ export default [
580585
581586 ...eslintPluginUnicorn . configs . recommended . rules ,
582587
583- // Overriding recommended unicorn rules
588+ // Overriding recommended unicorn rules.
589+ // Rules not listed here are left at the `recommended` default. The v65→v68 bump
590+ // turned ~130 rules on in `recommended`; the entries below are the ones that fire
591+ // on our source and are intentionally kept off (counts are from the v68 run).
584592 'unicorn/catch-error-name' : [ 'off' , { name : 'err' } ] , // Many errors
585593 'unicorn/expiring-todo-comments' : 'off' ,
586- 'unicorn/filename-case' : [ 'off' , { case : 'kebabCase' } ] , // // Many errors
594+ 'unicorn/filename-case' : [ 'off' , { case : 'kebabCase' } ] , // Many errors
595+ 'unicorn/name-replacements' : 'off' , // Many errors | naming churn (split out of prevent-abbreviations)
587596 'unicorn/prevent-abbreviations' : 'off' , // Many errors
588597
589598 // These rules require a newer Node.js version than we support
590599 'unicorn/no-array-reverse' : 'off' , // Node.js 20
591600 'unicorn/no-array-sort' : 'off' , // Node.js 20
601+ 'unicorn/prefer-dispose' : 'off' , // Explicit resource management (newer Node.js)
602+ 'unicorn/prefer-iterator-to-array' : 'off' , // Iterator helpers (Node.js 22)
603+ 'unicorn/prefer-iterator-to-array-at-end' : 'off' , // Iterator helpers (Node.js 22)
604+ 'unicorn/prefer-promise-with-resolvers' : 'off' , // 6 errors | Promise.withResolvers (Node.js 22)
605+ 'unicorn/prefer-temporal' : 'off' , // Temporal is not stable on supported Node.js
606+ 'unicorn/prefer-uint8array-base64' : 'off' , // Uint8Array base64 (Node.js 22)
592607
593- // These rules could potentially evaluated again at a much later point
608+ // These rules could potentially be evaluated again at a much later point
609+ 'unicorn/class-reference-in-static-methods' : 'off' , // 6 errors
610+ 'unicorn/consistent-class-member-order' : 'off' , // 55 errors | ordering churn
611+ 'unicorn/consistent-conditional-object-spread' : 'off' , // 3 errors
612+ 'unicorn/consistent-optional-chaining' : 'off' , // 3 errors
594613 'unicorn/explicit-length-check' : 'off' , // Not a big advantage
614+ 'unicorn/explicit-timer-delay' : 'off' , // Covered by our own timer lint rules
595615 'unicorn/no-array-callback-reference' : 'off' ,
616+ 'unicorn/no-computed-property-existence-check' : 'off' , // 160 errors | needs an audit
617+ 'unicorn/no-declarations-before-early-exit' : 'off' , // 62 errors
618+ 'unicorn/no-duplicate-if-branches' : 'off' , // 1 error | may surface real bugs
619+ 'unicorn/no-duplicate-logical-operands' : 'off' , // 2 errors | may surface real bugs
620+ 'unicorn/no-error-property-assignment' : 'off' , // 6 errors
596621 'unicorn/no-for-loop' : 'off' , // Activate if this is resolved https://github.com/sindresorhus/eslint-plugin-unicorn/issues/2664
622+ 'unicorn/no-incorrect-template-string-interpolation' : 'off' , // 3 errors | audit for real bugs first
623+ 'unicorn/no-invalid-argument-count' : 'off' , // 98 errors | high false-positive risk, worth a focused pass
624+ 'unicorn/no-loop-iterable-mutation' : 'off' , // 2 errors | may surface real bugs
625+ 'unicorn/no-nonstandard-builtin-properties' : 'off' , // 34 errors | needs an audit
597626 'unicorn/no-this-assignment' : 'off' , // This would need some further refactoring and the benefit is small
627+ 'unicorn/no-undeclared-class-members' : 'off' , // 272 errors | requires declaring every field
628+ 'unicorn/no-unreadable-array-destructuring' : 'off' , // 4 errors | not autofixable, needs manual rewrite
629+ 'unicorn/no-unreadable-for-of-expression' : 'off' , // 32 errors
630+ 'unicorn/no-unreadable-object-destructuring' : 'off' , // 57 errors
631+ 'unicorn/no-unsafe-string-replacement' : 'off' , // 6 errors
632+ 'unicorn/no-useless-recursion' : 'off' , // 2 errors
598633 'unicorn/prefer-code-point' : 'off' , // Should be activated, but needs a refactor of some code
599- 'unicorn/prefer-queue-microtask' : 'off' , // No advantage for us
634+ 'unicorn/prefer-early-return' : 'off' , // 67 errors | tension with our positive-`if` style
635+ 'unicorn/prefer-hoisting-branch-code' : 'off' , // 2 errors | reshapes branch bodies
636+ 'unicorn/prefer-minimal-ternary' : 'off' , // 24 errors
637+ 'unicorn/prefer-number-is-safe-integer' : 'off' , // 17 errors
638+ 'unicorn/prefer-object-iterable-methods' : 'off' , // 56 errors
639+ 'unicorn/prefer-queue-microtask' : 'off' , // process.nextTick semantics differ
640+ 'unicorn/prefer-smaller-scope' : 'off' , // 3 errors
641+ 'unicorn/prefer-split-limit' : 'off' , // 23 errors
642+ 'unicorn/require-array-sort-compare' : 'off' , // 8 errors | may surface real default-sort bugs
600643
601644 // The following rules should not be activated!
645+ 'unicorn/consistent-boolean-name' : 'off' , // Would rename public API and config booleans
602646 'unicorn/import-style' : 'off' , // Questionable benefit
647+ 'unicorn/max-nested-calls' : 'off' , // Questionable benefit
603648 'unicorn/no-array-reduce' : 'off' , // Questionable benefit
604- 'unicorn/no-hex-escape' : 'off' , // Questionable benefit
649+ 'unicorn/no-array-splice' : 'off' , // toSpliced copies the whole array (perf)
650+ 'unicorn/no-break-in-nested-loop' : 'off' , // Conflicts with our performance-oriented loops
651+ 'unicorn/no-global-object-property-assignment' : 'off' , // We use globalThis[Symbol.for('dd-trace')]
605652 'unicorn/no-nested-ternary' : 'off' , // Not really an issue in the code and the benefit is small
606653 'unicorn/no-new-array' : 'off' , // new Array is often used for performance reasons
607654 'unicorn/no-null' : 'off' , // We do not control external APIs and it is hard to differentiate these
655+ 'unicorn/no-return-array-push' : 'off' , // Questionable benefit
608656 'unicorn/no-this-outside-of-class' : 'off' , // This will not work for us
657+ 'unicorn/no-top-level-assignment-in-function' : 'off' , // Module-level singletons are assigned from functions
658+ 'unicorn/no-useless-else' : 'off' , // Covered by core no-else-return
659+ 'unicorn/operator-assignment' : 'off' , // Covered by core operator-assignment
660+ 'unicorn/prefer-array-last-methods' : 'off' , // Questionable benefit
661+ 'unicorn/prefer-await' : 'off' , // We avoid async/await in production hot paths
609662 'unicorn/prefer-event-target' : 'off' , // Benefit only outside of Node.js
610663 'unicorn/prefer-global-this' : 'off' , // Questionable benefit in Node.js alone
611664 'unicorn/prefer-includes-over-repeated-comparisons' : 'off' , // Bad for performance
612665 'unicorn/prefer-math-trunc' : 'off' , // Math.trunc is not a 1-to-1 replacement for most of our usage
613666 'unicorn/prefer-module' : 'off' , // We use CJS
614667 'unicorn/prefer-node-protocol' : 'off' , // May not be used due to guardrails
668+ 'unicorn/prefer-number-coercion' : 'off' , // Number() is not a 1-to-1 replacement for parseInt/parseFloat
669+ 'unicorn/prefer-private-class-fields' : 'off' , // Many `_underscore` fields cross module boundaries
615670 'unicorn/prefer-reflect-apply' : 'off' , // Questionable benefit and more than 500 matches
671+ 'unicorn/prefer-short-arrow-method' : 'off' , // Method shorthand is intentional; arrow properties change `this`
616672 'unicorn/prefer-switch' : 'off' , // Questionable benefit
617673 'unicorn/prefer-top-level-await' : 'off' , // Only useful when using ESM
674+ 'unicorn/prefer-unicode-code-point-escapes' : 'off' , // Replaces the dropped no-hex-escape; questionable benefit
618675 'unicorn/switch-case-braces' : 'off' , // Questionable benefit
676+
677+ // Safe to enable in a follow-up: autofixable and aligned with our style. Kept off
678+ // here only to keep this version bump free of source churn (counts from the v68 run).
679+ 'unicorn/logical-assignment-operators' : 'off' , // 42 errors | matches our ??=/||= usage
680+ 'unicorn/no-for-each' : 'off' , // 10 errors | we already prefer for-of in production
681+ 'unicorn/no-negated-array-predicate' : 'off' , // 2 errors
682+ 'unicorn/no-negated-comparison' : 'off' , // 1 error
683+ 'unicorn/no-subtraction-comparison' : 'off' , // 2 errors
684+ 'unicorn/no-unnecessary-boolean-comparison' : 'off' , // 6 errors
685+ 'unicorn/no-unnecessary-global-this' : 'off' , // 4 errors
686+ 'unicorn/no-unnecessary-splice' : 'off' , // 2 errors
687+ 'unicorn/no-useless-concat' : 'off' , // 4 errors
688+ 'unicorn/no-useless-continue' : 'off' , // 1 error
689+ 'unicorn/no-useless-delete-check' : 'off' , // 1 error
690+ 'unicorn/no-useless-fallback-in-spread' : 'off' , // 5 errors
691+ 'unicorn/no-useless-override' : 'off' , // 1 error
692+ 'unicorn/no-useless-template-literals' : 'off' , // 13 errors
693+ 'unicorn/prefer-array-from-map' : 'off' , // 6 errors
694+ 'unicorn/prefer-boolean-return' : 'off' , // 1 error
695+ 'unicorn/prefer-continue' : 'off' , // 52 errors
696+ 'unicorn/prefer-direct-iteration' : 'off' , // 5 errors
697+ 'unicorn/prefer-else-if' : 'off' , // 6 errors
698+ 'unicorn/prefer-global-number-constants' : 'off' , // 3 errors
699+ 'unicorn/prefer-logical-operator-over-ternary' : 'off' , // 3 errors
700+ 'unicorn/prefer-ternary' : 'off' , // 16 errors
701+ 'unicorn/prefer-unary-minus' : 'off' , // 1 error
619702 } ,
620703 } ,
621704 {
0 commit comments