Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. # Generate ESLint rules to silence
  2.  
  3. ## Install eslint-json
  4.  
  5. ```sh
  6. $ npm install eslint-json
  7. ```
  8.  
  9. ## Store warnings
  10.  
  11. ```sh
  12. $ eslint --format=node_modules/eslint-json . > warnings.json
  13. ```
  14.  
  15. ## Compute rules
  16.  
  17. ```javascript
  18. let _warnings = [];
  19. require('./warnings').forEach(warning => {
  20. _warnings = _warnings.concat(warning.messages.map(message => message.ruleId));
  21. });
  22. let rules = {};
  23. [...new Set(_warnings)].forEach(warning => {
  24. rules[warning] = 0;
  25. });
  26. console.log(JSON.stringify(rules, null, ' '));
  27. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement