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

types of @typescript-eslint/eslint-plugin are not published #3129

Closed
3 tasks done
JounQin opened this issue Mar 1, 2021 · 5 comments · Fixed by #3164
Closed
3 tasks done

types of @typescript-eslint/eslint-plugin are not published #3129

JounQin opened this issue Mar 1, 2021 · 5 comments · Fixed by #3164
Labels
awaiting response Issues waiting for a reply from the OP or another party package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@JounQin
Copy link
Contributor

JounQin commented Mar 1, 2021

  • 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

https://unpkg.com/browse/@typescript-eslint/eslint-plugin@4.16.1/

 import { rules as typescriptEslintRules } from '@typescript-eslint/eslint-plugin';

Expected Result

Actual Result

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 4.15.2
@typescript-eslint/parser 4.15.2
TypeScript 4.1.3
@JounQin JounQin added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Mar 1, 2021
@bradzacher
Copy link
Member

We don't publish them on purpose because there is little use to them - they are only useful specifically in the case where you are extending our rules (which is literally maybe used by 0.00000001% of our users).

Additionally turning on type declarations for the package is a pain as it causes TS to enforce requirements about private types - meaning files have to export extra cruft.
Things may have changed since we first looked at it, but at the time ~2y ago - it wasn't worth the effort at all.

@bradzacher bradzacher added awaiting response Issues waiting for a reply from the OP or another party and removed triage Waiting for maintainers to take a look labels Mar 1, 2021
@JounQin
Copy link
Contributor Author

JounQin commented Mar 1, 2021

How about add a minimal declaration file?

My temporary workaround:

declare module '@typescript-eslint/eslint-plugin' {
  import { Rule } from 'eslint'
  export const rules: Record<string, Rule.RuleModule>
  // configs can be exported too
}

@bradzacher
Copy link
Member

we purposely don't have any dependency on the ESLint types as they are wrong with respect to our project, so they would have to use the types from our packages.
but otherwise, sure - a hard-coded decl file wouldn't be a bad idea necessarily.

@JounQin
Copy link
Contributor Author

JounQin commented Mar 3, 2021

So should I PR to this repo or DefinitelyTyped instead?

@bradzacher
Copy link
Member

bradzacher commented Mar 3, 2021

Feel free to PR it here!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
awaiting response Issues waiting for a reply from the OP or another party package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants