Skip to content

Commit d7b44b2

Browse files
committed
fix: update prettier script paths for v3 and format files
prettier v3 no longer has bin-prettier.js. Use npx prettier instead. Format files that were changed but not auto-formatted. Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 74c322d commit d7b44b2

15 files changed

Lines changed: 77 additions & 73 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
"dev-to-git": "dev-to-git",
1919
"format": "npm run format:eslint && npm run format:prettier",
2020
"format:eslint": "eslint --ext .ts,.js,.mjs,.cjs . --fix",
21-
"format:prettier": "node node_modules/prettier/bin-prettier.js \"**/*.{ts,js,mjs,cjs,md}\" \"**/package.json\" --write --ignore-path .eslintignore",
21+
"format:prettier": "npx prettier \"**/*.{ts,js,mjs,cjs,md}\" \"**/package.json\" --write --ignore-path .eslintignore",
2222
"install-puppeteer-firefox": "cd node_modules/puppeteer && PUPPETEER_BROWSER=firefox node install.js",
2323
"lint": "npm run lint:eslint && npm run lint:prettier",
2424
"lint:eslint": "eslint --ext .ts,.js,.mjs,.cjs .",
25-
"lint:prettier": "node node_modules/prettier/bin-prettier.js \"**/*.{ts,js,mjs,cjs,md}\" --check --ignore-path .eslintignore",
25+
"lint:prettier": "npx prettier \"**/*.{ts,js,mjs,cjs,md}\" --check --ignore-path .eslintignore",
2626
"prepare": "husky",
2727
"reinstall-workspace": "rimraf --glob packages/*/node_modules && rimraf node_modules && npm install && npm run build",
2828
"release": "changeset publish && npm run format",

packages/dev-server-core/src/dom5/modification.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ function insertNode(parent: any, index: number, newNode: any, replace?: boolean)
9999
removedNode = parent.childNodes[index];
100100
}
101101

102-
Array.prototype.splice.apply(parent.childNodes, ([index, replace ? 1 : 0] as any).concat(newNodes));
102+
Array.prototype.splice.apply(
103+
parent.childNodes,
104+
([index, replace ? 1 : 0] as any).concat(newNodes),
105+
);
103106

104107
newNodes.forEach(function (n) {
105108
n.parentNode = parent;

packages/dev-server-core/src/logger/PluginSyntaxError.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@ export class PluginSyntaxError extends Error {
55
public line: number;
66
public column: number;
77

8-
constructor(
9-
message: string,
10-
filePath: string,
11-
code: string,
12-
line: number,
13-
column: number,
14-
) {
8+
constructor(message: string, filePath: string, code: string, line: number, column: number) {
159
super(message);
1610
this.message = message;
1711
this.filePath = filePath;

packages/dev-server-storybook/src/build/rollup/createRollupConfig.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ import { injectExportsOrderPlugin } from './injectExportsOrderPlugin.ts';
1313

1414
const resolveFile = (specifier: string) => fileURLToPath(import.meta.resolve(specifier));
1515

16-
const prebuiltDir = resolveFile('@web/storybook-prebuilt/package.json')
17-
.replace('/package.json', '');
16+
const prebuiltDir = resolveFile('@web/storybook-prebuilt/package.json').replace(
17+
'/package.json',
18+
'',
19+
);
1820

1921
const ignoredWarnings = ['EVAL', 'THIS_IS_UNDEFINED'];
2022

packages/dev-server/src/config/readCliArgs.ts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,12 @@ import commandLineUsage, { OptionDefinition } from 'command-line-usage';
33
import camelCase from 'camelcase';
44
import { DevServerConfig } from './DevServerConfig.ts';
55

6-
export interface DevServerCliArgs
7-
extends Partial<
8-
Pick<
9-
DevServerConfig,
10-
| 'rootDir'
11-
| 'open'
12-
| 'appIndex'
13-
| 'preserveSymlinks'
14-
| 'nodeResolve'
15-
| 'watch'
16-
| 'esbuildTarget'
17-
>
18-
> {
6+
export interface DevServerCliArgs extends Partial<
7+
Pick<
8+
DevServerConfig,
9+
'rootDir' | 'open' | 'appIndex' | 'preserveSymlinks' | 'nodeResolve' | 'watch' | 'esbuildTarget'
10+
>
11+
> {
1912
config?: string;
2013
}
2114

packages/mocks/storybook/addon/register-addon.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ export function registerAddon(addons, types, React, createAddon) {
116116
</td>
117117
<td>
118118
<textarea aria-label="Response" name="response-${i}" .value=${
119-
JSON.stringify(data) ?? ''
120-
}></textarea>
119+
JSON.stringify(data) ?? ''
120+
}></textarea>
121121
</td>
122122
<td>
123123
<input type="number" aria-label="Status code" name="status-${i}" .value=${
124-
status ?? ''
125-
}></input>
124+
status ?? ''
125+
}></input>
126126
</td>
127127
`,
128128
() => html`

packages/polyfills-loader/src/createPolyfillsData.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,7 @@ export async function createPolyfillsData(cfg: PolyfillsLoaderConfig): Promise<P
158158
addPolyfillConfig({
159159
name: 'scoped-custom-element-registry',
160160
test: "!('createElement' in ShadowRoot.prototype)",
161-
path: require.resolve(
162-
'@webcomponents/scoped-custom-element-registry/scoped-custom-element-registry.min.js',
163-
),
161+
path: require.resolve('@webcomponents/scoped-custom-element-registry/scoped-custom-element-registry.min.js'),
164162
});
165163
}
166164

packages/rollup-plugin-html/src/RollupPluginHTMLOptions.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { OutputChunk, OutputOptions, OutputBundle } from 'rollup';
22
import type { Attribute } from 'parse5';
33

4-
54
export interface InputHTMLOptions {
65
/** The html source code. If set, overwrites path. */
76
html?: string;

packages/rollup-plugin-html/src/output/emitAssets.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import fs from 'fs';
55

66
import type { InputAsset, InputData } from '../input/InputData.ts';
77
import { createAssetPicomatchMatcher } from '../assets/utils.ts';
8-
import type { RollupPluginHTMLOptions, TransformAssetFunction } from '../RollupPluginHTMLOptions.ts';
8+
import type {
9+
RollupPluginHTMLOptions,
10+
TransformAssetFunction,
11+
} from '../RollupPluginHTMLOptions.ts';
912

1013
export interface EmittedAssets {
1114
static: Map<string, string>;

packages/rollup-plugin-import-meta-assets/test/integration.test.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,8 @@ describe('rollup-plugin-import-meta-assets', () => {
137137
it('multiple level bundle (upward modules)', async () => {
138138
const config = {
139139
input: {
140-
'multi-level-bundle': require.resolve(
141-
'./fixtures/one/two/three/four/multi-level-entrypoint-deep.js',
142-
),
140+
'multi-level-bundle':
141+
require.resolve('./fixtures/one/two/three/four/multi-level-entrypoint-deep.js'),
143142
},
144143
plugins: [importMetaAssets()],
145144
};
@@ -159,9 +158,8 @@ describe('rollup-plugin-import-meta-assets', () => {
159158
it('different asset levels', async () => {
160159
const config = {
161160
input: {
162-
'different-asset-levels-bundle': require.resolve(
163-
'./fixtures/one/two/different-asset-levels-entrypoint.js',
164-
),
161+
'different-asset-levels-bundle':
162+
require.resolve('./fixtures/one/two/different-asset-levels-entrypoint.js'),
165163
},
166164
plugins: [importMetaAssets()],
167165
};

0 commit comments

Comments
 (0)