-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebugSomething isn't workingSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Description
Before You File a Proposal Please Confirm You Have Done The Following...
- I have searched for related issues and found none that match my proposal.
- I have searched the current rule list and found no rules that match my proposal.
- I have read the FAQ and my problem is not listed.
My proposal is suitable for this project
- I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).
Link to the rule's documentation
https://typescript-eslint.io/rules/consistent-type-exports/
Description
I am working on making an enum-like data type in the graphql
package tree shakable.
In doing that work we had to silence a few instances of consistent-type-export
because it detected supposedly type-only exports when in fact it was not.
The code that seems to be tripping them up is:
import type * as Kind_ from './kinds_.js';
export * as Kind from './kinds_.js';
export type Kind = (typeof Kind_)[keyof typeof Kind_];
Cases we silenced ESLint:
- https://github.com/graphql/graphql-js/pull/4270/files#diff-a2a171449d862fe29692ce031981047d7ab755ae7f84c707aef80701b3ea0c80R209-R210
- https://github.com/graphql/graphql-js/pull/4270/files#diff-433d64045ddea9df367a169ada6b7ce58b853aa60146fe5cd823b20afec1ae44R8
The specific ESLint errors that are being silenced are:
/Users/jasonkuhrt/projects/jasonkuhrt/graphql-js/src/index.ts
209:1 error All exports in the declaration are only used as types. Use `export type` @typescript-eslint/consistent-type-exports
/Users/jasonkuhrt/projects/jasonkuhrt/graphql-js/src/language/index.ts
8:1 error All exports in the declaration are only used as types. Use `export type` @typescript-eslint/consistent-type-exports
Fail
N/A
Pass
N/A
Additional Info
Sorry for not filling out the template completely. I am not sure how this pattern should be supported by ESLint, what considerations there might be etc., so hoping to get some thoughts from others regarding this.
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebugSomething isn't workingSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin