Skip to content

Commit df2fcb5

Browse files
authored
chore(prettier): better targets files needed to be prettier (#347)
* chore(prettier): improve targets Signed-off-by: axel7083 <[email protected]> * chore(prettier): include changes Signed-off-by: axel7083 <[email protected]> --------- Signed-off-by: axel7083 <[email protected]>
1 parent a42dbdc commit df2fcb5

15 files changed

+50
-87
lines changed

.prettierignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# ignore vite build output
2+
packages/**/dist/*
3+
packages/backend/media/*
4+
5+
# ignore vitest coverage
6+
packages/**/coverage/*
7+
8+
# ignore node_modules
9+
**/**/node_modules/**

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"build:frontend": "cd packages/frontend && npm run build",
1717
"build": "concurrently \"npm run build:frontend\" \"npm run build:backend\"",
1818
"watch": "concurrently \"cd packages/frontend && npm run watch\" \"cd packages/backend && npm run watch\"",
19-
"format:check": "prettier --check \"**/src/**/*.{ts,svelte}\"",
20-
"format:fix": "prettier --write \"**/src/**/*.{ts,svelte}\"",
19+
"format:check": "prettier --check \"packages/**/*.{ts,js,json,svelte}\"",
20+
"format:fix": "prettier --write \"packages/**/*.{ts,js,json,svelte}\"",
2121
"lint:check": "eslint . --cache",
2222
"lint:fix": "eslint . --cache --fix",
2323
"svelte:check": "svelte-check",

packages/backend/tsconfig.json

+4-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"strict":true,
3+
"strict": true,
44
"target": "esnext",
55
"module": "esnext",
66
"moduleResolution": "Node",
@@ -9,21 +9,13 @@
99
"outDir": "dist",
1010
"allowSyntheticDefaultImports": true,
1111
"skipLibCheck": true,
12-
"types": [
13-
"node",
14-
],
12+
"types": ["node"],
1513
"paths": {
1614
"/@shared/*": ["../shared/*"]
1715
},
1816
"noImplicitOverride": true,
1917
"noImplicitReturns": true,
20-
"noUnusedLocals": true,
18+
"noUnusedLocals": true
2119
},
22-
"include": [
23-
"src",
24-
"types/*.d.ts",
25-
"../../types/*.d.ts",
26-
"../shared/*.ts",
27-
"../shared/**/*.ts"
28-
],
20+
"include": ["src", "types/*.d.ts", "../../types/*.d.ts", "../shared/*.ts", "../shared/**/*.ts"]
2921
}

packages/backend/vite.config.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {join} from 'path';
2-
import {builtinModules} from 'module';
1+
import { join } from 'path';
2+
import { builtinModules } from 'module';
33

44
const PACKAGE_ROOT = __dirname;
55

@@ -41,10 +41,7 @@ const config = {
4141
formats: ['cjs'],
4242
},
4343
rollupOptions: {
44-
external: [
45-
'@podman-desktop/api',
46-
...builtinModules.flatMap(p => [p, `node:${p}`]),
47-
],
44+
external: ['@podman-desktop/api', ...builtinModules.flatMap(p => [p, `node:${p}`])],
4845
output: {
4946
entryFileNames: '[name].cjs',
5047
},

packages/backend/vitest.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const config = {
1010
provider: 'v8',
1111
reporter: ['lcov', 'text'],
1212
},
13-
},
14-
resolve: {
13+
},
14+
resolve: {
1515
alias: {
1616
'@podman-desktop/api': path.resolve(__dirname, '__mocks__/@podman-desktop/api.js'),
1717
'/@/': join(PACKAGE_ROOT, 'src') + '/',

packages/frontend/vite.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { svelte } from '@sveltejs/vite-plugin-svelte';
55
import { svelteTesting } from '@testing-library/svelte/vite';
66
import { defineConfig } from 'vite';
77
import { fileURLToPath } from 'url';
8-
import tailwindcss from '@tailwindcss/vite'
8+
import tailwindcss from '@tailwindcss/vite';
99

1010
let filename = fileURLToPath(import.meta.url);
1111
const PACKAGE_ROOT = path.dirname(filename);

packages/podlet-js/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,7 @@
2222
"dependencies": {
2323
"js-ini": "^1.6.0"
2424
},
25-
"files": ["dist"]
25+
"files": [
26+
"dist"
27+
]
2628
}

packages/podlet-js/src/images/tests/hello-world/image-inspect.json

+5-15
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
22
"Id": "5dd467fce50b56951185da365b5feee75409968cbab5767b9b59e325fb2ecbc0",
33
"Digest": "sha256:43de9874507eaa8ffd88eac885b672b1dfc57cc583d9ad920850f97f19809f8f",
4-
"RepoTags": [
5-
"quay.io/podman/hello:latest"
6-
],
4+
"RepoTags": ["quay.io/podman/hello:latest"],
75
"RepoDigests": [
86
"quay.io/podman/hello@sha256:41316c18917a27a359ee3191fd8f43559d30592f82a144bbc59d9d44790f6e7a",
97
"quay.io/podman/hello@sha256:43de9874507eaa8ffd88eac885b672b1dfc57cc583d9ad920850f97f19809f8f"
@@ -12,12 +10,8 @@
1210
"Comment": "",
1311
"Created": "2024-05-26T02:17:47.007111495Z",
1412
"Config": {
15-
"Env": [
16-
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
17-
],
18-
"Cmd": [
19-
"/usr/local/bin/podman_hello_world"
20-
],
13+
"Env": ["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"],
14+
"Cmd": ["/usr/local/bin/podman_hello_world"],
2115
"Labels": {
2216
"artist": "Máirín Ní Ḋuḃṫaiġ, X/Twitter:@mairin",
2317
"io.buildah.version": "1.23.1",
@@ -46,9 +40,7 @@
4640
},
4741
"RootFS": {
4842
"Type": "layers",
49-
"Layers": [
50-
"sha256:2114fc8b70586b9325dde6fd26066d9951414dcdfb3995f41d51d1995cf3bd9d"
51-
]
43+
"Layers": ["sha256:2114fc8b70586b9325dde6fd26066d9951414dcdfb3995f41d51d1995cf3bd9d"]
5244
},
5345
"Labels": {
5446
"artist": "Máirín Ní Ḋuḃṫaiġ, X/Twitter:@mairin",
@@ -91,7 +83,5 @@
9183
"created_by": "/bin/sh -c #(nop) CMD [\"/usr/local/bin/podman_hello_world\"]"
9284
}
9385
],
94-
"NamesHistory": [
95-
"quay.io/podman/hello:latest"
96-
]
86+
"NamesHistory": ["quay.io/podman/hello:latest"]
9787
}

packages/podlet-js/src/images/tests/nginx/image-inspect.json

+4-15
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
21
{
32
"Id": "9bea9f2796e236cb18c2b3ad561ff29f655d1001f9ec7247a0bc5e08d25652a1",
43
"Digest": "sha256:2426c815287ed75a3a33dd28512eba4f0f783946844209ccf3fa8990817a4eb9",
5-
"RepoTags": [
6-
"docker.io/library/nginx:latest"
7-
],
4+
"RepoTags": ["docker.io/library/nginx:latest"],
85
"RepoDigests": [
96
"docker.io/library/nginx@sha256:0a399eb16751829e1af26fea27b20c3ec28d7ab1fb72182879dcae1cca21206a",
107
"docker.io/library/nginx@sha256:2426c815287ed75a3a33dd28512eba4f0f783946844209ccf3fa8990817a4eb9"
@@ -24,14 +21,8 @@
2421
"PKG_RELEASE=1~bookworm",
2522
"DYNPKG_RELEASE=1~bookworm"
2623
],
27-
"Entrypoint": [
28-
"/docker-entrypoint.sh"
29-
],
30-
"Cmd": [
31-
"nginx",
32-
"-g",
33-
"daemon off;"
34-
],
24+
"Entrypoint": ["/docker-entrypoint.sh"],
25+
"Cmd": ["nginx", "-g", "daemon off;"],
3526
"Labels": {
3627
"maintainer": "NGINX Docker Maintainers <[email protected]>"
3728
},
@@ -175,7 +166,5 @@
175166
"empty_layer": true
176167
}
177168
],
178-
"NamesHistory": [
179-
"docker.io/library/nginx:latest"
180-
]
169+
"NamesHistory": ["docker.io/library/nginx:latest"]
181170
}

packages/podlet-js/tsconfig.json

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"strict":true,
3+
"strict": true,
44
"target": "esnext",
55
"module": "esnext",
66
"moduleResolution": "Node",
@@ -10,15 +10,11 @@
1010
"allowSyntheticDefaultImports": true,
1111
"isolatedModules": true,
1212
"skipLibCheck": true,
13-
"types": [
14-
"node",
15-
],
13+
"types": ["node"],
1614
"paths": {},
1715
"noImplicitOverride": true,
1816
"noImplicitReturns": true,
19-
"noUnusedLocals": true,
17+
"noUnusedLocals": true
2018
},
21-
"include": [
22-
"src",
23-
],
19+
"include": ["src"]
2420
}

packages/podlet-js/vite.config.js

+4-7
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
*
1616
* SPDX-License-Identifier: Apache-2.0
1717
***********************************************************************/
18-
import {join} from 'path';
19-
import {builtinModules} from 'module';
20-
import dts from 'vite-plugin-dts'
18+
import { join } from 'path';
19+
import { builtinModules } from 'module';
20+
import dts from 'vite-plugin-dts';
2121

2222
const PACKAGE_ROOT = __dirname;
2323

@@ -52,10 +52,7 @@ const config = {
5252
formats: ['cjs'],
5353
},
5454
rollupOptions: {
55-
external: [
56-
'@podman-desktop/api',
57-
...builtinModules.flatMap(p => [p, `node:${p}`]),
58-
],
55+
external: ['@podman-desktop/api', ...builtinModules.flatMap(p => [p, `node:${p}`])],
5956
output: {
6057
entryFileNames: '[name].cjs',
6158
},

packages/podlet-js/vitest.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ const config = {
2727
provider: 'v8',
2828
reporter: ['lcov', 'text'],
2929
},
30-
},
31-
resolve: {
30+
},
31+
resolve: {
3232
alias: {
3333
'@podman-desktop/api': path.resolve(__dirname, '__mocks__/@podman-desktop/api.js'),
3434
'/@/': join(PACKAGE_ROOT, 'src') + '/',

packages/shared/tsconfig.json

+3-9
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,13 @@
22
"compilerOptions": {
33
"target": "esnext",
44
"module": "esnext",
5-
"moduleResolution":"node",
5+
"moduleResolution": "node",
66
"strict": true,
77
"preserveValueImports": false,
88
"skipLibCheck": true,
99
"baseUrl": ".",
1010
"allowJs": true,
11-
"checkJs": true,
11+
"checkJs": true
1212
},
13-
"include": [
14-
"src/**/*.d.ts",
15-
"src/**/*.ts",
16-
"src/**/*.js",
17-
"types/*.d.ts",
18-
"../../types/**/*.d.ts",
19-
]
13+
"include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.js", "types/*.d.ts", "../../types/**/*.d.ts"]
2014
}

packages/shared/vite.config.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {join} from 'path';
2-
import {builtinModules} from 'module';
1+
import { join } from 'path';
2+
import { builtinModules } from 'module';
33

44
const PACKAGE_ROOT = __dirname;
55

@@ -27,10 +27,7 @@ const config = {
2727
formats: ['cjs'],
2828
},
2929
rollupOptions: {
30-
external: [
31-
'@podman-desktop/api',
32-
...builtinModules.flatMap(p => [p, `node:${p}`]),
33-
],
30+
external: ['@podman-desktop/api', ...builtinModules.flatMap(p => [p, `node:${p}`])],
3431
output: {
3532
entryFileNames: '[name].js',
3633
},

packages/shared/vitest.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const PACKAGE_ROOT = __dirname;
55

66
const config = {
77
test: {
8-
include: ['**/*.{test,spec}.?(c|m)[jt]s?(x)', '../shared/**/*.{test,spec}.?(c|m)[jt]s?(x)']
8+
include: ['**/*.{test,spec}.?(c|m)[jt]s?(x)', '../shared/**/*.{test,spec}.?(c|m)[jt]s?(x)'],
99
},
1010
resolve: {
1111
alias: {

0 commit comments

Comments
 (0)