Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meta: prettier 3.0.3 -> 3.2.4 #4889

Merged
merged 6 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions .vscode/uppy.code-workspace
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{
"folders": [
{
"path": ".."
}
],
"settings": {
"workbench.colorCustomizations": {
"titleBar.activeForeground": "#ffffff",
"titleBar.activeBackground": "#ff009d",
},
"search.exclude": {
"website/public/": true,
"node_modules/": true,
"website/node_modules/": true,
"dist/": true,
"lib/": true,
"package-lock.json": true,
"website/package-lock.json": true,
"yarn-error.log": true,
"website/.deploy_git": true,
"npm-debug.log": true,
"website/npm-debug.log": true,
"website/debug.log": true,
"nohup.out": true,
"yarn.lock": true
}
}
"folders": [
{
"path": "..",
},
],
"settings": {
"workbench.colorCustomizations": {
"titleBar.activeForeground": "#ffffff",
"titleBar.activeBackground": "#ff009d",
},
"search.exclude": {
"website/public/": true,
"node_modules/": true,
"website/node_modules/": true,
"dist/": true,
"lib/": true,
"package-lock.json": true,
"website/package-lock.json": true,
"yarn-error.log": true,
"website/.deploy_git": true,
"npm-debug.log": true,
"website/npm-debug.log": true,
"website/debug.log": true,
"nohup.out": true,
"yarn.lock": true,
},
},
}
4 changes: 2 additions & 2 deletions e2e/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"noEmit": true,
"target": "es2020",
"lib": ["es2020", "dom"],
"types": ["cypress"]
"types": ["cypress"],
},
"include": ["cypress/**/*.ts"]
"include": ["cypress/**/*.ts"],
}
4 changes: 2 additions & 2 deletions examples/angular-example/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -717,8 +717,8 @@ <h2>Next Steps</h2>
<!-- Terminal -->
<div class="terminal" [ngSwitch]="selection.value">
<pre *ngSwitchDefault>ng generate component xyz</pre>
<pre *ngSwitchCase="'material'">ng add @angular/material</pre>
<pre *ngSwitchCase="'pwa'">ng add @angular/pwa</pre>
<pre *ngSwitchCase="'material'">ng add &#64;angular/material</pre>
<pre *ngSwitchCase="'pwa'">ng add &#64;angular/pwa</pre>
<pre *ngSwitchCase="'dependency'">ng add _____</pre>
<pre *ngSwitchCase="'test'">ng test</pre>
<pre *ngSwitchCase="'build'">ng build</pre>
Expand Down
6 changes: 3 additions & 3 deletions examples/angular-example/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
"target": "ES2022",
"module": "ES2022",
"useDefineForClassFields": false,
"lib": ["ES2022", "dom"]
"lib": ["ES2022", "dom"],
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
"strictTemplates": true,
},
}
2 changes: 1 addition & 1 deletion examples/svelte-example/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"compilerOptions": {},
"esModuleInterop": true,
"include": ["src/**/*"],
"exclude": ["node_modules/*", "__sapper__/*", "public/*"]
"exclude": ["node_modules/*", "__sapper__/*", "public/*"],
}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"*.{js,mjs,cjs,jsx}": "eslint --fix",
"*.{ts,mts,cts,tsx}": [
"eslint --fix",
"prettier -w",
"prettier --experimental-ternaries -w",
"eslint"
],
"*.{css,html,json,scss,vue,yaml,yml}": "prettier -w",
"*.{css,html,json,scss,vue,yaml,yml}": "prettier --experimental-ternaries -w",
"*.md": [
"remark --silently-ignore -i .remarkignore -foq",
"eslint --fix"
Expand Down Expand Up @@ -135,10 +135,10 @@
"lint:css": "stylelint ./packages/**/*.scss",
"lint:css:fix": "stylelint ./packages/**/*.scss --fix",
"lint": "eslint . --cache",
"format:show-diff": "git diff --quiet || (echo 'Unable to show a diff because there are unstaged changes'; false) && (prettier . -w --loglevel silent && git --no-pager diff; git restore .)",
"format:check": "prettier -c .",
"format:show-diff": "git diff --quiet || (echo 'Unable to show a diff because there are unstaged changes'; false) && (prettier . --experimental-ternaries -w --loglevel silent && git --no-pager diff; git restore .)",
"format:check": "prettier --experimental-ternaries -c .",
"format:check-diff": "yarn format:check || (yarn format:show-diff && false)",
"format": "prettier -w .",
"format": "prettier --experimental-ternaries -w .",
"release": "PACKAGES=$(yarn workspaces list --json) yarn workspace @uppy-dev/release interactive",
"size": "echo 'JS Bundle mingz:' && cat ./packages/uppy/dist/uppy.min.js | gzip | wc -c && echo 'CSS Bundle mingz:' && cat ./packages/uppy/dist/uppy.min.css | gzip | wc -c",
"e2e": "yarn build:clean && yarn build && yarn e2e:skip-build",
Expand Down
8 changes: 4 additions & 4 deletions packages/@uppy/angular/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compileOnSave": false,
"compilerOptions": {
"paths": {
"@uppy/angular": ["dist/uppy/angular"]
"@uppy/angular": ["dist/uppy/angular"],
},
"baseUrl": "./",
"outDir": "./dist/out-tsc",
Expand All @@ -22,12 +22,12 @@
"target": "ES2022",
"module": "ES2022",
"useDefineForClassFields": false,
"lib": ["ES2022", "dom"]
"lib": ["ES2022", "dom"],
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
"strictTemplates": true,
},
}
6 changes: 3 additions & 3 deletions packages/@uppy/audio/src/PermissionsScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export default (props: PermissionsScreenProps): JSX.Element => {
{hasAudio ? i18n('allowAudioAccessTitle') : i18n('noAudioTitle')}
</h1>
<p>
{hasAudio
? i18n('allowAudioAccessDescription')
: i18n('noAudioDescription')}
{hasAudio ?
i18n('allowAudioAccessDescription')
: i18n('noAudioDescription')}
</p>
</div>
)
Expand Down
6 changes: 2 additions & 4 deletions packages/@uppy/audio/src/RecordingScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,9 @@ export default function RecordingScreen(
return (
<div className="uppy-Audio-container">
<div className="uppy-Audio-audioContainer">
{hasRecordedAudio ? (
{hasRecordedAudio ?
<audio className="uppy-Audio-player" controls src={recordedAudio} />
) : (
<canvas ref={canvasEl} className="uppy-Audio-canvas" />
)}
: <canvas ref={canvasEl} className="uppy-Audio-canvas" />}
</div>
<div className="uppy-Audio-footer">
<div className="uppy-Audio-audioSourceContainer">
Expand Down
8 changes: 5 additions & 3 deletions packages/@uppy/audio/src/audio-oscilloscope/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ export default class AudioOscilloscope {
this.canvasContext.strokeStyle =
result(canvasContextOptions.strokeStyle) || 'rgb(0, 0, 0)'
this.canvasContext.lineWidth = result(canvasContextOptions.lineWidth) || 1
this.onDrawFrame = isFunction(options.onDrawFrame)
? options.onDrawFrame
: () => {} // eslint-disable-line @typescript-eslint/no-empty-function
this.onDrawFrame =
isFunction(options.onDrawFrame) ?
options.onDrawFrame
// eslint-disable-next-line @typescript-eslint/no-empty-function
: () => {}
}

addSource(streamSource: MediaStreamAudioSourceNode): void {
Expand Down
12 changes: 6 additions & 6 deletions packages/@uppy/audio/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
"paths": {
"@uppy/utils/lib/*": ["../utils/src/*"],
"@uppy/core": ["../core/src/index.js"],
"@uppy/core/lib/*": ["../core/src/*"]
}
"@uppy/core/lib/*": ["../core/src/*"],
},
},
"include": ["./package.json", "./src/**/*.*"],
"references": [
{
"path": "../utils/tsconfig.build.json"
"path": "../utils/tsconfig.build.json",
},
{
"path": "../core/tsconfig.build.json"
}
]
"path": "../core/tsconfig.build.json",
},
],
}
4 changes: 2 additions & 2 deletions packages/@uppy/companion/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"sourceMap": false,
"allowJs": true,
"checkJs": true,
"noEmitOnError": true
"noEmitOnError": true,
},
"include": ["src/**/*"]
"include": ["src/**/*"],
}
6 changes: 3 additions & 3 deletions packages/@uppy/core/src/Uppy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1273,9 +1273,9 @@ describe('src/Core', () => {
core
.upload()
.then((r) =>
typeof r!.uploadID === 'string' && r!.uploadID.length === 21
? { ...r, uploadID: 'cjd09qwxb000dlql4tp4doz8h' }
: r,
typeof r!.uploadID === 'string' && r!.uploadID.length === 21 ?
{ ...r, uploadID: 'cjd09qwxb000dlql4tp4doz8h' }
: r,
),
).resolves.toMatchSnapshot()
})
Expand Down
32 changes: 16 additions & 16 deletions packages/@uppy/core/src/Uppy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -835,15 +835,14 @@ export class Uppy<M extends Meta, B extends Body> {
// If the actual File object is passed from input[type=file] or drag-drop,
// we normalize it to match Uppy file object
const file = (
fileDescriptorOrFile instanceof File
? {
name: fileDescriptorOrFile.name,
type: fileDescriptorOrFile.type,
size: fileDescriptorOrFile.size,
data: fileDescriptorOrFile,
}
: fileDescriptorOrFile
) as UppyFile<M, B>
fileDescriptorOrFile instanceof File ?
{
name: fileDescriptorOrFile.name,
type: fileDescriptorOrFile.type,
size: fileDescriptorOrFile.size,
data: fileDescriptorOrFile,
}
: fileDescriptorOrFile) as UppyFile<M, B>

const fileType = getFileType(file)
const fileName = getFileName(fileType, file)
Expand Down Expand Up @@ -1334,8 +1333,9 @@ export class Uppy<M extends Meta, B extends Body> {
...fileInState.progress,
bytesUploaded: data.bytesUploaded,
bytesTotal: data.bytesTotal,
percentage: canHavePercentage
? Math.round((data.bytesUploaded / data.bytesTotal) * 100)
percentage:
canHavePercentage ?
Math.round((data.bytesUploaded / data.bytesTotal) * 100)
: 0,
},
})
Expand Down Expand Up @@ -1527,11 +1527,11 @@ export class Uppy<M extends Meta, B extends Body> {
progress: {
...currentProgress,
postprocess:
this.#postProcessors.size > 0
? {
mode: 'indeterminate',
}
: undefined,
this.#postProcessors.size > 0 ?
{
mode: 'indeterminate',
}
: undefined,
uploadComplete: true,
percentage: 100,
bytesUploaded: currentProgress.bytesTotal,
Expand Down
12 changes: 6 additions & 6 deletions packages/@uppy/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
"paths": {
"@uppy/store-default": ["../store-default/src/index.js"],
"@uppy/store-default/lib/*": ["../store-default/src/*"],
"@uppy/utils/lib/*": ["../utils/src/*"]
}
"@uppy/utils/lib/*": ["../utils/src/*"],
},
},
"include": ["./package.json", "./src/**/*.*"],
"references": [
{
"path": "../store-default/tsconfig.build.json"
"path": "../store-default/tsconfig.build.json",
},
{
"path": "../utils/tsconfig.build.json"
}
]
"path": "../utils/tsconfig.build.json",
},
],
}
10 changes: 5 additions & 5 deletions packages/@uppy/locales/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"compilerOptions": {
"emitDeclarationOnly": false,
"paths": {
"@uppy/utils/lib/*": ["../utils/src/*"]
"@uppy/utils/lib/*": ["../utils/src/*"],
},
"noEmit": true
"noEmit": true,
},
"include": ["./package.json", "./src/**/*.*"],
"references": [
{
"path": "../utils/tsconfig.build.json"
}
]
"path": "../utils/tsconfig.build.json",
},
],
}
20 changes: 11 additions & 9 deletions packages/@uppy/status-bar/src/Components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ function UploadBtn<M extends Meta, B extends Body>(
)

const uploadBtnText =
newFiles && isUploadStarted && !recoveredState
? i18n('uploadXNewFiles', { smart_count: newFiles })
: i18n('uploadXFiles', { smart_count: newFiles })
newFiles && isUploadStarted && !recoveredState ?
i18n('uploadXNewFiles', { smart_count: newFiles })
: i18n('uploadXFiles', { smart_count: newFiles })

return (
<button
Expand Down Expand Up @@ -196,9 +196,9 @@ function PauseResumeButton<M extends Meta, B extends Body>(
<path
fill="#FFF"
d={
isAllPaused
? 'M6 4.25L11.5 8 6 11.75z'
: 'M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z'
isAllPaused ?
'M6 4.25L11.5 8 6 11.75z'
: 'M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z'
}
/>
</g>
Expand Down Expand Up @@ -427,21 +427,23 @@ function ProgressBarUploading(

return (
<div className="uppy-StatusBar-content" aria-label={title} title={title}>
{!isAllPaused ? <LoadingSpinner /> : null}
{!isAllPaused ?
<LoadingSpinner />
: null}
<div className="uppy-StatusBar-status">
<div className="uppy-StatusBar-statusPrimary">
{supportsUploadProgress ? `${title}: ${totalProgress}%` : title}
</div>

{renderProgressDetails()}

{showUploadNewlyAddedFiles ? (
{showUploadNewlyAddedFiles ?
<UploadNewlyAddedFiles
i18n={i18n}
newFiles={newFiles}
startUpload={startUpload}
/>
) : null}
: null}
</div>
</div>
)
Expand Down
Loading
Loading