Prevents leaving comment blocks in the file. This plugin will ignore all comments starting from string global
or eslint
in order to keep eslint local settings safe.
Why?
If the source code is not being processed by a bundler or any other tool, there is a risk of shipping some notes, old code blocks or sensitive information to production environment.
Installation
npm install eslint-plugin-no-comments --save-dev
Configuration
{
"plugins": ["eslint-plugin-no-comments"],
"rules": {
"eslint-plugin-no-comments/disallowComments": "error"
}
}
Rule details
Fail
const {Text, Image} = require('react-native')
const {Text, Image} = require('cool-package')
Pass
var price1 = 5;
var price2 = 6;
var total = price1 + price2;
Author
MIT License