Initialize package
// npm
npm init -y
// yarn
yarn init -yInstall eslint
// npm
npm install eslint --save-dev
// yarn
yarn add eslint --devInitialize basic config for eslint
// npm
npx eslint --init
//yarn
yarn run eslint --initConfigure .eslintrc.{js,yml,json}
{
"rules": {
"semi": ["error", "always"],
"qoutes": ["error", "double"]
}
}"off" === 0
"warn" === 1
"error" === 2
{
"extends": "eslint:recommended"
}Rules with check on this page will be extended to your config.
You can use configurations created by the others by extending them. Can be find here
// npm
npx eslint yourfile.js
// yarn
yarn run eslint yourfile.js