mysticatea / eslint-plugin-eslint-comments

Additional ESLint rules for directive comments of ESLint.
https://mysticatea.github.io/eslint-plugin-eslint-comments/
MIT License
354 stars 44 forks source link

Rule proposal: require-description #40

Closed ota-meshi closed 4 years ago

ota-meshi commented 4 years ago

Please describe what the rule should do:

This rule reports directive comments without description.

What category of rule is this? (place an "X" next to just one item)

[ ] Warns about a potential error (problem) [ ] Suggests an alternate way of doing something (suggestion) [ ] Enforces code style (layout) [X] Other (please specify:)

Provide 2-3 code examples that this rule will warn about:

/* eslint-disable */
/* eslint-disable rule-name */
/* global _ */
/* eslint-env node */

No warning is given if the directive comment contains an description.

/* eslint-disable -- description */
/* eslint-disable rule-name -- description */
/* global _ -- description */
/* eslint-env node -- description */

May need an option to set whether or not to warn depending on the type of directives.

mysticatea commented 4 years ago

Sounds good to me!

nemoDreamer commented 4 years ago

I was just considering opening a pull-request for this! ❤️ Thanks, @ota-meshi !!

dimitropoulos commented 4 years ago

thanks again for doing this: it inspired me to do https://github.com/typescript-eslint/typescript-eslint/pull/2099