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

pull/2433/head
Tony 3 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,
"semi": false,
"trailingComma": "none"
"trailingComma": "none",
"experimentalOperatorPosition": "start"
}

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save