Skip to content

Commit a1eaf30

Browse files
authored
chore: add eslint-plugin-eslint-comments (#289)
1 parent aeac273 commit a1eaf30

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

.eslintrc.js

+6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = {
88
},
99
extends: [
1010
'not-an-aardvark/node',
11+
'plugin:eslint-comments/recommended',
1112
'plugin:node/recommended',
1213
'plugin:prettier/recommended',
1314
'plugin:unicorn/recommended',
@@ -23,6 +24,9 @@ module.exports = {
2324
],
2425
'require-jsdoc': 'error',
2526

27+
'eslint-comments/no-unused-disable': 'error',
28+
'eslint-comments/require-description': 'error',
29+
2630
'unicorn/consistent-function-scoping': 'off',
2731
'unicorn/no-array-callback-reference': 'off',
2832
'unicorn/no-array-for-each': 'off',
@@ -65,6 +69,8 @@ module.exports = {
6569
'no-unused-vars': 'off',
6670
strict: 'off',
6771

72+
'eslint-comments/require-description': 'off',
73+
6874
'unicorn/filename-case': 'off',
6975
},
7076
},

lib/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const allRules = Object.fromEntries(
4343

4444
module.exports.rules = allRules;
4545

46-
// eslint-disable-next-line unicorn/prefer-object-from-entries
46+
// eslint-disable-next-line unicorn/prefer-object-from-entries -- this is fine for now
4747
module.exports.configs = Object.keys(configFilters).reduce(
4848
(configs, configName) => {
4949
return Object.assign(configs, {

lib/rules/require-meta-docs-url.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ module.exports = {
114114

115115
messageId: !urlPropNode
116116
? 'missing'
117-
: // eslint-disable-next-line unicorn/no-nested-ternary
117+
: // eslint-disable-next-line unicorn/no-nested-ternary -- this is fine for now
118118
!expectedUrl
119119
? 'wrongType'
120120
: /* otherwise */ 'mismatch',

lib/utils.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const INTERESTING_RULE_KEYS = new Set(['create', 'meta']);
4141
* @returns Object
4242
*/
4343
function collectInterestingProperties(properties, interestingKeys) {
44-
// eslint-disable-next-line unicorn/prefer-object-from-entries
44+
// eslint-disable-next-line unicorn/prefer-object-from-entries -- this is fine for now
4545
return properties.reduce((parsedProps, prop) => {
4646
const keyValue = module.exports.getKeyName(prop);
4747
if (interestingKeys.has(keyValue)) {
@@ -128,7 +128,7 @@ function getRuleExportsESM(ast, scopeManager) {
128128
].includes(statement.type)
129129
)
130130
.map((statement) => statement.declaration || statement.expression)
131-
// eslint-disable-next-line unicorn/prefer-object-from-entries
131+
// eslint-disable-next-line unicorn/prefer-object-from-entries -- this is fine for now
132132
.reduce((currentExports, node) => {
133133
if (node.type === 'ObjectExpression') {
134134
// Check `export default { create() {}, meta: {} }`
@@ -184,7 +184,7 @@ function getRuleExportsCJS(ast, scopeManager) {
184184
.map((statement) => statement.expression)
185185
.filter((expression) => expression.type === 'AssignmentExpression')
186186
.filter((expression) => expression.left.type === 'MemberExpression')
187-
// eslint-disable-next-line unicorn/prefer-object-from-entries
187+
// eslint-disable-next-line unicorn/prefer-object-from-entries -- this is fine for now
188188
.reduce((currentExports, node) => {
189189
if (
190190
node.left.object.type === 'Identifier' &&
@@ -600,7 +600,7 @@ module.exports = {
600600

601601
if (reportArgs.length === 1) {
602602
if (reportArgs[0].type === 'ObjectExpression') {
603-
// eslint-disable-next-line unicorn/prefer-object-from-entries
603+
// eslint-disable-next-line unicorn/prefer-object-from-entries -- this is fine for now
604604
return reportArgs[0].properties.reduce((reportInfo, property) => {
605605
const propName = module.exports.getKeyName(property);
606606

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"eslint": "^8.7.0",
5555
"eslint-config-not-an-aardvark": "^2.1.0",
5656
"eslint-config-prettier": "^8.3.0",
57+
"eslint-plugin-eslint-comments": "^3.2.0",
5758
"eslint-plugin-eslint-plugin": "file:./",
5859
"eslint-plugin-markdown": "^2.0.1",
5960
"eslint-plugin-node": "^11.1.0",

0 commit comments

Comments
 (0)