Skip to content

Commit

Permalink
chore: add eslint-plugin-eslint-comments (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmish committed Aug 15, 2022
1 parent aeac273 commit a1eaf30
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
},
extends: [
'not-an-aardvark/node',
'plugin:eslint-comments/recommended',
'plugin:node/recommended',
'plugin:prettier/recommended',
'plugin:unicorn/recommended',
Expand All @@ -23,6 +24,9 @@ module.exports = {
],
'require-jsdoc': 'error',

'eslint-comments/no-unused-disable': 'error',
'eslint-comments/require-description': 'error',

'unicorn/consistent-function-scoping': 'off',
'unicorn/no-array-callback-reference': 'off',
'unicorn/no-array-for-each': 'off',
Expand Down Expand Up @@ -65,6 +69,8 @@ module.exports = {
'no-unused-vars': 'off',
strict: 'off',

'eslint-comments/require-description': 'off',

'unicorn/filename-case': 'off',
},
},
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const allRules = Object.fromEntries(

module.exports.rules = allRules;

// eslint-disable-next-line unicorn/prefer-object-from-entries
// eslint-disable-next-line unicorn/prefer-object-from-entries -- this is fine for now
module.exports.configs = Object.keys(configFilters).reduce(
(configs, configName) => {
return Object.assign(configs, {
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/require-meta-docs-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ module.exports = {

messageId: !urlPropNode
? 'missing'
: // eslint-disable-next-line unicorn/no-nested-ternary
: // eslint-disable-next-line unicorn/no-nested-ternary -- this is fine for now
!expectedUrl
? 'wrongType'
: /* otherwise */ 'mismatch',
Expand Down
8 changes: 4 additions & 4 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const INTERESTING_RULE_KEYS = new Set(['create', 'meta']);
* @returns Object
*/
function collectInterestingProperties(properties, interestingKeys) {
// eslint-disable-next-line unicorn/prefer-object-from-entries
// eslint-disable-next-line unicorn/prefer-object-from-entries -- this is fine for now
return properties.reduce((parsedProps, prop) => {
const keyValue = module.exports.getKeyName(prop);
if (interestingKeys.has(keyValue)) {
Expand Down Expand Up @@ -128,7 +128,7 @@ function getRuleExportsESM(ast, scopeManager) {
].includes(statement.type)
)
.map((statement) => statement.declaration || statement.expression)
// eslint-disable-next-line unicorn/prefer-object-from-entries
// eslint-disable-next-line unicorn/prefer-object-from-entries -- this is fine for now
.reduce((currentExports, node) => {
if (node.type === 'ObjectExpression') {
// Check `export default { create() {}, meta: {} }`
Expand Down Expand Up @@ -184,7 +184,7 @@ function getRuleExportsCJS(ast, scopeManager) {
.map((statement) => statement.expression)
.filter((expression) => expression.type === 'AssignmentExpression')
.filter((expression) => expression.left.type === 'MemberExpression')
// eslint-disable-next-line unicorn/prefer-object-from-entries
// eslint-disable-next-line unicorn/prefer-object-from-entries -- this is fine for now
.reduce((currentExports, node) => {
if (
node.left.object.type === 'Identifier' &&
Expand Down Expand Up @@ -600,7 +600,7 @@ module.exports = {

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

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"eslint": "^8.7.0",
"eslint-config-not-an-aardvark": "^2.1.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-eslint-plugin": "file:./",
"eslint-plugin-markdown": "^2.0.1",
"eslint-plugin-node": "^11.1.0",
Expand Down

0 comments on commit a1eaf30

Please sign in to comment.