Bug: [naming-convention] Default import
config clashes with common npm import patterns (PascalCase and other-cased imports)
#7838
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
bug
Something isn't working
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Originally reported over here + confirmed by @JoshuaKGoldberg :
Before You File a Bug Report Please Confirm You Have Done The Following...
Playground Link
https://typescript-eslint.io/play/#ts=5.2.2&fileType=.tsx&code=JYWwDg9gTgLgBAJQKYEMDG8BmUIjgcilQ3wG4AoIA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6JgQwFtmBzWsgHsmAN0QtKw9GADa4bDkTRog6JAA08hVgXZIyREjL5V0yABNEAMw4J8GrbshXVXDvYxzdTst0MBhDgNIRwUAXU1vHCQOcz4AVSZLaGQhaEQzDnh4QQB3ByiofGgOSkYmXkTk1NUMjEgsnPzQsABfSN0db31DRGNTepEOKg4AIyQCqOdXd2kvQqhfLgCgjI7CyHiABS2AUQAlAH1-AEEAZV2QwoiW6MRYhKSlGvTM7LzJ7uLS8sqnlLSdSgjQ%2BLXaLS6TgMRhManqRFIABlKABrNa3KAuaBuDyyDE4LZBXzwQLBDFhMGOCkQVogVpAA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false
Repro Code
ESLint Config
tsconfig
Expected Result
Just upgraded to
@typescript-eslint/eslint-plugin@6.9.0
with the newimport
option fornaming-convention
config and received a number of new warnings, such as this one:With this code:
I guess this is going to be a pretty common pattern that gets rejected now. 😬
Actual Result
Maybe the default configuration should accept every format as an import? (
format: null
)Alternative: expect all users with default
PascalCase
imports (pretty common across the npm ecosystem, incl. React) and other case format eg.UPPER_CASE
orsnake_case
to add the following to their config:Additional Info
No response
The text was updated successfully, but these errors were encountered: