Skip to content

Repo: 'Export assignment cannot be used' log errors in Jest tests #10146

Closed
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Suggestion

These aren't failing CI, but are coming up as logs locally when I run yarn test within a package:

cd packages/eslint-plugin
yarn test consistent-type-exports

... (all passing)

Running coverage on untested files...Failed to collect coverage from /Users/josh/repos/typescript-eslint/packages/eslint-plugin/src/rules/index.ts
ERROR:   x Export assignment cannot be used when targeting ECMAScript modules. Consider using `export default` or another module format instead.
     ,-[/Users/josh/repos/typescript-eslint/packages/eslint-plugin/src/rules/index.ts:262:1]
 259 |   'use-unknown-in-catch-callback-variable': useUnknownInCatchCallbackVariable,
 260 | } satisfies Linter.PluginRules;
 261 | 
 262 | export = rules;
     : ^^^^^^^^^^^^^^^
     `----

STACK: Error:   x Export assignment cannot be used when targeting ECMAScript modules. Consider using `export default` or another module format instead.
     ,-[/Users/josh/repos/typescript-eslint/packages/eslint-plugin/src/rules/index.ts:262:1]
 259 |   'use-unknown-in-catch-callback-variable': useUnknownInCatchCallbackVariable,
 260 | } satisfies Linter.PluginRules;
 261 | 
 262 | export = rules;
     : ^^^^^^^^^^^^^^^
     `----

Test Suites: 1 passed, 1 total
Tests:       41 passed, 41 total
Snapshots:   0 total
Time:        3.155 s
Ran all test suites matching /consistent-type-exports/i.

Additional Info

Presumably caused by #10049. Cc @aryaemami59 - I'm sure it's some misconfiguration in our Jest setup.

Tangentially related: #7112 would be lovely to get around all the Jest issues we've had...

💖

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuelocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.repo maintenancethings to do with maintenance of the repo, and not with code/docstestsanything to do with testing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions