Sunday 31 December 2017

How to Setup ESLint with Standard

Hi everyone, new to Node/JavaScript so please correct me if on anything I may be doing wrong.How do I setup ESLint w/ Standard? I've got a "lint" command in my script section of package.json like below:"scripts": { "dev": "./node_modules/.bin/eslint . && nodemon server.js", "dev:db": "json-server --watch db.json", "test": "echo \"Error: no test specified\" && exit 1", "lint": "./node_modules/.bin/eslint .", "lint:fix": "eslint --ext .js -f ./node_modules/eslint-friendly-formatter --fix server" } "dependencies": { "axios": "^0.17.1", "babel-eslint": "^8.1.2", "eslint-plugin-html": "^4.0.1", "express": "^4.16.2", "express-graphql": "^0.6.11", "graphql": "^0.12.3", "json-server": "^0.12.1", "nodemon": "^1.14.6" }, "devDependencies": { "eslint": "^4.14.0", "eslint-config-standard": "^11.0.0-beta.0", "eslint-plugin-import": "^2.8.0", "eslint-plugin-node": "^5.2.1", "eslint-plugin-promise": "^3.6.0", "eslint-plugin-standard": "^3.0.1", "standard": "^10.0.3" } But when I run yarn dev all I get is some of the ESLint outputs. When I violate the Standard linting guidelines no error is returned.My expected result is that every time nodemon restarts all linting errors will be outputted and nodemon will refuse to execute until the linting issues are resolved.As it is now only ESLint issues will stop my server from running. Thank you for any tips or references.

Submitted December 31, 2017 at 11:20PM by AmishPanda00

No comments:

Post a Comment