Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot generate declaration file when using ESLintUtils.RuleCreator #4198

Closed
3 tasks done
roikoren755 opened this issue Nov 21, 2021 · 1 comment · Fixed by #4199
Closed
3 tasks done

Cannot generate declaration file when using ESLintUtils.RuleCreator #4198

roikoren755 opened this issue Nov 21, 2021 · 1 comment · Fixed by #4199
Assignees
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working package: utils Issues related to the @typescript-eslint/utils package

Comments

@roikoren755
Copy link
Contributor

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

Try to transpile the following file, with "declaration": true in the tsconfig.json file.

import { ESLintUtils } from "@typescript-eslint/experimental-utils";

export const createRule = ESLintUtils.RuleCreator((s) => s);

Expected Result

Transpilation should succeed, and the generated declaration file should work.

Actual Result

Transpilation fails, with the following error log:

index.ts:3:14 - error TS4023: Exported variable 'createRule' has or is using name 'RuleWithMetaAndName' from external module "/PATH/TO/PROJECT/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleCreator" but cannot be named.

3 export const createRule = ESLintUtils.RuleCreator((s) => s);
               ~~~~~~~~~~


Found 1 error.

Additional Info

Versions

package version
@typescript-eslint/experimental-utils 5.4.0
TypeScript 4.5.2
node 14.18.0
@roikoren755 roikoren755 added package: utils Issues related to the @typescript-eslint/utils package triage Waiting for maintainers to take a look labels Nov 21, 2021
@JoshuaKGoldberg JoshuaKGoldberg self-assigned this Nov 21, 2021
@JoshuaKGoldberg JoshuaKGoldberg added accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working and removed triage Waiting for maintainers to take a look labels Nov 21, 2021
@JoshuaKGoldberg
Copy link
Member

Ah, sorry about that @roikoren755! This is from my recent change #4136.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working package: utils Issues related to the @typescript-eslint/utils package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants