Skip to content

Enhancement: [naming-convention] Allow enforcing a naming convention for namespace imports #7164

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

Closed
4 tasks done
binoche9 opened this issue Jul 6, 2023 · 1 comment
Closed
4 tasks done
Labels
duplicate This issue or pull request already exists enhancement: plugin rule option New rule option for an existing eslint-plugin rule package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@binoche9
Copy link
Contributor

binoche9 commented Jul 6, 2023

Before You File a Proposal Please Confirm You Have Done The Following...

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/naming-convention/

Description

I propose that we enhance the naming-convention rule so that we can enforce naming conventions on namespace imports.

In my case I would like to standardize on PascalCase for namespace imports, but obviously other people are welcome to choose something else.

Fail

// Assuming I want PascalCase
import * as foo_bar_baz from "path/to/foo_bar_baz"

Pass

// Assuming I want PascalCase
import * as FooBarBaz from "path/to/foo_bar_baz"

Additional Info

In my Pass example I have the namespace import match the file name since that's what I prefer, but I am not proposing that we build that enforcement into this rule - I'm only just proposing that the namespace import is in PascalCase

@binoche9 binoche9 added enhancement: plugin rule option New rule option for an existing eslint-plugin rule package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Jul 6, 2023
@bradzacher
Copy link
Member

Duplicate of #2106

@bradzacher bradzacher marked this as a duplicate of #2106 Jul 7, 2023
@bradzacher bradzacher closed this as not planned Won't fix, can't repro, duplicate, stale Jul 7, 2023
@bradzacher bradzacher added duplicate This issue or pull request already exists and removed triage Waiting for team members to take a look labels Jul 7, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists enhancement: plugin rule option New rule option for an existing eslint-plugin rule package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

No branches or pull requests

2 participants