Skip to content

Enhancement: naming-convention ignore imported types #6744

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
ghosttie opened this issue Mar 22, 2023 · 3 comments
Closed
4 tasks done

Enhancement: naming-convention ignore imported types #6744

ghosttie opened this issue Mar 22, 2023 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@ghosttie
Copy link

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 have no control over the naming conventions of imported types, so the naming-convention rule that I set up for my code is throwing errors everywhere I interact with imported code that needs me to pass it an object e.g. the jQuery ajax function.

Fail

n/a

Pass

n/a

Additional Info

No response

@ghosttie ghosttie 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 Mar 22, 2023
@bradzacher
Copy link
Member

bradzacher commented Mar 22, 2023

I have no control over the naming conventions of imported types

That's not strictly true - you can alias imported names:

import { ajax as Ajax } from 'jquery';

Please also fill out the template.
We don't have issue templates for fun - they're there so that we can collect as much information up front.

Entering n/a when you're requesting an enhancement makes it hard for us to understand things without asking more information


Duplicate of #2106

@bradzacher bradzacher closed this as not planned Won't fix, can't repro, duplicate, stale Mar 22, 2023
@bradzacher bradzacher added duplicate This issue or pull request already exists and removed package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look enhancement: plugin rule option New rule option for an existing eslint-plugin rule labels Mar 22, 2023
@ghosttie
Copy link
Author

That's not what I mean - I mean the ajax function needs me to pass an object to it:

$.ajax({
  type: 'GET',
  url: '/something/something',
  data: {
    something: something
  },
  dataType: 'json',
  success: function() {
    // do something
  }
});

and all of those property names (type, url, data etc.) are all underlined in red because they don't match my naming rule.

But if I change them to match my naming rule the jQuery won't recognize what I sent it.

@bradzacher
Copy link
Member

Going back to my previous point... You included no code samples and described a different scenario.

Again - this is why we have an issue template with required fields - so you can clearly describe the problem with clear examples to remove any misunderstanding and back-and-forth.


Regardless, duplicate of #2244

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 30, 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
Projects
None yet
Development

No branches or pull requests

2 participants