Common ESLint rules for Postman
npm install --save-dev eslint-config-postmanUpdate the .eslintrc in the project root as follows:
{
"root": true,
"extends": "postman"
}Only make these changes if you want to remove ESLint as a direct dependency.
No changes needed!
Replace require('eslint') with require('eslint-config-postman/node_modules/eslint')
More details: https://eslint.org/docs/developer-guide/nodejs-api
If you're not using additional plugins, prune nested config files with:
find . -name .eslintrc -type f -mindepth 2 -delete;This is recommended to abstract plugin specifics away into one config bundle Skip this if you're using ESLint as a CLI, or if you're using other plugins in addition to those covered by this config
npm uninstall eslint eslint-plugin-jsdoc eslint-plugin-lodash eslint-plugin-mocha eslint-plugin-node eslint-plugin-security