mirror of
https://github.com/microsoft/playwright.git
synced 2024-10-04 00:19:04 +03:00
chore: enable eslint for js (#29639)
This commit is contained in:
parent
c5af51c59d
commit
7eb910a652
@ -20,3 +20,4 @@ tests/installation/fixture-scripts/
|
|||||||
examples/
|
examples/
|
||||||
DEPS
|
DEPS
|
||||||
.cache/
|
.cache/
|
||||||
|
utils/
|
||||||
|
@ -4,6 +4,7 @@ module.exports = {
|
|||||||
parserOptions: {
|
parserOptions: {
|
||||||
ecmaVersion: 9,
|
ecmaVersion: 9,
|
||||||
sourceType: "module",
|
sourceType: "module",
|
||||||
|
project: "./tsconfig.json",
|
||||||
},
|
},
|
||||||
extends: [
|
extends: [
|
||||||
"plugin:react-hooks/recommended"
|
"plugin:react-hooks/recommended"
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
"ttest": "node ./tests/playwright-test/stable-test-runner/node_modules/@playwright/test/cli test --config=tests/playwright-test/playwright.config.ts",
|
"ttest": "node ./tests/playwright-test/stable-test-runner/node_modules/@playwright/test/cli test --config=tests/playwright-test/playwright.config.ts",
|
||||||
"ct": "playwright test tests/components/test-all.spec.js --reporter=list",
|
"ct": "playwright test tests/components/test-all.spec.js --reporter=list",
|
||||||
"test": "playwright test --config=tests/library/playwright.config.ts",
|
"test": "playwright test --config=tests/library/playwright.config.ts",
|
||||||
"eslint": "eslint --cache --report-unused-disable-directives --ext ts,tsx .",
|
"eslint": "eslint --cache --report-unused-disable-directives --ext ts,tsx,js,jsx,mjs .",
|
||||||
"tsc": "tsc -p .",
|
"tsc": "tsc -p .",
|
||||||
"build-installer": "babel -s --extensions \".ts\" --out-dir packages/playwright-core/lib/utils/ packages/playwright-core/src/utils",
|
"build-installer": "babel -s --extensions \".ts\" --out-dir packages/playwright-core/lib/utils/ packages/playwright-core/src/utils",
|
||||||
"doc": "node utils/doclint/cli.js",
|
"doc": "node utils/doclint/cli.js",
|
||||||
|
@ -40,13 +40,11 @@ function __pwRender(value) {
|
|||||||
if (isJsxComponent(v)) {
|
if (isJsxComponent(v)) {
|
||||||
const component = v;
|
const component = v;
|
||||||
const props = component.props ? __pwRender(component.props) : {};
|
const props = component.props ? __pwRender(component.props) : {};
|
||||||
const {children, ...propsWithoutChildren} = props;
|
const { children, ...propsWithoutChildren } = props;
|
||||||
/** @type {[any, any, any?]} */
|
const createElementArguments = [propsWithoutChildren];
|
||||||
const createElementArguments = [component.type, propsWithoutChildren];
|
if (children)
|
||||||
if(children){
|
|
||||||
createElementArguments.push(children);
|
createElementArguments.push(children);
|
||||||
}
|
return { result: __pwReact.createElement(component.type, ...createElementArguments) };
|
||||||
return { result: __pwReact.createElement(...createElementArguments) };
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -40,14 +40,11 @@ function __pwRender(value) {
|
|||||||
if (isJsxComponent(v)) {
|
if (isJsxComponent(v)) {
|
||||||
const component = v;
|
const component = v;
|
||||||
const props = component.props ? __pwRender(component.props) : {};
|
const props = component.props ? __pwRender(component.props) : {};
|
||||||
|
const { children, ...propsWithoutChildren } = props;
|
||||||
const {children, ...propsWithoutChildren} = props;
|
const createElementArguments = [propsWithoutChildren];
|
||||||
/** @type {[any, any, any?]} */
|
if (children)
|
||||||
const createElementArguments = [component.type, propsWithoutChildren];
|
|
||||||
if(children){
|
|
||||||
createElementArguments.push(children);
|
createElementArguments.push(children);
|
||||||
}
|
return { result: __pwReact.createElement(component.type, ...createElementArguments) };
|
||||||
return { result: __pwReact.createElement(...createElementArguments) };
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -42,8 +42,8 @@ function __pwCreateSlots(slots) {
|
|||||||
|
|
||||||
for (const slotName in slots) {
|
for (const slotName in slots) {
|
||||||
const template = document
|
const template = document
|
||||||
.createRange()
|
.createRange()
|
||||||
.createContextualFragment(slots[slotName]);
|
.createContextualFragment(slots[slotName]);
|
||||||
svelteSlots[slotName] = [createSlotFn(template)];
|
svelteSlots[slotName] = [createSlotFn(template)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,14 +1,5 @@
|
|||||||
const path = require('path');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
extends: '../.eslintrc.js',
|
extends: '../.eslintrc.js',
|
||||||
parser: "@typescript-eslint/parser",
|
|
||||||
plugins: ["@typescript-eslint", "notice"],
|
|
||||||
parserOptions: {
|
|
||||||
ecmaVersion: 9,
|
|
||||||
sourceType: "module",
|
|
||||||
project: path.join(__dirname, '..', '..', 'tsconfig.json'),
|
|
||||||
},
|
|
||||||
rules: {
|
rules: {
|
||||||
'@typescript-eslint/no-floating-promises': 'error',
|
'@typescript-eslint/no-floating-promises': 'error',
|
||||||
},
|
},
|
||||||
|
@ -35,11 +35,5 @@
|
|||||||
"include": ["packages"],
|
"include": ["packages"],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"packages/*/lib",
|
"packages/*/lib",
|
||||||
"packages/playwright-ct-react",
|
|
||||||
"packages/playwright-ct-react17",
|
|
||||||
"packages/playwright-ct-solid",
|
|
||||||
"packages/playwright-ct-svelte",
|
|
||||||
"packages/playwright-ct-vue",
|
|
||||||
"packages/playwright-ct-vue2"
|
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user