Skip to content

Commit dcee2cc

Browse files
authored
Merge pull request #3124 from modernweb-dev/chore/improve-prettier-setup
chore: improve prettier setup
2 parents 66ea21d + a4fd0c4 commit dcee2cc

408 files changed

Lines changed: 2738 additions & 2462 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ _site
1919
_site-dev
2020
dist-types
2121
/docs/_merged_data
22+
**/__snapshots__/**

docs/docs/building/rollup-plugin-import-meta-assets.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,7 @@ In this example, we use it to optimize SVG images with [svgo](https://github.com
9898
import { importMetaAssets } from '@web/rollup-plugin-import-meta-assets';
9999
const svgo = new SVGO({
100100
// See https://github.com/svg/svgo#what-it-can-do
101-
plugins: [
102-
/* plugins here */
103-
],
101+
plugins: [/* plugins here */],
104102
});
105103

106104
export default {

docs/docs/dev-server/middleware.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ export default {
4444
};
4545
```
4646

47-
</details>
48-
47+
</details>
48+
4949
## Rewriting request urls
5050

5151
You can rewrite certain file requests using a middleware. This can be useful for example to serve your `index.html` from a different file location or to alias a module.

docs/docs/dev-server/plugins/esbuild.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,7 @@ We expose the following options for esbuild. Most of them are a mirror of the es
3232

3333
```ts
3434
type Loader =
35-
| 'js'
36-
| 'jsx'
37-
| 'ts'
38-
| 'tsx'
39-
| 'json'
40-
| 'text'
41-
| 'base64'
42-
| 'file'
43-
| 'dataurl'
44-
| 'binary';
35+
'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'file' | 'dataurl' | 'binary';
4536

4637
interface EsbuildPluginArgs {
4738
target?: string | string[];

docs/docs/dev-server/writing-plugins/overview.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,9 @@ import { Server } from 'net';
3838
import { DevServerCoreConfig, Logger, WebSocketsManager } from '@web/dev-server-core';
3939

4040
export type ServeResult =
41-
| void
42-
| string
43-
| { body: string; type?: string; headers?: Record<string, string> };
41+
void | string | { body: string; type?: string; headers?: Record<string, string> };
4442
export type TransformResult =
45-
| void
46-
| string
47-
| { body?: string; headers?: Record<string, string>; transformCache?: boolean };
43+
void | string | { body?: string; headers?: Record<string, string>; transformCache?: boolean };
4844
export type ResolveResult = void | string | { id?: string };
4945
export type ResolveMimeTypeResult = void | string | { type?: string };
5046

integration/test-runner/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import type { BrowserLauncher, TestRunnerCoreConfig } from '@web/test-runner-core';
22
import { runBasicTest } from './tests/basic/runBasicTest.ts';
33
import { runConfigGroupsTest } from './tests/config-groups/runConfigGroupsTest.ts';
4-
import { runParallelTest } from './tests/parallel/runParallelTest.ts';
5-
import { runTestFailureTest } from './tests/test-failure/runTestFailureTest.ts';
6-
import { runLocationChangeTest } from './tests/location-change/runLocationChangeTest.ts';
74
import { runFocusTest } from './tests/focus/runFocusTest.ts';
5+
import { runLocationChangeTest } from './tests/location-change/runLocationChangeTest.ts';
86
import { runManyTests } from './tests/many/runManyTests.ts';
7+
import { runParallelTest } from './tests/parallel/runParallelTest.ts';
8+
import { runTestFailureTest } from './tests/test-failure/runTestFailureTest.ts';
99

1010
export interface Tests {
1111
basic: boolean;

integration/test-runner/tests/basic/browser-tests/timers.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect } from '../../../../../node_modules/@esm-bundle/chai/esm/chai.js
22

33
describe('timers test', () => {
44
it('can call setTimeout', async () => {
5-
const promise = new Promise((resolve) => {
5+
const promise = new Promise(resolve => {
66
window.setTimeout(() => {
77
resolve();
88
}, 0);
@@ -20,7 +20,7 @@ describe('timers test', () => {
2020

2121
window.clearTimeout(timer);
2222

23-
await new Promise((resolve) => {
23+
await new Promise(resolve => {
2424
window.setTimeout(() => resolve(), 2);
2525
});
2626

@@ -34,7 +34,7 @@ describe('timers test', () => {
3434
callCount++;
3535
}, 1);
3636

37-
await new Promise((resolve) => {
37+
await new Promise(resolve => {
3838
window.setTimeout(() => resolve(), 2);
3939
});
4040

@@ -44,15 +44,15 @@ describe('timers test', () => {
4444

4545
window.clearInterval(interval);
4646

47-
await new Promise((resolve) => {
47+
await new Promise(resolve => {
4848
window.setTimeout(() => resolve(), 2);
4949
});
5050

5151
expect(callCount).to.equal(oldCallCount);
5252
});
5353

5454
it('can call requestAnimationFrame', async () => {
55-
const promise = new Promise((resolve) => {
55+
const promise = new Promise(resolve => {
5656
window.requestAnimationFrame(() => {
5757
resolve();
5858
});
@@ -71,7 +71,7 @@ describe('timers test', () => {
7171

7272
window.cancelAnimationFrame(timer);
7373

74-
await new Promise((resolve) => {
74+
await new Promise(resolve => {
7575
window.setTimeout(() => resolve(), 2);
7676
});
7777

integration/test-runner/tests/basic/runBasicTest.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import assert from 'node:assert/strict';
2-
import { describe, before, it } from 'node:test';
1+
import { legacyPlugin } from '@web/dev-server-legacy';
32
import type { BrowserLauncher, TestRunnerCoreConfig, TestSession } from '@web/test-runner-core';
43
import { runTests } from '@web/test-runner-core/test-helpers';
5-
import { legacyPlugin } from '@web/dev-server-legacy';
4+
import assert from 'node:assert/strict';
5+
import { before, describe, it } from 'node:test';
66
import { resolve } from 'path';
77

88
export function runBasicTest(

integration/test-runner/tests/config-groups/runConfigGroupsTest.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import assert from 'node:assert/strict';
2-
import { describe, it } from 'node:test';
1+
import { legacyPlugin } from '@web/dev-server-legacy';
32
import type {
43
BrowserLauncher,
54
TestRunnerCoreConfig,
65
TestRunnerGroupConfig,
76
} from '@web/test-runner-core';
87
import { runTests } from '@web/test-runner-core/test-helpers';
9-
import { legacyPlugin } from '@web/dev-server-legacy';
8+
import assert from 'node:assert/strict';
9+
import { describe, it } from 'node:test';
1010
import { resolve } from 'path';
1111

1212
export function runConfigGroupsTest(

integration/test-runner/tests/focus/runFocusTest.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import assert from 'node:assert/strict';
2-
import { describe, before, it } from 'node:test';
1+
import { legacyPlugin } from '@web/dev-server-legacy';
32
import type { BrowserLauncher, TestRunnerCoreConfig, TestSession } from '@web/test-runner-core';
43
import { runTests } from '@web/test-runner-core/test-helpers';
5-
import { legacyPlugin } from '@web/dev-server-legacy';
4+
import assert from 'node:assert/strict';
5+
import { before, describe, it } from 'node:test';
66
import { resolve } from 'path';
77

88
export function runFocusTest(

0 commit comments

Comments
 (0)