-1
I own a repository monorepo done with Yarn and in this I have a project frontend created with the command create-react-app
. I installed the libs React-app-rewired and customize-Cra to inject the settings to the plugin’s Babel Babel-plugin-root-import and these are working correctly, my project runs error-free, follows code from my config-overrides.js file
const { addBabelPlugin, override } = require('customize-cra');
module.exports = override(
addBabelPlugin([
'babel-plugin-root-import',
{
rootPathSuffix: 'src',
},
])
);
The problem is with mine Eslint which does not recognize the paths of my files. I installed the lib Eslint-import-resolve-Babel-plugin-root-import to handle situation, and added to my file .eslintrc.json the following configuration
"settings": {
"import/resolver": {
"babel-plugin-root-import": {
"rootPathSuffix": "src"
}
}
}
Despite the instructions in the configuration file Eslint comply with the instructions in documentation, the Eslint continues not to recognize file paths as valid. I am imported my files as follows
import SignIn from '~/pages/SignIn';
import SignUp from '~/pages/SignUp';
import Dashboard from '~/pages/Dashboard';
import Profile from '~/pages/Profile';