Error detection automation is difficult on code side

Teo Deleanu
Apr 15, 2019 · 4 min read
Image for post
Image for post
Photo by Nathan Dumlao on Unsplash
function(a,b){ return a * d; }
1:10 error 'test' is defined but never used no-unused-vars 1:17 error 'b' is defined but never used no-unused-vars 2:1 error Expected indentation of 1 tab but found 4 spaces indent 3:1 error Expected indentation of 1 tab but found 4 spaces indent 3:16 error 'd' is not defined no-undef

Installation and Usage

Prerequisites:

Local Installation and Usage

$ npm install eslint --save-dev
$ ./node_modules/.bin/eslint --init
Image for post
Image for post
$ ./node_modules/.bin/eslint yourfile.js
$ npx eslint
$ npm install -g eslint
$ eslint --init
$ eslint yourfile.js
./node_modules/.bin/eslint --fix --ext .js test.js/appseed/starter-express/test.js 1:10 error 'test' is defined but never used no-unused-vars 1:17 error 'b' is defined but never used no-unused-vars 3:13 error 'd' is not defined no-undef
function test(a,b){ return a * b; } test(1,2);
node_modules/eslint/bin/eslint.js test.js➜ starter-express git:(feat/sequelize-orm-register) ✗
"scripts": { "start": "node index.js", "dev": "nodemon start", "lint": "./node_modules/.bin/eslint --ext .js config/ models/ routes/ seeders/ index.js", "lint-fix": "./node_modules/.bin/eslint --fix --ext .js config/ models/ routes/ seeders/ index.js" }
npm run lint npm run lint-fix

Own the code series by Teo Deleanu

To prepare a better 2019, you can continuously learn the…

Teo Deleanu

Written by

Tech and startup enthusiast. Web, IoT, node, python.

Own the code series by Teo Deleanu

To prepare a better 2019, you can continuously learn the coding basics used by senior developers. Follow a full stack custom-tailored series for your objectives: solopreneurship or starting a career.

Teo Deleanu

Written by

Tech and startup enthusiast. Web, IoT, node, python.

Own the code series by Teo Deleanu

To prepare a better 2019, you can continuously learn the coding basics used by senior developers. Follow a full stack custom-tailored series for your objectives: solopreneurship or starting a career.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store