eslint-plugin-calm-comments
v1.1.0
Published
ESLint plugin that keeps comments calm and collected (=more readable).
Readme
eslint-plugin-calm-comments 💌
ESLint plugin that keeps comments calm and collected (=more readable).
Install
npm install eslint-plugin-calm-comments --save-devUsage
Add calm-comments to the plugins section and enable the rules you want.
{
"plugins": ["calm-comments"],
"rules": {
"calm-comments/no-uppercase-comments": "warn",
"calm-comments/no-punctuation-spam": "warn"
}
}Rules
no-uppercase-comments
Disallows comments that are entirely or mostly uppercase.
Yelling in an academic sense is when a text is written in all-uppercase, which in most educated contexts is perceived as shouting. The rule tries to walk a tight line between tolerating short outbursts or curses while preventing long blocks of uppercase that clearly read like yelling. Like any ESLint rule it is opinionated and can cause friction for some developers ¯\(ツ)/¯. Curse speeches are still possible despite using this linting rule when maintaining properly-cased and civil, yet extremely legendary™️ manners.
Abbreviation tradeoff
Regardless of relevance, short abbreviations of up to four
letters such as NASA, HTML or KISS are allowed. Words longer than four
letters like UNESCO would be reported as rule violations.
BAD
// THIS IS YELLING
// WHY IS THE CODE NOT WORKING?GOOD
// This is calm.
// Not all CAPS here.no-punctuation-spam
Reports comments with long sequences of punctuation such as !!,, !!!, ???, or ....
BAD
// OMG!!!
// What???
// ........GOOD
// This is fine.
// still fine!
// What?License
MIT
