chore(lint): Ensure EOL newlines (#34117)
This commit is contained in:
Родитель
3bc72eb841
Коммит
875436855e
|
@ -3,6 +3,9 @@ test/assets/modernizr.js
|
|||
/packages/*/lib/
|
||||
*.js
|
||||
/packages/playwright-core/src/generated/*
|
||||
/packages/playwright-core/src/protocol/debug.ts
|
||||
/packages/playwright-core/src/protocol/validator.ts
|
||||
/packages/playwright-core/src/server/injected/recorder/clipPaths.ts
|
||||
/packages/playwright-core/src/third_party/
|
||||
/packages/playwright-core/types/*
|
||||
/packages/playwright-ct-core/src/generated/*
|
||||
|
|
|
@ -115,7 +115,7 @@ module.exports = {
|
|||
"@typescript-eslint/type-annotation-spacing": 2,
|
||||
|
||||
// file whitespace
|
||||
"no-multiple-empty-lines": [2, {"max": 2}],
|
||||
"no-multiple-empty-lines": [2, {"max": 2, "maxEOF": 0}],
|
||||
"no-mixed-spaces-and-tabs": 2,
|
||||
"no-trailing-spaces": 2,
|
||||
"linebreak-style": [ process.platform === "win32" ? 0 : 2, "unix" ],
|
||||
|
@ -123,6 +123,7 @@ module.exports = {
|
|||
"key-spacing": [2, {
|
||||
"beforeColon": false
|
||||
}],
|
||||
"eol-last": 2,
|
||||
|
||||
// copyright
|
||||
"notice/notice": [2, {
|
||||
|
|
|
@ -51,4 +51,4 @@ export function bundle(): Plugin {
|
|||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,4 +47,3 @@ export function hashStringToInt(str: string) {
|
|||
hash = str.charCodeAt(i) + ((hash << 8) - hash);
|
||||
return Math.abs(hash % 6);
|
||||
}
|
||||
|
||||
|
|
|
@ -20,4 +20,4 @@ export type Rect = Size & Point;
|
|||
export type Quad = [ Point, Point, Point, Point ];
|
||||
export type TimeoutOptions = { timeout?: number };
|
||||
export type NameValue = { name: string, value: string };
|
||||
export type HeadersArray = NameValue[];
|
||||
export type HeadersArray = NameValue[];
|
||||
|
|
|
@ -124,4 +124,3 @@ export class FastStats implements Stats {
|
|||
return (this._sum(this._partialSumMult, x1, y1, x2, y2) - this._sum(this._partialSumC1, x1, y1, x2, y2) * this._sum(this._partialSumC2, x1, y1, x2, y2) / N) / N;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -524,5 +524,3 @@ class ClankBrowserProcess implements BrowserProcess {
|
|||
await this._browser.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -77,4 +77,4 @@ export async function prepareFilesForUpload(frame: Frame, params: channels.Eleme
|
|||
}));
|
||||
|
||||
return { localPaths, localDirectory, filePayloads };
|
||||
}
|
||||
}
|
||||
|
|
|
@ -436,4 +436,3 @@ function toJugglerProxyOptions(proxy: types.ProxySettings) {
|
|||
// Prefs for quick fixes that didn't make it to the build.
|
||||
// Should all be moved to `playwright.cfg`.
|
||||
const kBandaidFirefoxUserPrefs = {};
|
||||
|
||||
|
|
|
@ -101,4 +101,3 @@ class JugglerReadyState extends BrowserReadyState {
|
|||
this._wsEndpoint.resolve(undefined);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1104,4 +1104,3 @@ deps['debian12-arm64'] = {
|
|||
...deps['debian12-x64'].lib2package,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -354,4 +354,4 @@ export function rewriteOpenSSLErrorIfNeeded(error: Error): Error {
|
|||
'For more details, see https://github.com/openssl/openssl/blob/master/README-PROVIDERS.md#the-legacy-provider',
|
||||
'You could probably modernize the certificate by following the steps at https://github.com/nodejs/node/issues/40672#issuecomment-1243648223',
|
||||
].join('\n'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,4 +83,3 @@ export class SocksInterceptor {
|
|||
function tChannelForSocks(names: '*' | string[], arg: any, path: string, context: ValidatorContext) {
|
||||
throw new ValidationError(`${path}: channels are not expected in SocksSupport`);
|
||||
}
|
||||
|
||||
|
|
|
@ -105,4 +105,4 @@ export class WKProvisionalPage {
|
|||
assert(!frameTree.frame.parentId);
|
||||
this._mainFrameId = frameTree.frame.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,4 +20,4 @@ export function isJsonMimeType(mimeType: string) {
|
|||
|
||||
export function isTextualMimeType(mimeType: string) {
|
||||
return !!mimeType.match(/^(text\/.*?|application\/(json|(x-)?javascript|xml.*?|ecmascript|graphql|x-www-form-urlencoded)|image\/svg(\+xml)?|application\/.*?(\+json|\+xml))(;\s*charset=.*)?$/);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,4 +77,3 @@ function parseOSReleaseText(osReleaseText: string): Map<string, string> {
|
|||
}
|
||||
return fields;
|
||||
}
|
||||
|
||||
|
|
|
@ -63,4 +63,4 @@ export function findRepeatedSubsequences(s: string[]): { sequence: string[]; cou
|
|||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,4 +18,4 @@ import jsxRuntime from './jsx-runtime.js';
|
|||
|
||||
export const jsx = jsxRuntime.jsx;
|
||||
export const jsxs = jsxRuntime.jsxs;
|
||||
export const Fragment = jsxRuntime.Fragment;
|
||||
export const Fragment = jsxRuntime.Fragment;
|
||||
|
|
|
@ -298,4 +298,4 @@ const configInternalSymbol = Symbol('configInternalSymbol');
|
|||
|
||||
export function getProjectId(project: FullProject): string {
|
||||
return (project as any).__projectId!;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,4 +54,4 @@ export async function detectChangedTestFiles(baseCommit: string, configDir: stri
|
|||
const trackedFilesWithChanges = gitFileList(`diff ${baseCommit} --name-only`).map(file => path.join(gitRoot, file));
|
||||
|
||||
return new Set(affectedTestFiles([...untrackedFiles, ...trackedFilesWithChanges]));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,4 +28,4 @@ export function bundle(): Plugin {
|
|||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -160,4 +160,4 @@ export class TraceViewerServer {
|
|||
return;
|
||||
return response;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -282,4 +282,4 @@ export async function generateFetchCall(resource: Entry, style: FetchStyle = Fet
|
|||
|
||||
async function fetchRequestPostData(resource: Entry) {
|
||||
return resource.request.postData?._sha1 ? await fetch(`sha1/${resource.request.postData._sha1}`).then(r => r.text()) : resource.request.postData?.text;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -150,4 +150,4 @@ function excludeOrigin(url: string): string {
|
|||
} catch (error) {
|
||||
return url;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,4 +59,4 @@ export function emptySource(): Source {
|
|||
label: '',
|
||||
highlight: []
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,4 +90,3 @@ test('drag resize', async ({ page, mount }) => {
|
|||
expect.soft(mainBox).toEqual({ x: 0, y: 0, width: 500, height: 100 });
|
||||
expect.soft(sidebarBox).toEqual({ x: 0, y: 101, width: 500, height: 399 });
|
||||
});
|
||||
|
||||
|
|
|
@ -68,4 +68,4 @@ test('select webview from socketName', async function({ androidDevice }) {
|
|||
|
||||
await newPage.close();
|
||||
await context.close();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -79,4 +79,4 @@ function csvEscape(str) {
|
|||
return str;
|
||||
}
|
||||
|
||||
export default CsvReporter;
|
||||
export default CsvReporter;
|
||||
|
|
|
@ -86,4 +86,4 @@ function getOutcome(test: TestCase): TestExpectation {
|
|||
return 'unknown';
|
||||
}
|
||||
|
||||
export default ExpectationReporter;
|
||||
export default ExpectationReporter;
|
||||
|
|
|
@ -588,4 +588,4 @@ for (const toThrow of ['toThrowError', 'toThrow'] as const) {
|
|||
).toThrowErrorMatchingSnapshot();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -556,4 +556,4 @@ it('should ignore aborted requests', async ({ contextFactory, server }) => {
|
|||
const result = await Promise.race([evalPromise, page2.waitForTimeout(1000).then(() => 'timeout')]);
|
||||
expect(result).toBe('timeout');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -629,4 +629,4 @@ test.describe('PW_EXPERIMENTAL_SERVICE_WORKER_NETWORK_EVENTS=1', () => {
|
|||
const req = await requestPromise;
|
||||
expect(req.headers['x-custom-header']).toBe('custom!');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -122,4 +122,4 @@ test('should generate routeFromHAR with --save-har and --save-har-glob', async (
|
|||
await cli.waitForCleanExit();
|
||||
const json = JSON.parse(fs.readFileSync(harFileName, 'utf-8'));
|
||||
expect(json.log.creator.name).toBe('Playwright');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -288,4 +288,4 @@ async function waitForRafs(page: Page, count: number): Promise<void> {
|
|||
};
|
||||
window.builtinRequestAnimationFrame(onRaf);
|
||||
}), count);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -180,4 +180,3 @@ it('evaluateHandle should work', async ({ page, server }) => {
|
|||
const windowHandle = await mainFrame.evaluateHandle(() => window);
|
||||
expect(windowHandle).toBeTruthy();
|
||||
});
|
||||
|
||||
|
|
|
@ -173,4 +173,3 @@ it('Locator.locator() and FrameLocator.locator() should accept locator', async (
|
|||
expect(await divLocator.locator('input').inputValue()).toBe('outer');
|
||||
expect(await page.frameLocator('iframe').locator(divLocator).locator('input').inputValue()).toBe('inner');
|
||||
});
|
||||
|
||||
|
|
|
@ -272,4 +272,4 @@ it('<picture> resource should have type image', async ({ page }) => {
|
|||
`)
|
||||
]);
|
||||
expect(request.resourceType()).toBe('image');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -309,4 +309,3 @@ it('should dispatch mouse move after context menu was opened', async ({ page, br
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -485,4 +485,3 @@ it('should not go to the network for fulfilled requests body', {
|
|||
expect(body).toBeTruthy();
|
||||
expect(serverHit).toBe(false);
|
||||
});
|
||||
|
||||
|
|
|
@ -176,4 +176,3 @@ for (const [name, url] of Object.entries(reacts)) {
|
|||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -168,4 +168,3 @@ for (const [name, url] of Object.entries(vues)) {
|
|||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -195,4 +195,4 @@ test('should focus a single test suite', async ({ runInlineTest }) => {
|
|||
expect(result.skipped).toBe(0);
|
||||
expect(result.report.suites[0].suites[0].suites[0].specs[0].title).toEqual('pass2');
|
||||
expect(result.report.suites[0].suites[0].suites[0].specs[1].title).toEqual('pass3');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -427,4 +427,3 @@ test('exits successfully if there are no changes', async ({ runInlineTest, git,
|
|||
|
||||
expect(result.exitCode).toBe(0);
|
||||
});
|
||||
|
||||
|
|
|
@ -148,4 +148,4 @@ test('should produce correct test steps', async ({ runInlineTest, runServer }) =
|
|||
'onStepEnd fixture: context',
|
||||
'onStepEnd After Hooks'
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -2052,4 +2052,4 @@ test('project filter in report name', async ({ runInlineTest }) => {
|
|||
const reportFiles = await fs.promises.readdir(reportDir);
|
||||
expect(reportFiles.sort()).toEqual(['report-foo-b-r-6d9d49e-1.zip']);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -112,4 +112,4 @@ for (const useIntermediateMergeReport of [false, true] as const) {
|
|||
colors.green('·').repeat(3));
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,4 +98,4 @@ for (const useIntermediateMergeReport of [false, true] as const) {
|
|||
expect(result.exitCode).toBe(1);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -594,4 +594,4 @@ for (const useIntermediateMergeReport of [false, true] as const) {
|
|||
expect(time).toBeGreaterThan(1);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -189,4 +189,4 @@ for (const useIntermediateMergeReport of [false, true] as const) {
|
|||
expect(result.exitCode).toBe(1);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -319,4 +319,3 @@ function simpleAnsiRenderer(text, ttyWidth) {
|
|||
|
||||
return screenLines.map(line => line.join('')).join('\n');
|
||||
}
|
||||
|
||||
|
|
|
@ -157,4 +157,4 @@ test('report with worker error', async ({ runInlineTest }) => {
|
|||
**0 passed**
|
||||
:heavy_check_mark::heavy_check_mark::heavy_check_mark:
|
||||
`);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -137,4 +137,3 @@ test('arg should receive default arg', async ({ runInlineTest }, testInfo) => {
|
|||
expect(result.output).toContain(`A snapshot doesn't exist at ${snapshotOutputPath}, writing actual`);
|
||||
expect(fs.existsSync(snapshotOutputPath)).toBe(true);
|
||||
});
|
||||
|
||||
|
|
|
@ -370,4 +370,4 @@ test('should always work with unix separators', async ({ runInlineTest }) => {
|
|||
expect(result.passed).toBe(1);
|
||||
expect(result.report.suites.map(s => s.file).sort()).toEqual(['a.test.ts']);
|
||||
expect(result.exitCode).toBe(0);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -186,4 +186,3 @@ test('test.use() should throw if called from beforeAll ', async ({ runInlineTest
|
|||
expect(result.exitCode).toBe(1);
|
||||
expect(result.output).toContain('Playwright Test did not expect test.use() to be called here');
|
||||
});
|
||||
|
||||
|
|
|
@ -46,4 +46,3 @@ test('should display annotations', async ({ runUITest }) => {
|
|||
await expect(annotations.locator('.annotation-item').filter({ hasText: 'test repo' }).locator('a'))
|
||||
.toHaveAttribute('href', 'https://github.com/microsoft/playwright');
|
||||
});
|
||||
|
||||
|
|
|
@ -153,6 +153,7 @@ class JSLintingService extends LintingService {
|
|||
'@typescript-eslint/no-unused-vars': 'off',
|
||||
'max-len': ['error', { code: 100 }],
|
||||
'react/react-in-jsx-scope': 'off',
|
||||
'eol-last': 'off',
|
||||
},
|
||||
}
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче