Repository to install ESLint, plugins and js-beautify.
For more information please see:
- https://github.com/parsiya/eslint-security-scanner-configs/tree/package
- https://medium.com/greenwolf-security/linting-for-bugs-vulnerabilities-49bc75a61c6
git clone https://github.com/parsiya/eslint-security
npm install
- Access ESLint:
node_modules/.bin/eslint
, access js-beautify:node_modules/.bin/js-beautify
.
npm i --save eslint eslint-plugin-standard eslint-plugin-import eslint-plugin-node eslint-plugin-promise eslint-config-standard eslint-config-semistandard eslint-plugin-scanjs-rules eslint-plugin-no-unsanitized eslint-plugin-prototype-pollution-security-rules eslint-plugin-angularjs-security-rules eslint-plugin-react eslint-plugin-security eslint-plugin-no-wildcard-postmessage js-beautify
ESLint might encounter parsing errors. Check the output for these errors. try and resolve them. Parsing errors may prevent ESLint from performing analysis on files. Searching for the error usually turns up the solution.
If you see an error not covered here please make an issue with the error and your solution. I will add them here.
Add the following to your config file. Chances are your config file already has
parserOptions
.
"parserOptions": {
"sourceType": "module",
}
Credit: AtomLinter/linter-eslint#462 (comment)
- Change the ESLint parser from
esprima
(default) tobabel-eslint
. - Add
allowImportExportEverywhere: true
toparserOptions
.
"parser": "babel-eslint",
"parserOptions": {
// ...
"allowImportExportEverywhere": true
},
- Jacob Wilkin for his blog post and config files. See his configs at
configs/eslintrc-light|heavy.js
: - Lewis Ardern (Solid 5/7 JavaScript guy). See his config at
configs/eslintrc-lewis.js
: