I use create-react-app to make a react app.
the linter works in create-react-app but now i want make it work in my sublimetext.
- Installed eslint
yarn global add eslint
(eslint v4.1.1 but also tried v3.19.0 because react app uses that one) - run
eslint --init
and configured it - go to directory of project and made a file called
.eslintrc
- inside file:
{ "extends": "react-app" }
- run in project directory
eslint src/App.js
get error in terminal :
Referenced from: /mnt/storage/Dev/newapp/.eslintrc Error: Cannot find module 'eslint-config-react-app'
Referenced from: /mnt/storage/Dev/newapp/.eslintrc at ModuleResolver.resolve (/home/user/.config/yarn/global/node_modules/eslint/lib/util/module-resolver.js:74:19) at resolve (/home/user/.config/yarn/global/node_modules/eslint/lib/config/config-file.js:515:25) at load (/home/user/.config/yarn/global/node_modules/eslint/lib/config/config-file.js:584:26) at configExtends.reduceRight (/home/user/.config/yarn/global/node_modules/eslint/lib/config/config-file.js:421:36) at Array.reduceRight (native) at applyExtends (/home/user/.config/yarn/global/node_modules/eslint/lib/config/config-file.js:405:28) at loadFromDisk (/home/user/.config/yarn/global/node_modules/eslint/lib/config/config-file.js:556:22) at Object.load (/home/user/.config/yarn/global/node_modules/eslint/lib/config/config-file.js:592:20) at Config.getLocalConfigHierarchy (/home/user/.config/yarn/global/node_modules/eslint/lib/config.js:228:44) at Config.getConfigHierarchy (/home/user/.config/yarn/global/node_modules/eslint/lib/config.js:182:43)
I did add yarn global add babel-eslint eslint-plugin-react eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-flowtype
. but i think this is not necessary anymore!