Version: 1.5.0
Steps To Reproduce
The alias in the title lets me import everything from my root with an absolute path, like import CustomText from '@/components/CustomText'.
- Have a
babel.config.js file with a module-resolver alias like '@': './'
- Try using a relative import like
import CustomText from '../../../components/CustomText'
- See that there is no warning for the line
Link to code example:
babel.config.js:
module.exports = function (api) {
api.cache(true)
return {
presets: ['babel-preset-expo'],
plugins: [
[
'module-resolver',
{
alias: {
'@': './',
},
},
],
],
}
}
The current behavior
With just the alias '@': './', the plugin doesn't detect an import like import CustomText from '../../../components/CustomText' to be invalid. But if you add another alias like '@components': './components', then it does detect the aforementioned line as invalid.
The expected behavior
It should detect relative imports as invalid.
Version: 1.5.0
Steps To Reproduce
The alias in the title lets me import everything from my root with an absolute path, like
import CustomText from '@/components/CustomText'.babel.config.jsfile with amodule-resolveralias like'@': './'import CustomText from '../../../components/CustomText'Link to code example:
babel.config.js:The current behavior
With just the alias
'@': './', the plugin doesn't detect an import likeimport CustomText from '../../../components/CustomText'to be invalid. But if you add another alias like'@components': './components', then it does detect the aforementioned line as invalid.The expected behavior
It should detect relative imports as invalid.