Skip to content

Commit

Permalink
chore: ran format
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Oct 17, 2023
1 parent 3cee590 commit a1c3bf7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
17 changes: 9 additions & 8 deletions lib/rules/sort-collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions lib/rules/valid-package-def.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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;
}
Expand All @@ -47,7 +47,7 @@ module.exports = {
if (critical || errors) {
const allErrors = [...(critical || []), ...errors];
allErrors.filter(isUsableError).forEach(
(message) =>
message =>
message &&
context.report({
node: packageRoot,
Expand Down

0 comments on commit a1c3bf7

Please sign in to comment.