Custom file extensions
See original GitHub issueI’m using eslint-import-resolver-alias
along with eslint-import-resolver-typescript
.
I have the following alias:
["@dpStores", path.resolve(__dirname, './src/stores')]
But have the following eslint
error when I try to import a types.tsx
file without specifying the extension:
If I specify the extension it works just fine. Importing files without an extension works fine when not using an alias.
This is my resolver
settings in .eslintrc
:
"settings": { "import/resolver": { "node": true, "eslint-import-resolver-typescript": true, "alias": [ ["@dpStores", path.resolve(__dirname, './src/stores')] ] } }
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How do I make and run my own file extension? - Super User
Save a file with your custom extension. Open the file in Windows Explorer and it will ask you how to open it. Choose...
Read more >How to create my own file extension like .odt or .doc? [closed]
The file extension is .txt which typically indicates that the file contains text data. To create your own file extension all you need...
Read more >What is it? How to open a CUSTOM file? - FILExt
CUSTOM files mostly belong to Personal Paint by Amiga. This is a file of the form: UITEXT.xxx where the file extension denotes the...
Read more >Create Your Own Custom File Type - C# Corner
This article describes a simple approach to creating a custom file type. In the example provided, a custom file type is created around...
Read more >Custom file types (TMS) - Phrase
Custom file types based on XML, TXT, HTML or JSON that are defined by filename and extension can be automatically detected and imported....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Version
1.1.0
is released to support custom file extensions. @Tsury You can try again with the following configuration in your.eslintrc.js
file.@dhlavaty You can solve your problem with a similar configuration as above, like
"extensions": ['.jsx', '.js', '.json']
@Tsury Actually,
eslint-import-resolver-alias
uses Node.js native package resolution to find a module and does not support custom file extensions now. That’s why it works fine when you specify the extension. I’m going to add this new feature recently and hope that will be helpful.