Skip to content

🚀 Feature: Find or create a lint rule that enforces exported types #836

@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Overview

I see code like this a lot:

interface SomeSettings {
  something: string;
}

export function something(settings: SomeSettings) {
  // ...
}

IMO if an interface/type is used by something that's exported, it'd be good to export SomeSettings. That way if future folks want to use it, they won't have issues trying to import it.

Additional Info

Similar issue here: webpro-nl/knip#127.

I think part of this work should be:

  1. Seeing if it already exists in https://github.com/typescript-eslint/typescript-eslint/issues
  2. Waiting until that issue is either accepted or declined
    • If it's accepted, merging the PR into typescript-eslint
    • If it's declined, either making the rule in an existing community plugin (I don't know which if any would be a good place) or making a new plugin with the rule

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: blockedWaiting for something else to be resolvedtype: featureNew enhancement or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions