Skip to content

Commit b3f14c5

Browse files
committed
Fix formatting and test imports
1 parent 2eebcba commit b3f14c5

13 files changed

+28
-23
lines changed

scripts/helpers/format-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ function optionsPreview(options) {
235235
*/
236236
function truncate(text, max) {
237237
if (text.length > max) {
238-
return `${text.slice(0, max - 3) }...`;
238+
return `${text.slice(0, max - 3)}...`;
239239
}
240240
return text;
241241
}

scripts/helpers/format-readme.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,11 @@ function mermaidDiagram(nodes, edges, orientation = 'TD') {
131131
.map(node => ` ${node.id}("${node.label}")`),
132132
...edges.map(
133133
edge =>
134-
` ${
135-
[edge.from, edge.label ? `--${edge.label}-->` : '-->', edge.to].join(
136-
' ',
137-
)}`,
134+
` ${[
135+
edge.from,
136+
edge.label ? `--${edge.label}-->` : '-->',
137+
edge.to,
138+
].join(' ')}`,
138139
),
139140
].join('\n');
140141
}

src/lib/utils.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
* @returns {import('eslint').Linter.RulesRecord}
77
*/
88
export function convertErrorsToWarnings(rules) {
9-
return Object.fromEntries(Object.entries(rules).map(
10-
( [ruleId, entry]) => [ruleId, entry === 'error' || entry === 2 ? 'warn' : entry],
11-
));
9+
return Object.fromEntries(
10+
Object.entries(rules).map(([ruleId, entry]) => [
11+
ruleId,
12+
entry === 'error' || entry === 2 ? 'warn' : entry,
13+
]),
14+
);
1215
}

tests/configs/angular.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
3+
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
44
import { createLintUtils } from '../helpers/lint-utils';
55

66
describe('angular config', () => {

tests/configs/graphql.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
3+
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
44
import { createLintUtils } from '../helpers/lint-utils';
55

66
describe('graphql config', () => {

tests/configs/javascript.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
3+
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
44
import { createLintUtils } from '../helpers/lint-utils';
55

66
describe('javascript config', () => {

tests/configs/jest.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
3+
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
44
import { createLintUtils } from '../helpers/lint-utils';
55

66
describe('jest config', () => {

tests/configs/ngrx.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
3+
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
44
import { createLintUtils } from '../helpers/lint-utils';
55

66
describe('ngrx config', () => {

tests/configs/node.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
3+
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
44
import { createLintUtils } from '../helpers/lint-utils';
55

66
describe('node config', () => {

tests/configs/storybook.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
3+
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
44
import { createLintUtils } from '../helpers/lint-utils';
55

66
describe('storybook config', () => {

tests/configs/typescript.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
3+
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
44
import { createLintUtils } from '../helpers/lint-utils.js';
55

66
describe('typescript config', () => {

tests/configs/vitest.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
3+
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
44
import { createLintUtils } from '../helpers/lint-utils';
55

66
describe('vitest config', () => {

tests/package.json.spec.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { satisfies } from 'compare-versions';
44
import { readFile } from 'node:fs/promises';
5-
import { beforeAll, describe, expect, test } from 'vitest';
5+
import { beforeAll, describe, expect, it } from 'vitest';
66

77
describe('package.json checks', () => {
88
/** @type {{ devDependencies: Record<string, string>, peerDependencies: Record<string, string>, peerDependenciesMeta: Record<string, { optional?: boolean }> }} */
@@ -22,8 +22,9 @@ describe('package.json checks', () => {
2222
return {
2323
pass: satisfies(version, range),
2424
message: () =>
25-
`Version ${version} ${isNot ? 'does not satisfy' : 'satisfies'} range ${range}${
26-
name ? ` [package: ${name}]` : ''}`,
25+
`Version ${version} ${isNot ? 'does not satisfy' : 'satisfies'} range ${range}${
26+
name ? ` [package: ${name}]` : ''
27+
}`,
2728
};
2829
},
2930
});
@@ -58,9 +59,9 @@ describe('package.json checks', () => {
5859

5960
it('should mark peer dependency as optional if not included in default config', async () => {
6061
const { default: javascript } = await import('@code-pushup/eslint-config');
61-
const plugins = new Set(javascript.flatMap(config =>
62-
Object.keys(config.plugins ?? {}),
63-
));
62+
const plugins = new Set(
63+
javascript.flatMap(config => Object.keys(config.plugins ?? {})),
64+
);
6465
const expected = Object.keys(packageJson.peerDependencies)
6566
.filter(pkg => {
6667
if (!pkg.includes('eslint-plugin')) {

0 commit comments

Comments
 (0)