chore: update prettier to 3.5.1 and enable `experimentalOperatorPosition` (#2427)

pull/2433/head
Tony 4 months ago committed by GitHub
parent 7a5495963b
commit c5da9d2579
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,5 +1,6 @@
{ {
"singleQuote": true, "singleQuote": true,
"semi": false, "semi": false,
"trailingComma": "none" "trailingComma": "none",
"experimentalOperatorPosition": "start"
} }

@ -32,8 +32,8 @@ const ignore = [
async function checkFile(file) { async function checkFile(file) {
if ( if (
extensions.some((e) => file.endsWith(e)) && extensions.some((e) => file.endsWith(e))
!ignore.some((i) => file.includes(`${path.sep}${i}`)) && !ignore.some((i) => file.includes(`${path.sep}${i}`))
) { ) {
const fileStream = fs.createReadStream(file) const fileStream = fs.createReadStream(file)
const rl = readline.createInterface({ const rl = readline.createInterface({
@ -46,10 +46,10 @@ async function checkFile(file) {
for await (let line of rl) { for await (let line of rl) {
// ignore empty lines, allow shebang, swift-tools-version and bundler license // ignore empty lines, allow shebang, swift-tools-version and bundler license
if ( if (
line.length === 0 || line.length === 0
line.startsWith('#!') || || line.startsWith('#!')
line.startsWith('// swift-tools-version:') || || line.startsWith('// swift-tools-version:')
ignoredLicenses.includes(line) || ignoredLicenses.includes(line)
) { ) {
continue continue
} }

@ -20,7 +20,7 @@
"eslint": "9.19.0", "eslint": "9.19.0",
"eslint-config-prettier": "10.0.1", "eslint-config-prettier": "10.0.1",
"eslint-plugin-security": "3.0.1", "eslint-plugin-security": "3.0.1",
"prettier": "3.4.2", "prettier": "3.5.1",
"rollup": "4.34.7", "rollup": "4.34.7",
"tslib": "2.8.1", "tslib": "2.8.1",
"typescript": "5.7.3", "typescript": "5.7.3",

@ -604,8 +604,8 @@ async function copyFile(
options?: CopyFileOptions options?: CopyFileOptions
): Promise<void> { ): Promise<void> {
if ( if (
(fromPath instanceof URL && fromPath.protocol !== 'file:') || (fromPath instanceof URL && fromPath.protocol !== 'file:')
(toPath instanceof URL && toPath.protocol !== 'file:') || (toPath instanceof URL && toPath.protocol !== 'file:')
) { ) {
throw new TypeError('Must be a file URL.') throw new TypeError('Must be a file URL.')
} }
@ -919,8 +919,8 @@ async function rename(
options?: RenameOptions options?: RenameOptions
): Promise<void> { ): Promise<void> {
if ( if (
(oldPath instanceof URL && oldPath.protocol !== 'file:') || (oldPath instanceof URL && oldPath.protocol !== 'file:')
(newPath instanceof URL && newPath.protocol !== 'file:') || (newPath instanceof URL && newPath.protocol !== 'file:')
) { ) {
throw new TypeError('Must be a file URL.') throw new TypeError('Must be a file URL.')
} }

@ -118,8 +118,8 @@ import {
let permissions = await checkPermissions() let permissions = await checkPermissions()
if ( if (
permissions.location === 'prompt' || permissions.location === 'prompt'
permissions.location === 'prompt-with-rationale' || permissions.location === 'prompt-with-rationale'
) { ) {
permissions = await requestPermissions(['location']) permissions = await requestPermissions(['location'])
} }

@ -181,8 +181,8 @@ function encodeURI(uri: string): number[] {
protocols.slice(1).forEach(function (protocol) { protocols.slice(1).forEach(function (protocol) {
if ( if (
(prefix.length === 0 || prefix === 'urn:') && (prefix.length === 0 || prefix === 'urn:')
uri.indexOf(protocol) === 0 && uri.indexOf(protocol) === 0
) { ) {
prefix = protocol prefix = protocol
} }

@ -9,13 +9,13 @@ window.addEventListener('click', function (evt) {
// return early if // return early if
if ( if (
// event was prevented // event was prevented
evt.defaultPrevented || evt.defaultPrevented
// or not a left click // or not a left click
evt.button !== 0 || || evt.button !== 0
// or meta key pressed // or meta key pressed
evt.metaKey || || evt.metaKey
// or al key pressed // or al key pressed
evt.altKey || evt.altKey
) )
return return
@ -28,16 +28,16 @@ window.addEventListener('click', function (evt) {
// return early if // return early if
if ( if (
// not tirggered from <a> element // not tirggered from <a> element
!a || !a
// or doesn't have a href // or doesn't have a href
!a.href || || !a.href
// or not supposed to be open in a new tab // or not supposed to be open in a new tab
!( || !(
a.target === '_blank' || a.target === '_blank'
// or ctrl key pressed // or ctrl key pressed
evt.ctrlKey || || evt.ctrlKey
// or shift key pressed // or shift key pressed
evt.shiftKey || evt.shiftKey
) )
) )
return return
@ -47,9 +47,9 @@ window.addEventListener('click', function (evt) {
// return early if // return early if
if ( if (
// same origin (internal navigation) // same origin (internal navigation)
url.origin === window.location.origin || url.origin === window.location.origin
// not default protocols // not default protocols
['http:', 'https:', 'mailto:', 'tel:'].every((p) => url.protocol !== p) || ['http:', 'https:', 'mailto:', 'tel:'].every((p) => url.protocol !== p)
) )
return return

@ -12,11 +12,11 @@ function openLinks(): void {
if (target.matches('a')) { if (target.matches('a')) {
const t = target as HTMLAnchorElement const t = target as HTMLAnchorElement
if ( if (
t.href !== '' && t.href !== ''
['http://', 'https://', 'mailto:', 'tel:'].some((v) => && ['http://', 'https://', 'mailto:', 'tel:'].some((v) =>
t.href.startsWith(v) t.href.startsWith(v)
) && )
t.target === '_blank' && t.target === '_blank'
) { ) {
void invoke('plugin:shell|open', { void invoke('plugin:shell|open', {
path: t.href path: t.href
@ -31,8 +31,8 @@ function openLinks(): void {
} }
if ( if (
document.readyState === 'complete' || document.readyState === 'complete'
document.readyState === 'interactive' || document.readyState === 'interactive'
) { ) {
openLinks() openLinks()
} else { } else {

@ -10,8 +10,9 @@ body {
margin: 0; margin: 0;
padding: 8px; padding: 8px;
box-sizing: border-box; box-sizing: border-box;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, font-family:
Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu,
Cantarell, 'Helvetica Neue', sans-serif;
} }
a { a {

@ -40,8 +40,8 @@ importers:
specifier: 3.0.1 specifier: 3.0.1
version: 3.0.1 version: 3.0.1
prettier: prettier:
specifier: 3.4.2 specifier: 3.5.1
version: 3.4.2 version: 3.5.1
rollup: rollup:
specifier: 4.34.7 specifier: 4.34.7
version: 4.34.7 version: 4.34.7
@ -1990,8 +1990,8 @@ packages:
resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
engines: {node: '>= 0.8.0'} engines: {node: '>= 0.8.0'}
prettier@3.4.2: prettier@3.5.1:
resolution: {integrity: sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==} resolution: {integrity: sha512-hPpFQvHwL3Qv5AdRvBFMhnKo4tYxp0ReXiPn2bxkiohEX6mBeBwEpBSQTkD458RaaDKQMYSp4hX4UtfUTA5wDw==}
engines: {node: '>=14'} engines: {node: '>=14'}
hasBin: true hasBin: true
@ -4079,7 +4079,7 @@ snapshots:
prelude-ls@1.2.1: {} prelude-ls@1.2.1: {}
prettier@3.4.2: {} prettier@3.5.1: {}
process-warning@4.0.0: {} process-warning@4.0.0: {}

Loading…
Cancel
Save