import-js / eslint-plugin-import

ESLint plugin with rules that help validate proper imports.
MIT License
5.58k stars 1.57k forks source link

Feature: option caseSensitive with regex pattern #1656

Open Yegorich555 opened 4 years ago

Yegorich555 commented 4 years ago

I have the following setting with alias:

.eslintrc.js

settings: {
    "import/resolver": {
      alias: {
        map: ["@", "./src],
        extensions: [".ts", ".js", ".jsx", ".tsx", ".json"]
      }
    }
  }

someFile.js

/* There I have the error: 
Casing of @/test does not match the underlying filesystem  import/no-unresolved
*/
import testDefault from "@/test"; 

As I see the plugin doesn't look for 'alias' in 'import/resolver' It should be fixed or it can be implemented via the following case: .eslintrc.js

   "import/no-unresolved": [2, {
         caseSensitive: ["@"] // like it works for ignoreOption
    }],
ljharb commented 4 years ago

To clarify, you're using https://www.npmjs.com/package/eslint-import-resolver-alias ?

I agree that no-unresolved should use the resolver.

Yegorich555 commented 4 years ago

To clarify, you're using https://www.npmjs.com/package/eslint-import-resolver-alias ?

I agree that no-unresolved should use the resolver.

All rights. That is!