Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Generate ESLint rules to silence
- ## Install eslint-json
- ```sh
- $ npm install eslint-json
- ```
- ## Store warnings
- ```sh
- $ eslint --format=node_modules/eslint-json . > warnings.json
- ```
- ## Compute rules
- ```javascript
- let _warnings = [];
- require('./warnings').forEach(warning => {
- _warnings = _warnings.concat(warning.messages.map(message => message.ruleId));
- });
- let rules = {};
- [...new Set(_warnings)].forEach(warning => {
- rules[warning] = 0;
- });
- console.log(JSON.stringify(rules, null, ' '));
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement