Skip to content

Commit b472450

Browse files
committed
refactor: migrate to latest prettier
Signed-off-by: Vojtech Masek <[email protected]>
1 parent 5d31afc commit b472450

File tree

33 files changed

+114
-111
lines changed

33 files changed

+114
-111
lines changed

.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"singleQuote": true,
33
"arrowParens": "avoid",
44
"trailingComma": "all",
5+
"plugins": ["@trivago/prettier-plugin-sort-imports"],
56
"importOrder": [
67
"^@code-pushup/portal-client$",
78
"^@code-pushup/(.*)$",

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ npm install
1616

1717
This table provides a quick overview of the environmental setup, with detailed explanations in the corresponding sections.
1818

19-
| Feature | Local Default | CI Default | Description |
20-
| -------------------------------- | ------------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------- |
21-
| `env.INCLUDE_SLOW_TESTS` **❗️** | `false` | `true` | Controls inclusion of long-running tests. Overridden by setting. Details in the [Testing](#Testing) section. |
22-
| `env.CUSTOM_CHROME_PATH` | N/A | Windows **❗️❗️** | Path to Chrome executable. See [plugin-lighthouse/CONTRIBUTING.md](./packages/plugin-lighthouse/CONTRIBUTING.md#chrome-path). |
23-
| Quality Pipeline | Off | On | Runs all plugins against the codebase. |
19+
| Feature | Local Default | CI Default | Description |
20+
| ------------------------------- | ------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------- |
21+
| `env.INCLUDE_SLOW_TESTS` **❗️** | `false` | `true` | Controls inclusion of long-running tests. Overridden by setting. Details in the [Testing](#Testing) section. |
22+
| `env.CUSTOM_CHROME_PATH` | N/A | Windows **❗️❗️** | Path to Chrome executable. See [plugin-lighthouse/CONTRIBUTING.md](./packages/plugin-lighthouse/CONTRIBUTING.md#chrome-path). |
23+
| Quality Pipeline | Off | On | Runs all plugins against the codebase. |
2424

2525
**❗️** Test Inclusion Logic
2626

docs/e2e.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Root/
102102
// nx.json
103103
{
104104
// ...
105-
"plugins": ["tools/src/npm/npm.plugin.ts", "tools/src/publish/publish.plugin.ts", "tools/src/verdaccio/verdaccio.plugin.ts"]
105+
"plugins": ["tools/src/npm/npm.plugin.ts", "tools/src/publish/publish.plugin.ts", "tools/src/verdaccio/verdaccio.plugin.ts"],
106106
}
107107
```
108108

@@ -115,10 +115,10 @@ Root/
115115
"e2e": {
116116
"executor": "@nx/vite:test",
117117
"options": {
118-
"configFile": "e2e/<project-name>-e2e/vite.config.e2e.ts"
119-
}
120-
}
121-
}
118+
"configFile": "e2e/<project-name>-e2e/vite.config.e2e.ts",
119+
},
120+
},
121+
},
122122
}
123123
```
124124

e2e/cli-e2e/tests/collect.e2e.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('CLI collect', () => {
3232
audits: audits.map(
3333
pluginReport.slug === 'lighthouse' ? omitVariableAuditData : p => p,
3434
) as AuditReport[],
35-
} as PluginReport);
35+
}) as PluginReport;
3636
const omitVariableReportData = ({
3737
commit,
3838
date,

examples/react-todos-app/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"@swc/core": "^1.3.99",
6868
"@testing-library/jest-dom": "^6.4.2",
6969
"@testing-library/react": "^14.0.0",
70-
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
70+
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
7171
"@types/benchmark": "^2.1.5",
7272
"@types/debug": "^4.1.12",
7373
"@types/eslint": "^8.44.2",
@@ -106,7 +106,7 @@
106106
"knip": "^5.9.4",
107107
"memfs": "^4.5.0",
108108
"moment": "^2.29.4",
109-
"prettier": "^2.6.2",
109+
"prettier": "^3.3.3",
110110
"react": "^18.2.0",
111111
"react-dom": "^18.2.0",
112112
"tsconfig-paths": "^4.2.0",

packages/cli/src/lib/implementation/core-config.integration.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ vi.mock('@code-pushup/core', async () => {
3838
return filepath.includes('all-persist-options')
3939
? allPersistOptions
4040
: filepath.includes('persist-only-filename')
41-
? persistOnlyFilename
42-
: filepath.includes('no-persist')
43-
? noPersist
44-
: filepath.includes('no-category')
45-
? noCategory
46-
: filepath.includes('no-upload')
47-
? noUpload
48-
: CORE_CONFIG_MOCK;
41+
? persistOnlyFilename
42+
: filepath.includes('no-persist')
43+
? noPersist
44+
: filepath.includes('no-category')
45+
? noCategory
46+
: filepath.includes('no-upload')
47+
? noUpload
48+
: CORE_CONFIG_MOCK;
4949
}),
5050
};
5151
});

packages/cli/src/lib/implementation/global.utils.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ export function filterKebabCaseKeys<T extends Record<string, unknown>>(
1313
(typeof value === 'object' && Array.isArray(obj[key]))
1414
? { ...acc, [key]: value }
1515
: typeof value === 'object' && !Array.isArray(value) && value != null
16-
? {
17-
...acc,
18-
[key]: filterKebabCaseKeys(value as Record<string, unknown>),
19-
}
20-
: { ...acc, [key]: value },
16+
? {
17+
...acc,
18+
[key]: filterKebabCaseKeys(value as Record<string, unknown>),
19+
}
20+
: { ...acc, [key]: value },
2121
{},
2222
) as T;
2323
}

packages/cli/src/lib/implementation/validate-filter-options.utils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ export function validateFilterOption(
1818
const validItems = isCategoryOption(option)
1919
? categories
2020
: isPluginOption(option)
21-
? plugins
22-
: [];
21+
? plugins
22+
: [];
2323
const invalidItems = itemsToFilter.filter(
2424
item => !validItems.some(({ slug }) => slug === item),
2525
);
@@ -94,8 +94,8 @@ export function getItemType(option: FilterOptionType, count: number): string {
9494
const itemType = isCategoryOption(option)
9595
? 'category'
9696
: isPluginOption(option)
97-
? 'plugin'
98-
: 'item';
97+
? 'plugin'
98+
: 'item';
9999
return pluralize(itemType, count);
100100
}
101101

0 commit comments

Comments
 (0)