Skip to content

Commit c5da9d2

Browse files
chore: update prettier to 3.5.1 and enable experimentalOperatorPosition (#2427)
1 parent 7a54959 commit c5da9d2

File tree

10 files changed

+43
-41
lines changed

10 files changed

+43
-41
lines changed

.prettierrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"singleQuote": true,
33
"semi": false,
4-
"trailingComma": "none"
4+
"trailingComma": "none",
5+
"experimentalOperatorPosition": "start"
56
}

.scripts/ci/check-license-header.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ const ignore = [
3232

3333
async function checkFile(file) {
3434
if (
35-
extensions.some((e) => file.endsWith(e)) &&
36-
!ignore.some((i) => file.includes(`${path.sep}${i}`))
35+
extensions.some((e) => file.endsWith(e))
36+
&& !ignore.some((i) => file.includes(`${path.sep}${i}`))
3737
) {
3838
const fileStream = fs.createReadStream(file)
3939
const rl = readline.createInterface({
@@ -46,10 +46,10 @@ async function checkFile(file) {
4646
for await (let line of rl) {
4747
// ignore empty lines, allow shebang, swift-tools-version and bundler license
4848
if (
49-
line.length === 0 ||
50-
line.startsWith('#!') ||
51-
line.startsWith('// swift-tools-version:') ||
52-
ignoredLicenses.includes(line)
49+
line.length === 0
50+
|| line.startsWith('#!')
51+
|| line.startsWith('// swift-tools-version:')
52+
|| ignoredLicenses.includes(line)
5353
) {
5454
continue
5555
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"eslint": "9.19.0",
2121
"eslint-config-prettier": "10.0.1",
2222
"eslint-plugin-security": "3.0.1",
23-
"prettier": "3.4.2",
23+
"prettier": "3.5.1",
2424
"rollup": "4.34.7",
2525
"tslib": "2.8.1",
2626
"typescript": "5.7.3",

plugins/fs/guest-js/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -604,8 +604,8 @@ async function copyFile(
604604
options?: CopyFileOptions
605605
): Promise<void> {
606606
if (
607-
(fromPath instanceof URL && fromPath.protocol !== 'file:') ||
608-
(toPath instanceof URL && toPath.protocol !== 'file:')
607+
(fromPath instanceof URL && fromPath.protocol !== 'file:')
608+
|| (toPath instanceof URL && toPath.protocol !== 'file:')
609609
) {
610610
throw new TypeError('Must be a file URL.')
611611
}
@@ -919,8 +919,8 @@ async function rename(
919919
options?: RenameOptions
920920
): Promise<void> {
921921
if (
922-
(oldPath instanceof URL && oldPath.protocol !== 'file:') ||
923-
(newPath instanceof URL && newPath.protocol !== 'file:')
922+
(oldPath instanceof URL && oldPath.protocol !== 'file:')
923+
|| (newPath instanceof URL && newPath.protocol !== 'file:')
924924
) {
925925
throw new TypeError('Must be a file URL.')
926926
}

plugins/geolocation/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ import {
118118

119119
let permissions = await checkPermissions()
120120
if (
121-
permissions.location === 'prompt' ||
122-
permissions.location === 'prompt-with-rationale'
121+
permissions.location === 'prompt'
122+
|| permissions.location === 'prompt-with-rationale'
123123
) {
124124
permissions = await requestPermissions(['location'])
125125
}

plugins/nfc/guest-js/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ function encodeURI(uri: string): number[] {
181181

182182
protocols.slice(1).forEach(function (protocol) {
183183
if (
184-
(prefix.length === 0 || prefix === 'urn:') &&
185-
uri.indexOf(protocol) === 0
184+
(prefix.length === 0 || prefix === 'urn:')
185+
&& uri.indexOf(protocol) === 0
186186
) {
187187
prefix = protocol
188188
}

plugins/opener/guest-js/init.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ window.addEventListener('click', function (evt) {
99
// return early if
1010
if (
1111
// event was prevented
12-
evt.defaultPrevented ||
12+
evt.defaultPrevented
1313
// or not a left click
14-
evt.button !== 0 ||
14+
|| evt.button !== 0
1515
// or meta key pressed
16-
evt.metaKey ||
16+
|| evt.metaKey
1717
// or al key pressed
18-
evt.altKey
18+
|| evt.altKey
1919
)
2020
return
2121

@@ -28,16 +28,16 @@ window.addEventListener('click', function (evt) {
2828
// return early if
2929
if (
3030
// not tirggered from <a> element
31-
!a ||
31+
!a
3232
// or doesn't have a href
33-
!a.href ||
33+
|| !a.href
3434
// or not supposed to be open in a new tab
35-
!(
36-
a.target === '_blank' ||
35+
|| !(
36+
a.target === '_blank'
3737
// or ctrl key pressed
38-
evt.ctrlKey ||
38+
|| evt.ctrlKey
3939
// or shift key pressed
40-
evt.shiftKey
40+
|| evt.shiftKey
4141
)
4242
)
4343
return
@@ -47,9 +47,9 @@ window.addEventListener('click', function (evt) {
4747
// return early if
4848
if (
4949
// same origin (internal navigation)
50-
url.origin === window.location.origin ||
50+
url.origin === window.location.origin
5151
// not default protocols
52-
['http:', 'https:', 'mailto:', 'tel:'].every((p) => url.protocol !== p)
52+
|| ['http:', 'https:', 'mailto:', 'tel:'].every((p) => url.protocol !== p)
5353
)
5454
return
5555

plugins/shell/guest-js/init.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ function openLinks(): void {
1212
if (target.matches('a')) {
1313
const t = target as HTMLAnchorElement
1414
if (
15-
t.href !== '' &&
16-
['http://', 'https://', 'mailto:', 'tel:'].some((v) =>
15+
t.href !== ''
16+
&& ['http://', 'https://', 'mailto:', 'tel:'].some((v) =>
1717
t.href.startsWith(v)
18-
) &&
19-
t.target === '_blank'
18+
)
19+
&& t.target === '_blank'
2020
) {
2121
void invoke('plugin:shell|open', {
2222
path: t.href
@@ -31,8 +31,8 @@ function openLinks(): void {
3131
}
3232

3333
if (
34-
document.readyState === 'complete' ||
35-
document.readyState === 'interactive'
34+
document.readyState === 'complete'
35+
|| document.readyState === 'interactive'
3636
) {
3737
openLinks()
3838
} else {

plugins/websocket/examples/tauri-app/src/style.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ body {
1010
margin: 0;
1111
padding: 8px;
1212
box-sizing: border-box;
13-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
14-
Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
13+
font-family:
14+
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu,
15+
Cantarell, 'Helvetica Neue', sans-serif;
1516
}
1617

1718
a {

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)