-
Notifications
You must be signed in to change notification settings - Fork 53
Description
Have you tried to resolve this issue yourself first?
- I confirm I have gone through the above steps and still have an issue to report.
Bug Description
Greetings,
First off, thank you for your work on this.
We've started running the code-analyzer routinely and discovered that we're getting a sev-1 reported by ESLint, not for a linting failure, but because:
Message
The engine with name 'eslint' threw an unexpected error: Error: The eslint engine encountered an unexpected error thrown from 'ESLint.lintFiles': | Error: Error while loading rule 'jest/no-deprecated-functions': Unable to detect Jest version - please ensure jest package is installed, or otherwise set version explicitly | Occurred while linting /Users/kpoorman/src/vacatiaDx/vacatia/main/default/lwc/accordion/accordion.js | at detectJestVersion (/Users/kpoorman/.local/share/sf/node_modules/@salesforce/plugin-code-analyzer/node_modules/eslint-plugin-jest/lib/rules/utils/detectJestVersion.js:22:9) | at create (/Users/kpoorman/.local/share/sf/node_modules/@salesforce/plugin-code-analyzer/node_modules/eslint-plugin-jest/lib/rules/no-deprecated-functions.js:31:107) | at Object.create (/Users/kpoorman/.local/share/sf/node_modules/@salesforce/plugin-code-analyzer/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js:31:20) | at createRuleListeners (/Users/kpoorman/.local/share/sf/node_modules/@salesforce/plugin-code-analyzer/node_modules/eslint/lib/linter/linter.js:1019:15) | at /Users/kpoorman/.local/share/sf/node_modules/@salesforce/plugin-code-analyzer/node_modules/eslint/lib/linter/linter.js:1151:7 | at Array.forEach (<anonymous>) | at runRules (/Users/kpoorman/.local/share/sf/node_modules/@salesforce/plugin-code-analyzer/node_modules/eslint/lib/linter/linter.js:1085:31) | at #flatVerifyWithoutProcessors (/Users/kpoorman/.local/share/sf/node_modules/@salesforce/plugin-code-analyzer/node_modules/eslint/lib/linter/linter.js:2101:4) | at Linter._verifyWithFlatConfigArrayAndWithoutProcessors (/Users/kpoorman/.local/share/sf/node_modules/@salesforce/plugin-code-analyzer/node_modules/eslint/lib/linter/linter.js:2189:43) | at Linter._verifyWithFlatConfigArray (/Users/kpoorman/.local/share/sf/node_modules/@salesforce/plugin-code-analyzer/node_modules/eslint/lib/linter/linter.js:2292:15) | at Linter.verify (/Users/kpoorman/.local/share/sf/node_modules/@salesforce/plugin-code-analyzer/node_modules/eslint/lib/linter/linter.js:1677:10) | at Linter.verifyAndFix (/Users/kpoorman/.local/share/sf/node_modules/@salesforce/plugin-code-analyzer/node_modules/eslint/lib/linter/linter.js:2557:20) | at verifyText (/Users/kpoorman/.local/share/sf/node_modules/@salesforce/plugin-code-analyzer/node_modules/eslint/lib/eslint/eslint-helpers.js:1180:45) | at readAndVerifyFile (/Users/kpoorman/.local/share/sf/node_modules/@salesforce/plugin-code-analyzer/node_modules/eslint/lib/eslint/eslint-helpers.js:1321:10) ESLint options used: { "cwd": "/Users/kpoorman/src/vacatiaDx", "errorOnUnmatchedPattern": false, "baseConfig": [ { "linterOptions": { "reportUnusedDisableDirectives": false }, "languageOptions": { "globals": "[object is hidden to keep output brief]" } }, { "languageOptions": { "parser": { "meta": { "name": "@babel/eslint-parser", "version": "7.25.9" }, "parse": "[Function]", "parseForESLint": "[Function]" }, "parserOptions": { "requireConfigFile": false, "babelOptions": { "babelrc": false, "parserOpts": { "plugins": { "0": { "meta": { "name": "undefined", "version": "undefined" }, "otherProperties": "[plugin properties are hidden to keep output brief]" } } }, "configFile": false }, "sourceType": "undefined" }, "globals": "[object is hidden to keep output brief]" }, "plugins": { "@lwc/lwc": { "meta": { "name": "@lwc/eslint-plugin-lwc", "version": "3.2.0" }, "otherProperties": "[plugin properties are hidden to keep output brief]" } }, "rules": { "@lwc/lwc/no-deprecated": "error", "@lwc/lwc/valid-api": "error", "@lwc/lwc/valid-track": "error", "@lwc/lwc/valid-wire": "error", "@lwc/lwc/no-unknown-wire-adapters": [ "error", { "adapters": "[array is hidden to keep output brief]" } ], "@lwc/lwc/no-unexpected-wire-adapter-usages": [ "error", { "adapters": "[array is hidden to keep output brief]" } ], "@lwc/lwc/no-disallowed-lwc-imports": "error", "no-restricted-imports": [ "error", { "patterns": [ { "group": [ "@salesforce/lds", "@salesforce/lds/**" ], "message": "Please do not import from @salesforce/lds, these modules are ephemeral and could change at any time." } ] } ] }, "files": [ "**/*.js", "**/*.cjs", "**/*.mjs" ] }, { "rules": { "accessor-pairs": "error", "array-callback-return": "error", "arrow-body-style": "error", "block-scoped-var": "error", "camelcase": "error", "capitalized-comments": "error", "class-methods-use-this": "error", "complexity": "error", "consistent-return": "error", "consistent-this": "error", "constructor-super": "error", "curly": "error", "default-case": "error", "default-case-last": "error", "default-param-last": "error", "dot-notation": "error", "eqeqeq": "error", "for-direction": "error", "func-name-matching": "error", "func-names": "error", "func-style": "error", "getter-return": "error", "grouped-accessor-pairs": "error", "guard-for-in": "error", "id-denylist": "error", "id-length": "error", "id-match": "error", "init-declarations": "error", "logical-assignment-operators": "error", "max-classes-per-file": "error", "max-depth": "error", "max-lines": "error", "max-lines-per-function": "error", "max-nested-callbacks": "error", "max-params": "error", "max-statements": "error", "new-cap": "error", "no-alert": "error", "no-array-constructor": "error", "no-async-promise-executor": "error", "no-await-in-loop": "error", "no-bitwise": "error", "no-caller": "error", "no-case-declarations": "error", "no-class-assign": "error", "no-compare-neg-zero": "error", "no-cond-assign": "error", "no-console": "error", "no-const-assign": "error", "no-constant-binary-expression": "error", "no-constant-condition": "error", "no-constructor-return": "error", "no-continue": "error", "no-control-regex": "error", "no-debugger": "error", "no-delete-var": "error", "no-div-regex": "error", "no-dupe-args": "error", "no-dupe-class-members": "error", "no-dupe-else-if": "error", "no-dupe-keys": "error", "no-duplicate-case": "error", "no-duplicate-imports": "error", "no-else-return": "error", "no-empty": "error", "no-empty-character-class": "error", "no-empty-function": "error", "no-empty-pattern": "error", "no-empty-static-block": "error", "no-eq-null": "error", "no-eval": "error", "no-ex-assign": "error", "no-extend-native": "error", "no-extra-bind": "error", "no-extra-boolean-cast": "error", "no-extra-label": "error", "no-fallthrough": "error", "no-func-assign": "error", "no-global-assign": "error", "no-implicit-coercion": "error", "no-implicit-globals": "error", "no-implied-eval": "error", "no-import-assign": "error", "no-inline-comments": "error", "no-inner-declarations": "error", "no-invalid-regexp": "error", "no-invalid-this": "error", "no-irregular-whitespace": "error", "no-iterator": "error", "no-label-var": "error", "no-labels": "error", "no-lone-blocks": "error", "no-lonely-if": "error", "no-loop-func": "error", "no-loss-of-precision": "error", "no-magic-numbers": "error", "no-misleading-character-class": "error", "no-multi-assign": "error", "no-multi-str": "error", "no-negated-condition": "error", "no-nested-ternary": "error", "no-new": "error", "no-new-func": "error", "no-new-native-nonconstructor": "error", "no-new-wrappers": "error", "no-nonoctal-decimal-escape": "error", "no-obj-calls": "error", "no-object-constructor": "error", "no-octal": "error", "no-octal-escape": "error", "no-param-reassign": "error", "no-plusplus": "error", "no-promise-executor-return": "error", "no-proto": "error", "no-prototype-builtins": "error", "no-redeclare": "error", "no-regex-spaces": "error", "no-restricted-exports": "error", "no-restricted-globals": "error", "no-restricted-imports": "error", "no-restricted-properties": "error", "no-restricted-syntax": "error", "no-return-assign": "error", "no-script-url": "error", "no-self-assign": "error", "no-self-compare": "error", "no-sequences": "error", "no-setter-return": "error", "no-shadow": "error", "no-shadow-restricted-names": "error", "no-sparse-arrays": "error", "no-template-curly-in-string": "error", "no-ternary": "error", "no-this-before-super": "error", "no-throw-literal": "error", "no-unassigned-vars": "error", "no-undef": "error", "no-undef-init": "error", "no-undefined": "error", "no-underscore-dangle": "error", "no-unexpected-multiline": "error", "no-unmodified-loop-condition": "error", "no-unneeded-ternary": "error", "no-unreachable": "error", "no-unreachable-loop": "error", "no-unsafe-finally": "error", "no-unsafe-negation": "error", "no-unsafe-optional-chaining": "error", "no-unused-expressions": "error", "no-unused-labels": "error", "no-unused-private-class-members": "error", "no-unused-vars": "error", "no-use-before-define": "error", "no-useless-assignment": "error", "no-useless-backreference": "error", "no-useless-call": "error", "no-useless-catch": "error", "no-useless-computed-key": "error", "no-useless-concat": "error", "no-useless-constructor": "error", "no-useless-escape": "error", "no-useless-rename": "error", "no-useless-return": "error", "no-var": "error", "no-void": "error", "no-warning-comments": "error", "no-with": "error", "object-shorthand": "error", "one-var": "error", "operator-assignment": "error", "prefer-arrow-callback": "error", "prefer-const": "error", "prefer-destructuring": "error", "prefer-exponentiation-operator": "error", "prefer-named-capture-group": "error", "prefer-numeric-literals": "error", "prefer-object-has-own": "error", "prefer-object-spread": "error", "prefer-promise-reject-errors": "error", "prefer-regex-literals": "error", "prefer-rest-params": "error", "prefer-spread": "error", "prefer-template": "error", "preserve-caught-error": "error", "radix": "error", "require-atomic-updates": "error", "require-await": "error", "require-unicode-regexp": "error", "require-yield": "error", "sort-imports": "error", "sort-keys": "error", "sort-vars": "error", "strict": "error", "symbol-description": "error", "unicode-bom": "error", "use-isnan": "error", "valid-typeof": "error", "vars-on-top": "error", "yoda": "error" }, "files": [ "**/*.js", "**/*.cjs", "**/*.mjs" ] }, { "rules": { "import/no-unresolved": 2, "import/named": 2, "import/namespace": 2, "import/default": 2, "import/export": 2 }, "name": "import/errors", "plugins": { "import": { "meta": { "name": "eslint-plugin-import", "version": "2.32.0" }, "otherProperties": "[plugin properties are hidden to keep output brief]" } }, "files": [ "**/*.js", "**/*.cjs", "**/*.mjs" ] }, { "plugins": { "jest": { "meta": { "name": "eslint-plugin-jest", "version": "29.0.1" }, "otherProperties": "[plugin properties are hidden to keep output brief]" } }, "languageOptions": { "globals": "[object is hidden to keep output brief]" }, "rules": { "jest/expect-expect": "warn", "jest/no-alias-methods": "error", "jest/no-commented-out-tests": "warn", "jest/no-conditional-expect": "error", "jest/no-deprecated-functions": "off", "jest/no-disabled-tests": "warn", "jest/no-done-callback": "error", "jest/no-export": "error", "jest/no-focused-tests": "error", "jest/no-identical-title": "error", "jest/no-interpolation-in-snapshots": "error", "jest/no-jasmine-globals": "error", "jest/no-mocks-import": "error", "jest/no-standalone-expect": "error", "jest/no-test-prefixes": "error", "jest/valid-describe-callback": "error", "jest/valid-expect": "error", "jest/valid-expect-in-promise": "error", "jest/valid-title": "error" }, "files": [ "**/*.js", "**/*.cjs", "**/*.mjs" ] }, { "plugins": { "@salesforce/lightning": { "meta": { "name": "@salesforce/eslint-plugin-lightning", "version": "2.0.0" }, "otherProperties": "[plugin properties are hidden to keep output brief]" } }, "languageOptions": { "globals": "[object is hidden to keep output brief]" }, "rules": { "no-await-in-loop": "error", "array-callback-return": "error", "consistent-return": "error", "default-case": "error", "dot-notation": [ "error", { "allowKeywords": true } ], "eqeqeq": [ "error", "smart" ], "guard-for-in": "error", "no-alert": "error", "no-caller": "error", "no-else-return": "error", "no-empty-function": [ "error", { "allow": [ "arrowFunctions", "functions", "methods" ] } ], "no-eval": "error", "no-extend-native": "error", "no-extra-bind": "error", "no-floating-decimal": "error", "no-implied-eval": "error", "no-iterator": "error", "no-labels": "error", "no-loop-func": "error", "no-multi-str": "error", "no-new": "error", "no-new-func": "error", "no-new-object": "error", "no-new-wrappers": "error", "no-octal-escape": "error", "no-proto": "error", "no-return-assign": "error", "no-return-await": "error", "no-script-url": "error", "no-self-compare": "error", "no-sequences": "error", "no-throw-literal": "error", "no-useless-concat": "error", "no-useless-escape": "error", "no-useless-return": "error", "no-unused-expressions": "error", "no-void": "error", "no-with": "error", "radix": "error", "vars-on-top": "error", "wrap-iife": [ "error", "any" ], "no-label-var": "error", "no-restricted-globals": [ "error", "addEventListener", "blur", "close", "closed", "confirm", "defaultStatus", "event", "external", "defaultstatus", "find", "focus", "frameElement", "frames", "history", "innerHeight", "innerWidth", "length", "location", "locationbar", "menubar", "moveBy", "moveTo", "name", "onblur", "onerror", "onfocus", "onload", "onresize", "onunload", "open", "opener", "opera", "outerHeight", "outerWidth", "pageXOffset", "pageYOffset", "parent", "print", "removeEventListener", "resizeBy", "resizeTo", "screen", "screenLeft", "screenTop", "screenX", "screenY", "scroll", "scrollbars", "scrollBy", "scrollTo", "scrollX", "scrollY", "self", "status", "statusbar", "stop", "toolbar", "top" ], "no-shadow": "error", "no-shadow-restricted-names": "error", "no-undef-init": "error", "no-unused-vars": [ "error", { "vars": "all", "args": "after-used" } ], "no-use-before-define": [ "error", { "functions": false } ], "handle-callback-err": "error", "no-confusing-arrow": "error", "no-useless-computed-key": "error", "no-useless-constructor": "error", "no-useless-rename": "error", "@lwc/lwc/no-api-reassignments": "error", "@lwc/lwc/no-async-operation": "error", "@lwc/lwc/no-attributes-during-construction": "error", "@lwc/lwc/no-document-query": "error", "@lwc/lwc/no-inner-html": "error", "@lwc/lwc/no-leading-uppercase-api-name": "error", "@lwc/lwc/no-template-children": "error", "@lwc/lwc/prefer-custom-event": "error", "@lwc/lwc/valid-api": [ "error", { "disallowUnderscoreUppercaseMix": true } ], "@lwc/lwc/valid-graphql-wire-adapter-callback-parameters": "error", "@salesforce/lightning/valid-apex-method-invocation": "error", "import/no-unresolved": "off", "@lwc/lwc/no-dupe-class-members": "off" }, "files": [ "**/*.js", "**/*.cjs", "**/*.mjs" ] }, { "plugins": { "@lwc/lwc-platform": { "meta": { "name": "@salesforce/eslint-plugin-lightning", "version": "6.3.0" }, "otherProperties": "[plugin properties are hidden to keep output brief]" } }, "rules": { "@lwc/lwc-platform/no-aura-libs": "error", "@lwc/lwc-platform/no-aura": "error", "@lwc/lwc-platform/no-community-import": "error", "@lwc/lwc-platform/no-create-context-provider": "error", "@lwc/lwc-platform/no-deprecated-module-import": "error", "@lwc/lwc-platform/no-dynamic-import": "off", "@lwc/lwc-platform/no-dynamic-import-identifier": "error", "@lwc/lwc-platform/no-dynamic-import-relative-path-string": "off", "@lwc/lwc-platform/no-restricted-namespaces": "error", "@lwc/lwc-platform/no-inline-disable": "error", "@lwc/lwc-platform/no-interop-create": "error", "@lwc/lwc-platform/no-interop-dispatch": "error", "@lwc/lwc-platform/no-interop-execute": "error", "@lwc/lwc-platform/no-interop-execute-privileged": "error", "@lwc/lwc-platform/no-interop-execute-raw-response": "error", "@lwc/lwc-platform/no-interop-execute-with-callback": "error", "@lwc/lwc-platform/no-interop-get-event": "error", "@lwc/lwc-platform/no-interop-get-module": "error", "@lwc/lwc-platform/no-interop-is-external-definition": "error", "@lwc/lwc-platform/no-interop-module-instrumentation": "error", "@lwc/lwc-platform/no-interop-module-storage": "error", "@lwc/lwc-platform/no-interop-load-definitions": "error", "@lwc/lwc-platform/no-interop-execute-controller-with-client-def": "error", "@lwc/lwc-platform/no-interop-register": "error", "@lwc/lwc-platform/no-interop-sanitize": "error", "@lwc/lwc-platform/no-interop-render": "error", "@lwc/lwc-platform/no-interop": "error", "@lwc/lwc-platform/no-lds-aura-controller-method": "error", "@lwc/lwc-platform/no-process-env": "error", "@lwc/lwc-platform/no-site-import": "error", "@lwc/lwc-platform/no-wire-service": "error", "@lwc/lwc-platform/valid-dynamic-import-hint": "error", "@lwc/lwc-platform/valid-offline-wire": "off" }, "files": [ "**/*.js", "**/*.cjs", "**/*.mjs" ] }, { "files": [ "**/*.css", "**/*.scss" ], "language": "css/css", "plugins": { "css": { "meta": { "name": "@eslint/css", "version": "0.9.0" }, "otherProperties": "[plugin properties are hidden to keep output brief]" }, "@salesforce-ux/slds": { "meta": { "name": "@salesforce-ux/eslint-plugin-slds", "version": "1.0.2" }, "otherProperties": "[plugin properties are hidden to keep output brief]" } }, "rules": { "@salesforce-ux/slds/no-slds-class-overrides": "warn", "@salesforce-ux/slds/no-deprecated-slds-classes": "warn", "@salesforce-ux/slds/lwc-token-to-slds-hook": "error", "@salesforce-ux/slds/enforce-sds-to-slds-hooks": "warn", "@salesforce-ux/slds/no-sldshook-fallback-for-lwctoken": "warn", "@salesforce-ux/slds/no-unsupported-hooks-slds2": "warn", "@salesforce-ux/slds/no-slds-var-without-fallback": "warn", "@salesforce-ux/slds/no-slds-namespace-for-custom-hooks": "warn", "@salesforce-ux/slds/enforce-component-hook-naming-convention": "error", "@salesforce-ux/slds/no-slds-private-var": "warn", "@salesforce-ux/slds/no-hardcoded-values-slds2": "warn", "@salesforce-ux/slds/reduce-annotations": "warn" }, "languageOptions": { "tolerant": true }, "settings": { "sldsRules": { "@salesforce-ux/slds/no-slds-class-overrides": "warn", "@salesforce-ux/slds/no-deprecated-slds-classes": "warn", "@salesforce-ux/slds/lwc-token-to-slds-hook": "error", "@salesforce-ux/slds/enforce-sds-to-slds-hooks": "warn", "@salesforce-ux/slds/no-sldshook-fallback-for-lwctoken": "warn", "@salesforce-ux/slds/no-unsupported-hooks-slds2": "warn", "@salesforce-ux/slds/no-slds-var-without-fallback": "warn", "@salesforce-ux/slds/no-slds-namespace-for-custom-hooks": "warn", "@salesforce-ux/slds/enforce-component-hook-naming-convention": "error", "@salesforce-ux/slds/no-slds-private-var": "warn", "@salesforce-ux/slds/no-hardcoded-values-slds2": "warn", "@salesforce-ux/slds/reduce-annotations": "warn" } } }, { "files": [ "**/*.html", "**/*.htm", "**/*.cmp" ], "languageOptions": { "parser": { "TEMPLATE_ENGINE_SYNTAX": { "HANDLEBAR": { "{{": "}}" }, "TWIG": { "{{": "}}", "{%": "%}", "{#": "#}" }, "ERB": { "<%": "%>" } }, "parseForESLint": "[Function]", "NODE_TYPES": { "Document": "Document", "Tag": "Tag", "Text": "Text", "Doctype": "Doctype", "Comment": "Comment", "CommentOpen": "CommentOpen", "CommentClose": "CommentClose", "CommentContent": "CommentContent", "Attribute": "Attribute", "AttributeKey": "AttributeKey", "AttributeValue": "AttributeValue", "AttributeValueWrapperStart": "AttributeValueWrapperStart", "AttributeValueWrapperEnd": "AttributeValueWrapperEnd", "CloseTag": "CloseTag", "OpenTagEnd": "OpenTagEnd", "OpenTagStart": "OpenTagStart", "DoctypeOpen": "DoctypeOpen", "DoctypeAttribute": "DoctypeAttribute", "DoctypeClose": "DoctypeClose", "ScriptTag": "ScriptTag", "OpenScriptTagStart": "OpenScriptTagStart", "OpenScriptTagEnd": "OpenScriptTagEnd", "ScriptTagContent": "ScriptTagContent", "StyleTag": "StyleTag", "OpenStyleTagStart": "OpenStyleTagStart", "OpenStyleTagEnd": "OpenStyleTagEnd", "StyleTagContent": "StyleTagContent", "CloseStyleTag": "CloseStyleTag", "CloseScriptTag": "CloseScriptTag", "DoctypeAttributeValue": "DoctypeAttributeValue", "DoctypeAttributeWrapperStart": "DoctypeAttributeWrapperStart", "DoctypeAttributeWrapperEnd": "DoctypeAttributeWrapperEnd" }, "meta": { "name": "@html-eslint/parser", "version": "0.34.0" } }, "ecmaVersion": 2021, "sourceType": "module" }, "plugins": { "@salesforce-ux/slds": { "meta": { "name": "@salesforce-ux/eslint-plugin-slds", "version": "1.0.2" }, "otherProperties": "[plugin properties are hidden to keep output brief]" } }, "rules": { "@salesforce-ux/slds/enforce-bem-usage": "error", "@salesforce-ux/slds/no-deprecated-classes-slds2": "error", "@salesforce-ux/slds/modal-close-button-issue": "error" } }, { "rules": "[Exact same object as: <val>.baseConfig[2].rules]", "files": [ "**/*.ts" ], "languageOptions": { "parserOptions": { "projectService": true } } }, { "name": "typescript-eslint/base", "languageOptions": { "parser": { "meta": { "name": "typescript-eslint/parser", "version": "8.46.2" }, "parseForESLint": "[Function]" }, "sourceType": "module", "parserOptions": { "projectService": true } }, "plugins": { "@typescript-eslint": { "meta": { "name": "@typescript-eslint/eslint-plugin", "version": "8.46.2" }, "otherProperties": "[plugin properties are hidden to keep output brief]" } }, "files": [ "**/*.ts" ] }, { "files": [ "**/*.ts" ], "rules": { "constructor-super": "off", "getter-return": "off", "no-class-assign": "off", "no-const-assign": "off", "no-dupe-args": "off", "no-dupe-class-members": "off", "no-dupe-keys": "off", "no-func-assign": "off", "no-import-assign": "off", "no-new-native-nonconstructor": "off", "no-new-symbol": "off", "no-obj-calls": "off", "no-redeclare": "off", "no-setter-return": "off", "no-this-before-super": "off", "no-undef": "off", "no-unreachable": "off", "no-unsafe-negation": "off", "no-var": "error", "no-with": "off", "prefer-const": "error", "prefer-rest-params": "error", "prefer-spread": "error" }, "name": "typescript-eslint/eslint-recommended", "languageOptions": { "parserOptions": { "projectService": true } } }, { "name": "typescript-eslint/all", "rules": { "@typescript-eslint/adjacent-overload-signatures": "error", "@typescript-eslint/array-type": "error", "@typescript-eslint/await-thenable": "error", "@typescript-eslint/ban-ts-comment": "error", "@typescript-eslint/ban-tslint-comment": "error", "@typescript-eslint/class-literal-property-style": "error", "class-methods-use-this": "off", "@typescript-eslint/class-methods-use-this": "error", "@typescript-eslint/consistent-generic-constructors": "error", "@typescript-eslint/consistent-indexed-object-style": "error", "consistent-return": "off", "@typescript-eslint/consistent-return": "error", "@typescript-eslint/consistent-type-assertions": "error", "@typescript-eslint/consistent-type-definitions": "error", "@typescript-eslint/consistent-type-exports": "error", "@typescript-eslint/consistent-type-imports": "error", "default-param-last": "off", "@typescript-eslint/default-param-last": "error", "dot-notation": "off", "@typescript-eslint/dot-notation": "error", "@typescript-eslint/explicit-function-return-type": "error", "@typescript-eslint/explicit-member-accessibility": "error", "@typescript-eslint/explicit-module-boundary-types": "error", "init-declarations": "off", "@typescript-eslint/init-declarations": "error", "max-params": "off", "@typescript-eslint/max-params": "error", "@typescript-eslint/member-ordering": "error", "@typescript-eslint/method-signature-style": "error", "@typescript-eslint/naming-convention": "error", "no-array-constructor": "off", "@typescript-eslint/no-array-constructor": "error", "@typescript-eslint/no-array-delete": "error", "@typescript-eslint/no-base-to-string": "error", "@typescript-eslint/no-confusing-non-null-assertion": "error", "@typescript-eslint/no-confusing-void-expression": "error", "@typescript-eslint/no-deprecated": "error", "no-dupe-class-members": "off", "@typescript-eslint/no-dupe-class-members": "error", "@typescript-eslint/no-duplicate-enum-values": "error", "@typescript-eslint/no-duplicate-type-constituents": "error", "@typescript-eslint/no-dynamic-delete": "error", "no-empty-function": "off", "@typescript-eslint/no-empty-function": "error", "@typescript-eslint/no-empty-object-type": "error", "@typescript-eslint/no-explicit-any": "error", "@typescript-eslint/no-extra-non-null-assertion": "error", "@typescript-eslint/no-extraneous-class": "error", "@typescript-eslint/no-floating-promises": "error", "@typescript-eslint/no-for-in-array": "error", "no-implied-eval": "off", "@typescript-eslint/no-implied-eval": "error", "@typescript-eslint/no-import-type-side-effects": "error", "@typescript-eslint/no-inferrable-types": "error", "no-invalid-this": "off", "@typescript-eslint/no-invalid-this": "error", "@typescript-eslint/no-invalid-void-type": "error", "no-loop-func": "off", "@typescript-eslint/no-loop-func": "error", "no-magic-numbers": "off", "@typescript-eslint/no-magic-numbers": "error", "@typescript-eslint/no-meaningless-void-operator": "error", "@typescript-eslint/no-misused-new": "error", "@typescript-eslint/no-misused-promises": "error", "@typescript-eslint/no-misused-spread": "error", "@typescript-eslint/no-mixed-enums": "error", "@typescript-eslint/no-namespace": "error", "@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error", "@typescript-eslint/no-non-null-asserted-optional-chain": "error", "@typescript-eslint/no-non-null-assertion": "error", "no-redeclare": "off", "@typescript-eslint/no-redeclare": "error", "@typescript-eslint/no-redundant-type-constituents": "error", "@typescript-eslint/no-require-imports": "error", "no-restricted-imports": "off", "@typescript-eslint/no-restricted-imports": "error", "@typescript-eslint/no-restricted-types": "error", "no-shadow": "off", "@typescript-eslint/no-shadow": "error", "@typescript-eslint/no-this-alias": "error", "@typescript-eslint/no-unnecessary-boolean-literal-compare": "error", "@typescript-eslint/no-unnecessary-condition": "error", "@typescript-eslint/no-unnecessary-parameter-property-assignment": "error", "@typescript-eslint/no-unnecessary-qualifier": "error", "@typescript-eslint/no-unnecessary-template-expression": "error", "@typescript-eslint/no-unnecessary-type-arguments": "error", "@typescript-eslint/no-unnecessary-type-assertion": "error", "@typescript-eslint/no-unnecessary-type-constraint": "error", "@typescript-eslint/no-unnecessary-type-conversion": "error", "@typescript-eslint/no-unnecessary-type-parameters": "error", "@typescript-eslint/no-unsafe-argument": "error", "@typescript-eslint/no-unsafe-assignment": "error", "@typescript-eslint/no-unsafe-call": "error", "@typescript-eslint/no-unsafe-declaration-merging": "error", "@typescript-eslint/no-unsafe-enum-comparison": "error", "@typescript-eslint/no-unsafe-function-type": "error", "@typescript-eslint/no-unsafe-member-access": "error", "@typescript-eslint/no-unsafe-return": "error", "@typescript-eslint/no-unsafe-type-assertion": "error", "@typescript-eslint/no-unsafe-unary-minus": "error", "no-unused-expressions": "off", "@typescript-eslint/no-unused-expressions": "error", "no-unused-vars": "off", "@typescript-eslint/no-unused-vars": "error", "no-use-before-define": "off", "@typescript-eslint/no-use-before-define": "error", "no-useless-constructor": "off", "@typescript-eslint/no-useless-constructor": "error", "@typescript-eslint/no-useless-empty-export": "error", "@typescript-eslint/no-wrapper-object-types": "error", "@typescript-eslint/non-nullable-type-assertion-style": "error", "no-throw-literal": "off", "@typescript-eslint/only-throw-error": "error", "@typescript-eslint/parameter-properties": "error", "@typescript-eslint/prefer-as-const": "error", "prefer-destructuring": "off", "@typescript-eslint/prefer-destructuring": "error", "@typescript-eslint/prefer-enum-initializers": "error", "@typescript-eslint/prefer-find": "error", "@typescript-eslint/prefer-for-of": "error", "@typescript-eslint/prefer-function-type": "error", "@typescript-eslint/prefer-includes": "error", "@typescript-eslint/prefer-literal-enum-member": "error", "@typescript-eslint/prefer-namespace-keyword": "error", "@typescript-eslint/prefer-nullish-coalescing": "error", "@typescript-eslint/prefer-optional-chain": "error", "prefer-promise-reject-errors": "off", "@typescript-eslint/prefer-promise-reject-errors": "error", "@typescript-eslint/prefer-readonly": "error", "@typescript-eslint/prefer-readonly-parameter-types": "error", "@typescript-eslint/prefer-reduce-type-parameter": "error", "@typescript-eslint/prefer-regexp-exec": "error", "@typescript-eslint/prefer-return-this-type": "error", "@typescript-eslint/prefer-string-starts-ends-with": "error", "@typescript-eslint/promise-function-async": "error", "@typescript-eslint/related-getter-setter-pairs": "error", "@typescript-eslint/require-array-sort-compare": "error", "require-await": "off", "@typescript-eslint/require-await": "error", "@typescript-eslint/restrict-plus-operands": "error", "@typescript-eslint/restrict-template-expressions": "error", "no-return-await": "off", "@typescript-eslint/return-await": "error", "@typescript-eslint/strict-boolean-expressions": "error", "@typescript-eslint/switch-exhaustiveness-check": "error", "@typescript-eslint/triple-slash-reference": "error", "@typescript-eslint/unbound-method": "error", "@typescript-eslint/unified-signatures": "error", "@typescript-eslint/use-unknown-in-catch-callback-variable": "error" }, "files": [ "**/*.ts" ], "languageOptions": { "parserOptions": { "projectService": true } } } ], "overrideConfig": [ { "plugins": { "@salesforce/aura": { "meta": { "name": "@salesforce/eslint-plugin-aura", "version": "3.0.0" }, "otherProperties": "[plugin properties are hidden to keep output brief]" } }, "files": [ "**/aura/**/*.js" ], "name": "UserConfig[0][0] > ExtendedConfig[0]" }, { "rules": { "constructor-super": "error", "for-direction": "error", "getter-return": "error", "no-async-promise-executor": "error", "no-case-declarations": "error", "no-class-assign": "error", "no-compare-neg-zero": "error", "no-cond-assign": "error", "no-const-assign": "error", "no-constant-binary-expression": "error", "no-constant-condition": "error", "no-control-regex": "error", "no-debugger": "error", "no-delete-var": "error", "no-dupe-args": "error", "no-dupe-class-members": "error", "no-dupe-else-if": "error", "no-dupe-keys": "error", "no-duplicate-case": "error", "no-empty": "error", "no-empty-character-class": "error", "no-empty-pattern": "error", "no-empty-static-block": "error", "no-ex-assign": "error", "no-extra-boolean-cast": "error", "no-fallthrough": "error", "no-func-assign": "error", "no-global-assign": "error", "no-import-assign": "error", "no-invalid-regexp": "error", "no-irregular-whitespace": "error", "no-loss-of-precision": "error", "no-misleading-character-class": "error", "no-new-native-nonconstructor": "error", "no-nonoctal-decimal-escape": "error", "no-obj-calls": "error", "no-octal": "error", "no-prototype-builtins": "error", "no-redeclare": "error", "no-regex-spaces": "error", "no-self-assign": "error", "no-setter-return": "error", "no-shadow-restricted-names": "error", "no-sparse-arrays": "error", "no-this-before-super": "error", "no-undef": "error", "no-unexpected-multiline": "error", "no-unreachable": "error", "no-unsafe-finally": "error", "no-unsafe-negation": "error", "no-unsafe-optional-chaining": "error", "no-unused-labels": "error", "no-unused-private-class-members": "error", "no-unused-vars": "error", "no-useless-backreference": "error", "no-useless-catch": "error", "no-useless-escape": "error", "no-with": "error", "require-yield": "error", "use-isnan": "error", "valid-typeof": "error" }, "files": [ "**/aura/**/*.js" ], "name": "UserConfig[0][0] > ExtendedConfig[1]" }, { "languageOptions": { "ecmaVersion": 5, "sourceType": "script", "globals": "[object is hidden to keep output brief]" }, "rules": { "no-console": "error", "array-callback-return": "error", "consistent-return": "error", "default-case": "error", "dot-notation": [ "error", { "allowKeywords": true } ], "eqeqeq": [ "error", "smart" ], "guard-for-in": "error", "no-alert": "error", "no-caller": "error", "no-else-return": "error", "no-empty-function": [ "error", { "allow": [ "arrowFunctions", "functions", "methods" ] } ], "no-eval": "error", "no-extend-native": "error", "no-extra-bind": "error", "no-floating-decimal": "error", "no-implied-eval": "error", "no-iterator": "error", "no-labels": "error", "no-loop-func": "error", "no-multi-str": "error", "no-new": "error", "no-new-func": "error", "no-new-object": "error", "no-new-wrappers": "error", "no-octal-escape": "error", "no-proto": "error", "no-return-assign": "error", "no-return-await": "error", "no-script-url": "error", "no-self-compare": "error", "no-sequences": "error", "no-throw-literal": "error", "no-useless-concat": "error", "no-useless-escape": "error", "no-useless-return": "error", "no-unused-expressions": "error", "no-void": "error", "no-with": "error", "radix": "error", "vars-on-top": "error", "wrap-iife": [ "error", "any" ], "no-label-var": "error", "no-shadow": "error", "no-shadow-restricted-names": "error", "no-undef-init": "error", "no-unused-vars": [ "error", { "vars": "all", "args": "after-used" } ], "no-use-before-define": [ "error", { "functions": false } ], "@salesforce/aura/aura-api": "error", "@salesforce/aura/getevt-markup-prefix": "error", "@salesforce/aura/no-deprecated-aura-error": "error", "@salesforce/aura/no-deprecated-component-creation": "error" }, "files": [ "**/aura/**/*.js" ], "name": "UserConfig[0][0] > ExtendedConfig[2]" }, { "plugins": { "@salesforce/aura": { "meta": { "name": "@salesforce/eslint-plugin-aura", "version": "3.0.0" }, "otherProperties": "[plugin properties are hidden to keep output brief]" } }, "files": [ "**/aura/**/*.js" ], "name": "UserConfig[0][0] > ExtendedConfig[3]" }, { "rules": "[Exact same object as: <val>.overrideConfig[1].rules]", "files": [ "**/aura/**/*.js" ], "name": "UserConfig[0][0] > ExtendedConfig[4]" }, { "languageOptions": "[Exact same object as: <val>.overrideConfig[2].languageOptions]", "rules": "[Exact same object as: <val>.overrideConfig[2].rules]", "files": [ "**/aura/**/*.js" ], "name": "UserConfig[0][0] > ExtendedConfig[5]" }, { "rules": { "no-array-constructor": "error", "@salesforce/aura/ecma-intrinsics": "error", "@salesforce/aura/secure-document": "error", "@salesforce/aura/secure-window": "error" }, "files": [ "**/aura/**/*.js" ], "name": "UserConfig[0][0] > ExtendedConfig[6]" }, { "files": [ "**/aura/**/*.js" ] }, { "languageOptions": { "parser": { "meta": { "name": "@babel/eslint-parser", "version": "7.25.9" }, "parse": "[Function]", "parseForESLint": "[Function]" }, "parserOptions": { "requireConfigFile": false, "babelOptions": { "babelrc": false, "parserOpts": { "plugins": { "0": { "meta": { "name": "undefined", "version": "undefined" }, "otherProperties": "[plugin properties are hidden to keep output brief]" } } } } }, "globals": "[object is hidden to keep output brief]" }, "plugins": { "@lwc/lwc": { "meta": { "name": "@lwc/eslint-plugin-lwc", "version": "3.2.0" }, "otherProperties": "[plugin properties are hidden to keep output brief]" } }, "rules": { "@lwc/lwc/no-deprecated": "error", "@lwc/lwc/valid-api": "error", "@lwc/lwc/valid-track": "error", "@lwc/lwc/valid-wire": "error", "@lwc/lwc/no-unknown-wire-adapters": [ "error", { "adapters": "[array is hidden to keep output brief]" } ], "@lwc/lwc/no-unexpected-wire-adapter-usages": [ "error", { "adapters": "[array is hidden to keep output brief]" } ], "@lwc/lwc/no-disallowed-lwc-imports": "error", "no-restricted-imports": [ "error", { "patterns": [ { "group": [ "@salesforce/lds", "@salesforce/lds/**" ], "message": "Please do not import from @salesforce/lds, these modules are ephemeral and could change at any time." } ] } ] }, "files": [ "**/lwc/**/*.js" ], "name": "UserConfig[0][1] > ExtendedConfig[0][0]" }, { "rules": "[Exact same object as: <val>.overrideConfig[1].rules]", "files": [ "**/lwc/**/*.js" ], "name": "UserConfig[0][1] > ExtendedConfig[0][1]" }, { "rules": { "import/no-unresolved": 2, "import/named": 2, "import/namespace": 2, "import/default": 2, "import/export": 2 }, "name": "UserConfig[0][1] > import/errors", "plugins": { "import": { "meta": { "name": "eslint-plugin-import", "version": "2.32.0" }, "otherProperties": "[plugin properties are hidden to keep output brief]" } }, "files": [ "**/lwc/**/*.js" ] }, { "plugins": { "jest": { "meta": { "name": "eslint-plugin-jest", "version": "29.0.1" }, "otherProperties": "[plugin properties are hidden to keep output brief]" } }, "languageOptions": { "globals": "[object is hidden to keep output brief]" }, "rules": { "jest/expect-expect": "warn", "jest/no-alias-methods": "error", "jest/no-commented-out-tests": "warn", "jest/no-conditional-expect": "error", "jest/no-deprecated-functions": "error", "jest/no-disabled-tests": "warn", "jest/no-done-callback": "error", "jest/no-export": "error", "jest/no-focused-tests": "error", "jest/no-identical-title": "error", "jest/no-interpolation-in-snapshots": "error", "jest/no-jasmine-globals": "error", "jest/no-mocks-import": "error", "jest/no-standalone-expect": "error", "jest/no-test-prefixes": "error", "jest/valid-describe-callback": "error", "jest/valid-expect": "error", "jest/valid-expect-in-promise": "error", "jest/valid-title": "error" }, "files": [ "**/lwc/**/*.js" ], "name": "UserConfig[0][1] > ExtendedConfig[0][3]" }, { "plugins": { "@salesforce/lightning": { "meta": { "name": "@salesforce/eslint-plugin-lightning", "version": "2.0.0" }, "otherProperties": "[plugin properties are hidden to keep output brief]" } }, "languageOptions": { "globals": "[object is hidden to keep output brief]" }, "rules": { "no-await-in-loop": "error", "array-callback-return": "error", "consistent-return": "error", "default-case": "error", "dot-notation": [ "error", { "allowKeywords": true } ], "eqeqeq": [ "error", "smart" ], "guard-for-in": "error", "no-alert": "error", "no-caller": "error", "no-else-return": "error", "no-empty-function": [ "error", { "allow": [ "arrowFunctions", "functions", "methods" ] } ], "no-eval": "error", "no-extend-native": "error", "no-extra-bind": "error", "no-floating-decimal": "error", "no-implied-eval": "error", "no-iterator": "error", "no-labels": "error", "no-loop-func": "error", "no-multi-str": "error", "no-new": "error", "no-new-func": "error", "no-new-object": "error", "no-new-wrappers": "error", "no-octal-escape": "error", "no-proto": "error", "no-return-assign": "error", "no-return-await": "error", "no-script-url": "error", "no-self-compare": "error", "no-sequences": "error", "no-throw-literal": "error", "no-useless-concat": "error", "no-useless-escape": "error", "no-useless-return": "error", "no-unused-expressions": "error", "no-void": "error", "no-with": "error", "radix": "error", "vars-on-top": "error", "wrap-iife": [ "error", "any" ], "no-label-var": "error", "no-restricted-globals": [ "error", "addEventListener", "blur", "close", "closed", "confirm", "defaultStatus", "event", "external", "defaultstatus", "find", "focus", "frameElement", "frames", "history", "innerHeight", "innerWidth", "length", "location", "locationbar", "menubar", "moveBy", "moveTo", "name", "onblur", "onerror", "onfocus", "onload", "onresize", "onunload", "open", "opener", "opera", "outerHeight", "outerWidth", "pageXOffset", "pageYOffset", "parent", "print", "removeEventListener", "resizeBy", "resizeTo", "screen", "screenLeft", "screenTop", "screenX", "screenY", "scroll", "scrollbars", "scrollBy", "scrollTo", "scrollX", "scrollY", "self", "status", "statusbar", "stop", "toolbar", "top" ], "no-shadow": "error", "no-shadow-restricted-names": "error", "no-undef-init": "error", "no-unused-vars": [ "error", { "vars": "all", "args": "after-used" } ], "no-use-before-define": [ "error", { "functions": false } ], "handle-callback-err": "error", "no-confusing-arrow": "error", "no-useless-computed-key": "error", "no-useless-constructor": "error", "no-useless-rename": "error", "@lwc/lwc/no-api-reassignments": "error", "@lwc/lwc/no-async-operation": "error", "@lwc/lwc/no-attributes-during-construction": "error", "@lwc/lwc/no-document-query": "error", "@lwc/lwc/no-inner-html": "error", "@lwc/lwc/no-leading-uppercase-api-name": "error", "@lwc/lwc/no-template-children": "error", "@lwc/lwc/prefer-custom-event": "error", "@lwc/lwc/valid-api": [ "error", { "disallowUnderscoreUppercaseMix": true } ], "@lwc/lwc/valid-graphql-wire-adapter-callback-parameters": "error", "@salesforce/lightning/valid-apex-method-invocation": "error", "import/no-unresolved": "off", "@lwc/lwc/no-dupe-class-members": "off" }, "files": [ "**/lwc/**/*.js" ], "name": "UserConfig[0][1] > ExtendedConfig[0][4]" }, { "files": [ "**/lwc/**/*.js" ] }, { "languageOptions": "[Exact same object as: <val>.overrideConfig[8].languageOptions]", "plugins": { "@lwc/lwc": { "meta": { "name": "@lwc/eslint-plugin-lwc", "version": "3.2.0" }, "otherProperties": "[plugin properties are hidden to keep output brief]" } }, "rules": "[Exact same object as: <val>.overrideConfig[8].rules]", "files": [ "**/lwc/**/*.test.js" ], "name": "UserConfig[0][2] > ExtendedConfig[0][0]" }, { "rules": "[Exact same object as: <val>.overrideConfig[1].rules]", "files": [ "**/lwc/**/*.test.js" ], "name": "UserConfig[0][2] > ExtendedConfig[0][1]" }, { "rules": "[Exact same object as: <val>.overrideConfig[10].rules]", "name": "UserConfig[0][2] > import/errors", "plugins": { "import": { "meta": { "name": "eslint-plugin-import", "version": "2.32.0" }, "otherProperties": "[plugin properties are hidden to keep output brief]" } }, "files": [ "**/lwc/**/*.test.js" ] }, { "plugins": { "jest": { "meta": { "name": "eslint-plugin-jest", "version": "29.0.1" }, "otherProperties": "[plugin properties are hidden to keep output brief]" } }, "languageOptions": "[Exact same object as: <val>.overrideConfig[11].languageOptions]", "rules": "[Exact same object as: <val>.overrideConfig[11].rules]", "files": [ "**/lwc/**/*.test.js" ], "name": "UserConfig[0][2] > ExtendedConfig[0][3]" }, { "plugins": { "@salesforce/lightning": { "meta": { "name": "@salesforce/eslint-plugin-lightning", "version": "2.0.0" }, "otherProperties": "[plugin properties are hidden to keep output brief]" } }, "languageOptions": "[Exact same object as: <val>.overrideConfig[12].languageOptions]", "rules": "[Exact same object as: <val>.overrideConfig[12].rules]", "files": [ "**/lwc/**/*.test.js" ], "name": "UserConfig[0][2] > ExtendedConfig[0][4]" }, { "files": [ "**/lwc/**/*.test.js" ], "rules": { "@lwc/lwc/no-unexpected-wire-adapter-usages": "off" }, "languageOptions": { "globals": "[object is hidden to keep output brief]" }, "settings": { "jest": { "version": "29.7.0" } } }, { "rules": "[Exact same object as: <val>.overrideConfig[1].rules]", "files": [ "**/jest-mocks/**/*.js" ], "name": "UserConfig[0][3] > eslintJs/recommended" }, { "files": [ "**/jest-mocks/**/*.js" ], "languageOptions": { "sourceType": "module", "ecmaVersion": "latest", "globals": "[object is hidden to keep output brief]" }, "plugins": { "eslintJs": { "meta": { "name": "@eslint/js", "version": "9.38.0" }, "otherProperties": "[plugin properties are hidden to keep output brief]" } } }, { "plugins": { "engineProgressPlugin": { "meta": { "name": "undefined", "version": "undefined" }, "otherProperties": "[plugin properties are hidden to keep output brief]" } }, "rules": { "engineProgressPlugin/emitProgressRule": [ "error" ] } } ], "overrideConfigFile": true, "ruleFilter": "[Function]" } at wrapESLintError (/Users/kpoorman/.local/share/sf/node_modules/@salesforce/plugin-code-analyzer/node_modules/@salesforce/code-analyzer-eslint-engine/dist/eslint-wrapper.js:163:12) at async ESLintWrapper.lintFiles (/Users/kpoorman/.local/share/sf/node_modules/@salesforce/plugin-code-analyzer/node_modules/@salesforce/code-analyzer-eslint-engine/dist/eslint-wrapper.js:133:19) at async RunESLintWorkerTask.exec (/Users/kpoorman/.local/share/sf/node_modules/@salesforce/plugin-code-analyzer/node_modules/@salesforce/code-analyzer-eslint-engine/dist/run-eslint-worker-task.js:61:16) at async /private/var/folders/lw/myn25wq10ln5wzf2mp4g6my80000gn/T/code-analyzer-FB2cLU/run-2025_11_10_17_31_36_959/eslint/RunESLintWorkerTask_worker_script.cjs:13:20
I spent a bunch of time trying to debug this, and ended up trying to set the jest version in the config file:
const { defineConfig } = require("eslint/config");
const eslintJs = require("@eslint/js");
const jestPlugin = require("eslint-plugin-jest");
const auraConfig = require("@salesforce/eslint-plugin-aura");
const lwcConfig = require("@salesforce/eslint-config-lwc/recommended");
const globals = require("globals");
module.exports = defineConfig([
// Aura configuration
{
files: ["**/aura/**/*.js"],
extends: [...auraConfig.configs.recommended, ...auraConfig.configs.locker]
},
// LWC configuration
{
files: ["**/lwc/**/*.js"],
extends: [lwcConfig]
},
// LWC configuration with override for LWC test files
{
files: ["**/lwc/**/*.test.js"],
extends: [lwcConfig],
rules: {
"@lwc/lwc/no-unexpected-wire-adapter-usages": "off"
},
languageOptions: {
globals: {
...globals.node
}
},
settings: {
jest: {
version: "29.7.0",
}
}
},
// Jest mocks configuration
{
files: ["**/jest-mocks/**/*.js"],
languageOptions: {
sourceType: "module",
ecmaVersion: "latest",
globals: {
...globals.node,
...globals.es2021,
...jestPlugin.environments.globals.globals
}
},
plugins: {
eslintJs
},
extends: ["eslintJs/recommended"]
}
]);
However, this results in the same error (and, i'd rather not hard code a version). Investingating in the streamed logs i discovered lines like these:
[2025-11-11T01:31:36.331Z] Debug eslint - While attempting to resolve the ESLint configuration array, the plugin reference 'jest' was found to be associated with more than one plugin:
--> [email protected] (from config file '/Users/kpoorman/src/vacatiaDx/eslint.config.js')
--> [email protected] (most likely from base config)
To avoid a conflict, the plugin from the config file '/Users/kpoorman/src/vacatiaDx/eslint.config.js' has been replaced with [email protected].
Which lead me to believe that the analyzer is discarding my configuration with it's jest settings for one that comes from salesforce?? (this is intuition, at best)
I can demonstrate that Jest is installed:
vacatiaDx on ci/codefriar/sal-1126 [$!+?⇣] via v24.5.0 with org 🌩️ sal-1126❯ jest --version
30.1.3
and (from package.json)
"devDependencies": {
"@lwc/eslint-plugin-lwc": "^3.1.0",
"@prettier/plugin-xml": "^3.4.1",
"@salesforce/eslint-config-lwc": "^4.0.0",
"@salesforce/eslint-plugin-aura": "^3.0.0",
"@salesforce/eslint-plugin-lightning": "^2.0.0",
"@salesforce/sfdx-lwc-jest": "^7.0.2",
"eslint": "^9.29.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest": "^28.14.0",
"husky": "^9.1.7",
"jest": "^29.7.0",
"lint-staged": "^16.1.2",
"prettier": "^3.5.3",
"prettier-plugin-apex": "^2.2.6"
},
I am 90% certain this is a misconfiguration on my part - but it's not clear from the documentation how to prevent the analyzer from overriding my configuration?
Output / Logs
sf code-analyzer run -c "code-analyzer.yml" -f "SFCA-Results.html" -s 3
Streaming logs in real time to:
/var/folders/lw/myn25wq10ln5wzf2mp4g6my80000gn/T/sfca-2025_11_11_09_12_48_250.log
Selecting rules... done.
Executing rules... done. Executed rules from regex, retire-js, flow, eslint, pmd, cpd.
=== Summary
Found 4517 violation(s) across 399 file(s):
1 Critical severity violation(s) found.
337 High severity violation(s) found.
2160 Moderate severity violation(s) found.
1772 Low severity violation(s) found.
247 Info severity violation(s) found.
Results written to:
SFCA-Results.html
Additional log information written to:
/var/folders/lw/myn25wq10ln5wzf2mp4g6my80000gn/T/sfca-2025_11_11_09_12_48_250.log
Error (ThresholdExceeded): 2498 violations met or exceeded the severity threshold of "Moderate".
-------------- LOG FILE -----------------
[2025-11-11T17:12:48.260Z] Debug Core - Engine with name 'retire-js' was added to Code Analyzer.
[2025-11-11T17:12:48.260Z] Debug Core - Engine with name 'regex' was added to Code Analyzer.
[2025-11-11T17:12:48.260Z] Debug Core - Engine with name 'eslint' was added to Code Analyzer.
[2025-11-11T17:12:48.276Z] Debug Core - Engine with name 'flow' was added to Code Analyzer.
[2025-11-11T17:12:48.368Z] Debug Core - Engine with name 'pmd' was added to Code Analyzer.
[2025-11-11T17:12:48.369Z] Debug Core - Engine with name 'cpd' was added to Code Analyzer.
[2025-11-11T17:12:48.369Z] Debug Core - Engine with name 'sfge' was added to Code Analyzer.
[2025-11-11T17:12:49.159Z] Debug Core - Gathering all available rules from engine 'retire-js'.
[2025-11-11T17:12:49.161Z] Debug Core - Finished gathering 4 available rule(s) from engine 'retire-js'.
[2025-11-11T17:12:49.161Z] Debug Core - Gathering all available rules from engine 'flow'.
[2025-11-11T17:12:49.161Z] Debug Core - Finished gathering 2 available rule(s) from engine 'flow'.
[2025-11-11T17:12:49.161Z] Debug Core - Gathering all available rules from engine 'eslint'.
[2025-11-11T17:12:49.162Z] Debug eslint - Applying the flat ESLint configuration file: /Users/kpoorman/src/vacatiaDx/eslint.config.js
[2025-11-11T17:12:49.501Z] Debug eslint - While attempting to resolve the ESLint configuration array, the plugin reference '@lwc/lwc' was found to be associated with more than one plugin:
--> @lwc/[email protected] (from config file '/Users/kpoorman/src/vacatiaDx/eslint.config.js')
--> @lwc/[email protected] (most likely from base config)
To avoid a conflict, the plugin from the config file '/Users/kpoorman/src/vacatiaDx/eslint.config.js' has been replaced with @lwc/[email protected].
[2025-11-11T17:12:49.501Z] Debug eslint - While attempting to resolve the ESLint configuration array, the plugin reference 'import' was found to be associated with more than one plugin:
--> [email protected] (from config file '/Users/kpoorman/src/vacatiaDx/eslint.config.js')
--> [email protected] (most likely from base config)
To avoid a conflict, the plugin from the config file '/Users/kpoorman/src/vacatiaDx/eslint.config.js' has been replaced with [email protected].
[2025-11-11T17:12:49.501Z] Debug eslint - While attempting to resolve the ESLint configuration array, the plugin reference 'jest' was found to be associated with more than one plugin:
--> [email protected] (from config file '/Users/kpoorman/src/vacatiaDx/eslint.config.js')
--> [email protected] (most likely from base config)
To avoid a conflict, the plugin from the config file '/Users/kpoorman/src/vacatiaDx/eslint.config.js' has been replaced with [email protected].
[2025-11-11T17:12:49.501Z] Debug eslint - While attempting to resolve the ESLint configuration array, the plugin reference '@salesforce/lightning' was found to be associated with more than one plugin:
--> @salesforce/[email protected] (from config file '/Users/kpoorman/src/vacatiaDx/eslint.config.js')
--> @salesforce/[email protected] (most likely from base config)
To avoid a conflict, the plugin from the config file '/Users/kpoorman/src/vacatiaDx/eslint.config.js' has been replaced with @salesforce/[email protected].
[2025-11-11T17:12:49.663Z] Debug Core - Finished gathering 291 available rule(s) from engine 'eslint'.
[2025-11-11T17:12:49.664Z] Debug Core - Gathering all available rules from engine 'regex'.
[2025-11-11T17:12:49.666Z] Debug Core - Gathering all available rules from engine 'cpd'.
[2025-11-11T17:12:49.666Z] Debug Core - Finished gathering 5 available rule(s) from engine 'cpd'.
[2025-11-11T17:12:49.666Z] Debug Core - Gathering all available rules from engine 'pmd'.
[2025-11-11T17:12:49.667Z] Debug Core - Gathering all available rules from engine 'sfge'.
[2025-11-11T17:12:49.667Z] Debug sfge - Invoking SFGE's describe command. Logs being written to /var/folders/lw/myn25wq10ln5wzf2mp4g6my80000gn/T/sfca-sfge-2025_11_11_09_12_48_369.log.
[2025-11-11T17:12:49.679Z] Debug Core - Finished gathering 5 available rule(s) from engine 'regex'.
[2025-11-11T17:12:50.119Z] Debug Core - Finished gathering 7 available rule(s) from engine 'sfge'.
[2025-11-11T17:12:50.127Z] Debug Core - Finished gathering 130 available rule(s) from engine 'pmd'.
[2025-11-11T17:12:50.128Z] Debug Core - Running with the following workspace: {"filesAndFolders":["/Users/kpoorman/src/vacatiaDx"]}
[2025-11-11T17:12:50.129Z] Debug Core - Running engine 'regex' with the following rules: ["NoTrailingWhitespace","AvoidTermsWithImplicitBias","AvoidOldSalesforceApiVersions","AvoidGetHeapSizeInLoop","MinVersionForAbstractVirtualClassesWithPrivateMethod"]
[2025-11-11T17:12:50.132Z] Debug Core - Running engine 'retire-js' with the following rules: ["LibraryWithKnownCriticalSeverityVulnerability","LibraryWithKnownHighSeverityVulnerability","LibraryWithKnownMediumSeverityVulnerability","LibraryWithKnownLowSeverityVulnerability"]
[2025-11-11T17:12:50.202Z] Debug Core - Running engine 'flow' with the following rules: ["PreventPassingUserDataIntoElementWithoutSharing","PreventPassingUserDataIntoElementWithSharing"]
[2025-11-11T17:12:50.202Z] Debug flow - The separate Flow Scanner log file, used for debugging purposes only, will be written to: /var/folders/lw/myn25wq10ln5wzf2mp4g6my80000gn/T/sfca-flow-2025_11_11_09_12_50_202.log
[2025-11-11T17:12:50.202Z] Debug Core - Running engine 'eslint' with the following rules: ["@lwc/lwc-platform/no-aura","@lwc/lwc-platform/no-aura-libs","@lwc/lwc-platform/no-community-import","@lwc/lwc-platform/no-create-context-provider","@lwc/lwc-platform/no-deprecated-module-import","@lwc/lwc-platform/no-dynamic-import-identifier","@lwc/lwc-platform/no-inline-disable","@lwc/lwc-platform/no-interop","@lwc/lwc-platform/no-interop-create","@lwc/lwc-platform/no-interop-dispatch","@lwc/lwc-platform/no-interop-execute","@lwc/lwc-platform/no-interop-execute-controller-with-client-def","@lwc/lwc-platform/no-interop-execute-privileged","@lwc/lwc-platform/no-interop-execute-raw-response","@lwc/lwc-platform/no-interop-execute-with-callback","@lwc/lwc-platform/no-interop-get-event","@lwc/lwc-platform/no-interop-get-module","@lwc/lwc-platform/no-interop-is-external-definition","@lwc/lwc-platform/no-interop-load-definitions","@lwc/lwc-platform/no-interop-module-instrumentation","@lwc/lwc-platform/no-interop-module-storage","@lwc/lwc-platform/no-interop-register","@lwc/lwc-platform/no-interop-render","@lwc/lwc-platform/no-interop-sanitize","@lwc/lwc-platform/no-lds-aura-controller-method","@lwc/lwc-platform/no-process-env","@lwc/lwc-platform/no-restricted-namespaces","@lwc/lwc-platform/no-site-import","@lwc/lwc-platform/no-wire-service","@lwc/lwc-platform/valid-dynamic-import-hint","@lwc/lwc/no-api-reassignments","@lwc/lwc/no-async-operation","@lwc/lwc/no-attributes-during-construction","@lwc/lwc/no-deprecated","@lwc/lwc/no-disallowed-lwc-imports","@lwc/lwc/no-document-query","@lwc/lwc/no-inner-html","@lwc/lwc/no-leading-uppercase-api-name","@lwc/lwc/no-template-children","@lwc/lwc/no-unexpected-wire-adapter-usages","@lwc/lwc/no-unknown-wire-adapters","@lwc/lwc/prefer-custom-event","@lwc/lwc/valid-api","@lwc/lwc/valid-graphql-wire-adapter-callback-parameters","@lwc/lwc/valid-track","@lwc/lwc/valid-wire","@salesforce-ux/slds/enforce-bem-usage","@salesforce-ux/slds/enforce-component-hook-naming-convention","@salesforce-ux/slds/enforce-sds-to-slds-hooks","@salesforce-ux/slds/lwc-token-to-slds-hook","@salesforce-ux/slds/modal-close-button-issue","@salesforce-ux/slds/no-deprecated-classes-slds2","@salesforce-ux/slds/no-deprecated-slds-classes","@salesforce-ux/slds/no-hardcoded-values-slds2","@salesforce-ux/slds/no-slds-class-overrides","@salesforce-ux/slds/no-slds-namespace-for-custom-hooks","@salesforce-ux/slds/no-slds-private-var","@salesforce-ux/slds/no-slds-var-without-fallback","@salesforce-ux/slds/no-sldshook-fallback-for-lwctoken","@salesforce-ux/slds/no-unsupported-hooks-slds2","@salesforce-ux/slds/reduce-annotations","@salesforce/aura/aura-api","@salesforce/aura/ecma-intrinsics","@salesforce/aura/getevt-markup-prefix","@salesforce/aura/no-deprecated-aura-error","@salesforce/aura/no-deprecated-component-creation","@salesforce/aura/secure-document","@salesforce/aura/secure-window","@salesforce/lightning/valid-apex-method-invocation","constructor-super","for-direction","getter-return","import/default","import/export","import/named","import/namespace","jest/expect-expect","jest/no-alias-methods","jest/no-commented-out-tests","jest/no-conditional-expect","jest/no-deprecated-functions","jest/no-disabled-tests","jest/no-done-callback","jest/no-export","jest/no-focused-tests","jest/no-identical-title","jest/no-interpolation-in-snapshots","jest/no-jasmine-globals","jest/no-mocks-import","jest/no-standalone-expect","jest/no-test-prefixes","jest/valid-describe-callback","jest/valid-expect","jest/valid-expect-in-promise","jest/valid-title","no-async-promise-executor","no-case-declarations","no-class-assign","no-compare-neg-zero","no-cond-assign","no-const-assign","no-constant-condition","no-control-regex","no-debugger","no-delete-var","no-dupe-args","no-dupe-class-members","no-dupe-else-if","no-dupe-keys","no-duplicate-case","no-empty","no-empty-character-class","no-empty-pattern","no-ex-assign","no-extra-boolean-cast","no-fallthrough","no-func-assign","no-global-assign","no-import-assign","no-inner-declarations","no-invalid-regexp","no-irregular-whitespace","no-loss-of-precision","no-misleading-character-class","no-nonoctal-decimal-escape","no-obj-calls","no-octal","no-prototype-builtins","no-redeclare","no-regex-spaces","no-self-assign","no-setter-return","no-shadow-restricted-names","no-sparse-arrays","no-this-before-super","no-undef","no-unexpected-multiline","no-unreachable","no-unsafe-finally","no-unsafe-negation","no-unsafe-optional-chaining","no-unused-labels","no-unused-vars","no-useless-backreference","no-useless-catch","no-useless-escape","no-var","no-with","prefer-const","prefer-rest-params","prefer-spread","require-yield","use-isnan","valid-typeof"]
[2025-11-11T17:12:50.203Z] Debug Core - Running engine 'pmd' with the following rules: ["AnnotationsNamingConventions","ApexBadCrypto","ApexCRUDViolation","ApexCSRF","ApexDangerousMethods","ApexDoc","ApexInsecureEndpoint","ApexOpenRedirect","ApexSharingViolations","ApexSOQLInjection","ApexSuggestUsingNamedCred","ApexUnitTestClassShouldHaveAsserts","ApexUnitTestClassShouldHaveRunAs","ApexUnitTestMethodShouldHaveIsTestAnnotation","ApexUnitTestShouldNotUseSeeAllDataTrue","ApexXSSFromEscapeFalse","ApexXSSFromURLParam","AvoidBooleanMethodParameters","AvoidDebugStatements","AvoidDeeplyNestedIfStmts","AvoidDirectAccessTriggerMap","AvoidGlobalModifier","AvoidHardcodingId","AvoidLogicInTrigger","AvoidNonExistentAnnotations","AvoidNonRestrictiveQueries","AvoidStatefulDatabaseResult","ClassNamingConventions","CognitiveComplexity","CyclomaticComplexity","DebugsShouldUseLoggingLevel","EagerlyLoadedDescribeSObjectResult","EmptyCatchBlock","EmptyIfStmt","EmptyStatementBlock","EmptyTryOrFinallyBlock","EmptyWhileStmt","ExcessiveClassLength","ExcessiveParameterList","ExcessivePublicCount","FieldDeclarationsShouldBeAtStart","FieldNamingConventions","ForLoopsMustUseBraces","FormalParameterNamingConventions","IfElseStmtsMustUseBraces","IfStmtsMustUseBraces","InaccessibleAuraEnabledGetter","LocalVariableNamingConventions","MethodNamingConventions","MethodWithSameNameAsEnclosingClass","NcssConstructorCount","NcssMethodCount","OneDeclarationPerLine","OperationWithHighCostInLoop","OperationWithLimitsInLoop","OverrideBothEqualsAndHashcode","PropertyNamingConventions","QueueableWithoutFinalizer","TestMethodsMustBeInTestClasses","TooManyFields","TypeShadowsBuiltInNamespace","UnusedLocalVariable","UnusedMethod","VfCsrf","VfHtmlStyleTagXss","VfUnescapeEl","WhileLoopsMustUseBraces"]
[2025-11-11T17:12:50.203Z] Debug Core - Running engine 'cpd' with the following rules: ["DetectCopyPasteForApex","DetectCopyPasteForJavascript","DetectCopyPasteForVisualforce"]
[2025-11-11T17:12:50.374Z] Debug Core - Finished running engine 'regex'.
[2025-11-11T17:12:50.890Z] Debug Core - Finished running engine 'cpd'.
[2025-11-11T17:12:51.012Z] Debug eslint - While attempting to resolve the ESLint configuration array, the plugin reference '@lwc/lwc' was found to be associated with more than one plugin:
--> @lwc/[email protected] (from config file '/Users/kpoorman/src/vacatiaDx/eslint.config.js')
--> @lwc/[email protected] (most likely from base config)
To avoid a conflict, the plugin from the config file '/Users/kpoorman/src/vacatiaDx/eslint.config.js' has been replaced with @lwc/[email protected].
[2025-11-11T17:12:51.012Z] Debug eslint - While attempting to resolve the ESLint configuration array, the plugin reference 'import' was found to be associated with more than one plugin:
--> [email protected] (from config file '/Users/kpoorman/src/vacatiaDx/eslint.config.js')
--> [email protected] (most likely from base config)
To avoid a conflict, the plugin from the config file '/Users/kpoorman/src/vacatiaDx/eslint.config.js' has been replaced with [email protected].
[2025-11-11T17:12:51.012Z] Debug eslint - While attempting to resolve the ESLint configuration array, the plugin reference 'jest' was found to be associated with more than one plugin:
--> [email protected] (from config file '/Users/kpoorman/src/vacatiaDx/eslint.config.js')
--> [email protected] (most likely from base config)
To avoid a conflict, the plugin from the config file '/Users/kpoorman/src/vacatiaDx/eslint.config.js' has been replaced with [email protected].
[2025-11-11T17:12:51.012Z] Debug eslint - While attempting to resolve the ESLint configuration array, the plugin reference '@salesforce/lightning' was found to be associated with more than one plugin:
--> @salesforce/[email protected] (from config file '/Users/kpoorman/src/vacatiaDx/eslint.config.js')
--> @salesforce/[email protected] (most likely from base config)
To avoid a conflict, the plugin from the config file '/Users/kpoorman/src/vacatiaDx/eslint.config.js' has been replaced with @salesforce/[email protected].
[2025-11-11T17:12:51.388Z] Debug Core - Since the engine 'eslint' emitted an error, the following temporary working folder will not be removed: /var/folders/lw/myn25wq10ln5wzf2mp4g6my80000gn/T/code-analyzer-iXY6RL/run-2025_11_11_09_12_50_128/eslint
[2025-11-11T17:12:51.507Z] Debug Core - Finished running engine 'flow'.
[2025-11-11T17:12:53.268Z] Debug Core - Finished running engine 'pmd'.
[2025-11-11T17:13:10.786Z] Debug Core - Finished running engine 'retire-js'.
We're continually improving Salesforce Code Analyzer. Tell us what you think! Give feedback at http://sfdc.co/CodeAnalyzerFeedback.Steps To Reproduce
- First I run
sf code-analyzer run -c "code-analyzer.yml" -f "SFCA-Results.html" -s 3 - Then I open the SFCA-Results.html file. (in chrome, safari, arc or dia)
- Then I filter by severity to 1. One issue appears
- Then I read the block of text provided in the first block that includes
The engine with name 'eslint' threw an unexpected error: Error: The eslint engine encountered an unexpected error thrown from 'ESLint.lintFiles': | Error: Error while loading rule 'jest/no-deprecated-functions': Unable to detect Jest version - please ensure jest package is installed, or otherwise set version explicitly - Then I hard-code a jest setting in the eslint.config.js to set the jest version, per the error message.
- Then I re-run same command as in step 1.
- Then i open the log file the analyzer spits out a path to and read that my configuration settings were overridden
- Then I re-read the docs for code-analyzer, and read the .yml file to see if if there are any configuration options that would affect this....
- Then I file a bug....
Expected Behavior
Good question.
I think, in rank order:
0. I'd like to think the failure of a single rule for eslint would not result in a sev 1? maybe a 4?
- that the imported configuration for jest lwc-jest would work out of the box.
- that the documentation gave a clear example of how to ensure your configuration would not be overridden.
Operating System
MacOs Tahoe 26.1
Salesforce CLI Version
@salesforce/cli/2.111.7 darwin-arm64 node-v24.5.0
Code Analyzer Plugin (code-analyzer) Version
code-analyzer 5.6.1
Node Version
v24.5.0
Java Version
openjdk version "21.0.8" 2025-07-15 LTS
Python Version
Python 3.14.0
Additional Context (Screenshots, Files, etc)
n/a
Workaround
Haven't found one besides disabling the entire ESLint engine. :(
Urgency
Moderate