diff --git a/package-lock.json b/package-lock.json index c9ea8f9a..3ba145f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,7 +46,7 @@ "eslint-plugin-no-only-tests": "^3.1.0", "google_modes": "git+https://github.com/codemirror/google-modes.git#247b63cee78b3775f8a3173184bf706c5b006d25", "playwright": "^1.46.1", - "prettier": "^2.0.5", + "prettier": "^3.2.2", "rollup": "^3.2.5", "rollup-plugin-copy": "^3.3.0", "rollup-plugin-lit-css": "^4.0.0", @@ -7229,15 +7229,15 @@ } }, "node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "dev": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" diff --git a/package.json b/package.json index 53124652..976a1ab7 100755 --- a/package.json +++ b/package.json @@ -289,7 +289,7 @@ "eslint-plugin-no-only-tests": "^3.1.0", "google_modes": "git+https://github.com/codemirror/google-modes.git#247b63cee78b3775f8a3173184bf706c5b006d25", "playwright": "^1.46.1", - "prettier": "^2.0.5", + "prettier": "^3.2.2", "rollup": "^3.2.5", "rollup-plugin-copy": "^3.3.0", "rollup-plugin-lit-css": "^4.0.0", diff --git a/playground-styles.css b/playground-styles.css index 3003b222..5f4cb383 100644 --- a/playground-styles.css +++ b/playground-styles.css @@ -383,8 +383,10 @@ div.CodeMirror-dragcursors { margin: 0; padding: 0; - box-shadow: rgba(0, 0, 0, 0.2) 0px 5px 5px -3px, - rgba(0, 0, 0, 0.14) 0px 8px 10px 1px, rgba(0, 0, 0, 0.12) 0px 3px 14px 2px; + box-shadow: + rgba(0, 0, 0, 0.2) 0px 5px 5px -3px, + rgba(0, 0, 0, 0.14) 0px 8px 10px 1px, + rgba(0, 0, 0, 0.12) 0px 3px 14px 2px; border: 1px solid var(--playground-code-selection-background, silver); background: var(--playground-code-background, white); diff --git a/scripts/theme-generator.js b/scripts/theme-generator.js index 35fb320c..5d755e13 100644 --- a/scripts/theme-generator.js +++ b/scripts/theme-generator.js @@ -32,7 +32,7 @@ import CleanCSS from 'clean-css'; const rootDir = pathlib.resolve( pathlib.dirname(url.fileURLToPath(import.meta.url)), - '..' + '..', ); const mkdirAndWriteUtf8 = async (path, data) => { @@ -63,7 +63,7 @@ const postMinifyCss = (css) => { // most of it. css = css.replace( / none repeat scroll 0% 0%\s*\/\s*auto padding-box border-box/g, - '' + '', ); // The computed value of a `border` property includes all values even when // width is 0. We can strip off the rest when width is 0. @@ -73,12 +73,12 @@ const postMinifyCss = (css) => { const makeThemeCss = (themeName, results, defaultResults) => { const excludeDefaults = Object.values(results).filter( - (r) => defaultResults[r.to].value !== r.value + (r) => defaultResults[r.to].value !== r.value, ); return postMinifyCss( minifyCss(`.playground-theme-${themeName} { ${excludeDefaults.map(({to, value}) => ` ${to}: ${value};`).join('\n')} -}`) +}`), ); }; @@ -121,7 +121,7 @@ const main = async () => { ]); const themeFilenames = fs .readdirSync( - pathlib.resolve(rootDir, 'node_modules', 'codemirror', 'theme') + pathlib.resolve(rootDir, 'node_modules', 'codemirror', 'theme'), ) .filter((name) => !excludeThemes.has(name)); const themeNames = []; @@ -131,17 +131,17 @@ const main = async () => { const styleUrl = `/node_modules/codemirror/theme/${filename}`; const results = await page.evaluate( ([themeName, styleUrl]) => window.probe(themeName, styleUrl), - [themeName, styleUrl] + [themeName, styleUrl], ); const css = makeThemeCss(themeName, results, defaultResults); writes.push( - mkdirAndWriteUtf8(pathlib.join(rootDir, 'themes', filename), css) + mkdirAndWriteUtf8(pathlib.join(rootDir, 'themes', filename), css), ); writes.push( mkdirAndWriteUtf8( pathlib.join(rootDir, 'src', 'themes', `${filename}.ts`), - makeCssModule(css) - ) + makeCssModule(css), + ), ); } @@ -156,8 +156,8 @@ ${themeNames (themeName) => `import t${themeName.replace( /-/g, - '_' - )} from '../themes/${themeName}.css.js';` + '_', + )} from '../themes/${themeName}.css.js';`, ) .join('\n')} @@ -171,8 +171,8 @@ ${themeNames writes.push( mkdirAndWriteUtf8( pathlib.join(rootDir, 'src', 'configurator', 'themes.ts'), - allThemesTs - ) + allThemesTs, + ), ); await Promise.all([browser.close(), server.stop(), ...writes]); diff --git a/scripts/update-version-module.js b/scripts/update-version-module.js index 03c16437..b622722a 100644 --- a/scripts/update-version-module.js +++ b/scripts/update-version-module.js @@ -39,7 +39,7 @@ const getServiceWorkerHash = async () => { if (matches.length !== 1) { throw new Error( 'Expected exactly one version string in playground-service-worker.js. ' + - `Found ${matches.length}.` + `Found ${matches.length}.`, ); } // We must remove the version string itself from the service worker code @@ -79,7 +79,7 @@ const oldVersionModuleCode = await fs.readFile(versionModulePath, 'utf8'); if (oldVersionModuleCode !== newVersionModuleCode) { await fs.writeFile(versionModulePath, newVersionModuleCode, 'utf8'); console.log( - 'Updated src/shared/version.ts, please commit this change and rebuild.' + 'Updated src/shared/version.ts, please commit this change and rebuild.', ); // Fail to help the publisher remember to commit. process.exit(1); diff --git a/src/configurator/knobs.ts b/src/configurator/knobs.ts index dc188d7a..f92254f7 100644 --- a/src/configurator/knobs.ts +++ b/src/configurator/knobs.ts @@ -48,25 +48,25 @@ interface SelectKnob } function checkbox( - def: Omit, 'type'> + def: Omit, 'type'>, ): CheckboxKnob { return {type: 'checkbox', ...def}; } function slider( - def: Omit, 'type'> + def: Omit, 'type'>, ): SliderKnob { return {type: 'slider', ...def}; } function color( - def: Omit, 'type'> + def: Omit, 'type'>, ): ColorKnob { return {type: 'color', ...def}; } function select( - def: Omit, 'type'> + def: Omit, 'type'>, ): SelectKnob { return {type: 'select', ...def}; } diff --git a/src/configurator/playground-configurator.ts b/src/configurator/playground-configurator.ts index 9fc811e1..c472161f 100644 --- a/src/configurator/playground-configurator.ts +++ b/src/configurator/playground-configurator.ts @@ -369,7 +369,7 @@ export class PlaygroundConfigurator extends LitElement {
${knobsBySection[section].map((knob) => this.knob(knob))}
- ` + `, ); } @@ -489,7 +489,7 @@ ${props.join('\n')} (option) => html`` + `, )} `; @@ -570,7 +570,7 @@ ${props.join('\n')} } private async _onThemeDetectorApply( - event: CustomEvent<{properties: Map}> + event: CustomEvent<{properties: Map}>, ) { // eslint-disable-next-line @typescript-eslint/no-explicit-any const values = new Map(); @@ -670,7 +670,7 @@ const githubCorner = html` { const match = rgbStr.match( - /^\s*rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/ + /^\s*rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/, ); if (!match) { return ''; diff --git a/src/configurator/playground-theme-detector.ts b/src/configurator/playground-theme-detector.ts index 4a239bca..dc352b13 100644 --- a/src/configurator/playground-theme-detector.ts +++ b/src/configurator/playground-theme-detector.ts @@ -158,7 +158,7 @@ export class PlaygroundThemeDetector extends LitElement { class="color" title=${prop} style="background:${color ?? 'transparent'}" - >` + >`, )} @@ -166,7 +166,7 @@ export class PlaygroundThemeDetector extends LitElement {