chore: enable eslint for js (#29639)
This commit is contained in:
parent
c5af51c59d
commit
7eb910a652
|
|
@ -20,3 +20,4 @@ tests/installation/fixture-scripts/
|
|||
examples/
|
||||
DEPS
|
||||
.cache/
|
||||
utils/
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ module.exports = {
|
|||
parserOptions: {
|
||||
ecmaVersion: 9,
|
||||
sourceType: "module",
|
||||
project: "./tsconfig.json",
|
||||
},
|
||||
extends: [
|
||||
"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",
|
||||
"ct": "playwright test tests/components/test-all.spec.js --reporter=list",
|
||||
"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 .",
|
||||
"build-installer": "babel -s --extensions \".ts\" --out-dir packages/playwright-core/lib/utils/ packages/playwright-core/src/utils",
|
||||
"doc": "node utils/doclint/cli.js",
|
||||
|
|
|
|||
|
|
@ -41,12 +41,10 @@ function __pwRender(value) {
|
|||
const component = v;
|
||||
const props = component.props ? __pwRender(component.props) : {};
|
||||
const { children, ...propsWithoutChildren } = props;
|
||||
/** @type {[any, any, any?]} */
|
||||
const createElementArguments = [component.type, propsWithoutChildren];
|
||||
if(children){
|
||||
const createElementArguments = [propsWithoutChildren];
|
||||
if (children)
|
||||
createElementArguments.push(children);
|
||||
}
|
||||
return { result: __pwReact.createElement(...createElementArguments) };
|
||||
return { result: __pwReact.createElement(component.type, ...createElementArguments) };
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,14 +40,11 @@ function __pwRender(value) {
|
|||
if (isJsxComponent(v)) {
|
||||
const component = v;
|
||||
const props = component.props ? __pwRender(component.props) : {};
|
||||
|
||||
const { children, ...propsWithoutChildren } = props;
|
||||
/** @type {[any, any, any?]} */
|
||||
const createElementArguments = [component.type, propsWithoutChildren];
|
||||
if(children){
|
||||
const createElementArguments = [propsWithoutChildren];
|
||||
if (children)
|
||||
createElementArguments.push(children);
|
||||
}
|
||||
return { result: __pwReact.createElement(...createElementArguments) };
|
||||
return { result: __pwReact.createElement(component.type, ...createElementArguments) };
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,5 @@
|
|||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
extends: '../.eslintrc.js',
|
||||
parser: "@typescript-eslint/parser",
|
||||
plugins: ["@typescript-eslint", "notice"],
|
||||
parserOptions: {
|
||||
ecmaVersion: 9,
|
||||
sourceType: "module",
|
||||
project: path.join(__dirname, '..', '..', 'tsconfig.json'),
|
||||
},
|
||||
rules: {
|
||||
'@typescript-eslint/no-floating-promises': 'error',
|
||||
},
|
||||
|
|
|
|||
|
|
@ -35,11 +35,5 @@
|
|||
"include": ["packages"],
|
||||
"exclude": [
|
||||
"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 a new issue