HeroProtagonist/eslint-plugin-module-resolver

Replace extensions option with `ext` field from babel plugin config

jayu opened this issue · 0 comments

jayu commented

In my opinion option extensions is redundant and it will be more convenient for users and more compatible with babel-plugin-module-resolver if we would take list of extensions from babel plugin config.

The default list of extensions is defined here
const defaultExtensions = ['.js', '.jsx', '.es', '.es6', '.mjs'];

Extensions are used to determine whether aliased file exists or not.

So TypeScript users and also React Native users (platform-specific extensions like file.android.js, file.ios.js) have to define extensions array twice.
It would be good to remove that option and get extensions from babel config, however, this would introduce breaking change and we should bump major version of the plugin. I assume it follows semantic versioning.
Edit: supporting array from babel config as a default value for that option seems not to be breaking.

What do you think @HeroProtagonist ?