From a1c3bf76fb1a55e85f071051be55dc06ebb47c8b Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 17 Oct 2023 11:36:25 -0400 Subject: [PATCH] chore: ran format --- lib/rules/sort-collections.js | 17 +++++++++-------- lib/rules/valid-package-def.js | 10 +++++----- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/lib/rules/sort-collections.js b/lib/rules/sort-collections.js index cea67e32..875fe059 100644 --- a/lib/rules/sort-collections.js +++ b/lib/rules/sort-collections.js @@ -30,10 +30,10 @@ module.exports = { ] }, - create: function (context) { + create: function(context) { const toSort = context.options[0] || defaultCollections; return { - 'Property:exit': (node) => { + 'Property:exit': node => { if (!isPackageJson(context.getFilename())) { return; } @@ -63,12 +63,13 @@ module.exports = { collection, JSON.stringify( desiredOrder.reduce((out, property) => { - out[property.key.value] = - JSON.parse( - context - .getSourceCode() - .getText(property.value) - ); + out[ + property.key.value + ] = JSON.parse( + context + .getSourceCode() + .getText(property.value) + ); return out; }, {}), null, diff --git a/lib/rules/valid-package-def.js b/lib/rules/valid-package-def.js index f6ae5312..25c6ad84 100644 --- a/lib/rules/valid-package-def.js +++ b/lib/rules/valid-package-def.js @@ -18,8 +18,8 @@ const unusedErrorPatterns = [ /^author field should have name/i ]; -const isUsableError = (errorText) => - unusedErrorPatterns.every((pattern) => !pattern.test(errorText)); +const isUsableError = errorText => + unusedErrorPatterns.every(pattern => !pattern.test(errorText)); module.exports = { meta: { @@ -32,9 +32,9 @@ module.exports = { fixable: null // or "code" or "whitespace" }, - create: function (context) { + create: function(context) { return { - 'Program:exit': (node) => { + 'Program:exit': node => { if (!isPackageJson(context.getFilename())) { return; } @@ -47,7 +47,7 @@ module.exports = { if (critical || errors) { const allErrors = [...(critical || []), ...errors]; allErrors.filter(isUsableError).forEach( - (message) => + message => message && context.report({ node: packageRoot,