Reputation: 1569
when i run
(
export PKG=eslint-config-airbnb;
npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG@latest"
)
successfully. eslint --init
and run the script in package.json
.
Info : my Node node v7.5.0
npm 4.1.2
there is problem below.
npm ERR! Darwin 15.6.0
npm ERR! argv "/Users/next/.nvm/versions/node/v7.5.0/bin/node"
/Users/next/.nvm/versions/node/v7.5.0/bin/npm" "run" "lint"
npm ERR! node v7.5.0
npm ERR! npm v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] lint: `eslint app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] lint script 'eslint app.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the beslint package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! eslint app.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs beslint
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls beslint
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/next/es6/jsmodules/beslint/npm-debug.log
Upvotes: 5
Views: 8929
Reputation: 131
Are you sure that running eslint --init
worked ?
This is like you have no .eslintrc
file (the configuration file for ESLint parser options and rules). Check/create the .eslintrc
file at the root directory of your project that you called "beslint".
Then you'll need to add this in the .eslintrc
file in order that ESLint take into account that you want to extend the rules from the Airbnb team:
{
"extends": "airbnb"
}
Note that you can install different rules from the Airbnb team:
The extends
value in your .eslintrc
file should match your installation and be one of these three previous values.
I made a little command line tool that can install ESLint with one of these three different Airbnb configs. It automatically creates and configure the .eslintrc
file if it has not already been done. It helps me a lot on my personal projects and at work! It's called esbnb. Hope it could help you.
Upvotes: 7