Skip to content

Commit 1a754a8

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 bb0f892 commit 1a754a8

15 files changed

Lines changed: 54 additions & 44 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
@@ -12,8 +12,10 @@ import { injectExportsOrderPlugin } from './injectExportsOrderPlugin.ts';
1212

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

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

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

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ export interface DevServerCliArgs
1414
| 'watch'
1515
| 'esbuildTarget'
1616
>
17-
> {
18-
config?: string;
17+
> { config?: string;
1918
}
2019

2120
const options: (OptionDefinition & { description: string })[] = [

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)