Hi, Im trying to install ESLint for my React Native app by the tutorial here:
My packages.json:
{
"name": "TodosList",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "~15.4.0-rc.4",
"react-native": "0.38.0"
},
"devDependencies": {
"babel-jest": "17.0.2",
"babel-preset-react-native": "1.9.0",
"jest": "17.0.3",
"jest-react-native": "17.1.0",
"react-test-renderer": "~15.4.0-rc.4",
"eslint": "^3.11.1",
"eslint-plugin-react": "^6.7.1",
"eslint-plugin-react-native": "^2.2.0"
},
"jest": {
"preset": "react-native"
}
}
and I keep getting this error:
Cannot find module 'eslint-config-defaults/configurations/eslint' Referenced from: c:\Users\lednh\.eslintrc
and I don't have eslint installed globally.
@lednhatkhanh: can you try running ESLint from a terminal opened on the VS Code workspace that shows the problem. Will that work ?
Sorry for late respond! I realized that there's a global eslintrc left and vscode tried to find the configs in that file, not in my local file. So I deleted that file and everything started working fine.
@lednhatkhanh good to hear that it is working now. Will close the issue.
The global .eslintrc file was hiding in C:\Users\User for me. Deleting that solved this issue.
Most helpful comment
Sorry for late respond! I realized that there's a global eslintrc left and vscode tried to find the configs in that file, not in my local file. So I deleted that file and everything started working fine.