From d60c5cbd7713e1ddd0500540574f62ce2a570790 Mon Sep 17 00:00:00 2001 From: Jovi De Croock Date: Wed, 15 May 2024 12:12:42 +0200 Subject: [PATCH] chore: migrate to biome (#4386) --- benches/scripts/analyze.js | 4 +- biome.json | 56 ++++++ compat/src/index.d.ts | 4 +- debug/src/debug.js | 2 +- debug/test/browser/debug-compat.test.js | 2 +- debug/test/browser/debug.test.js | 2 +- jsx-runtime/src/index.js | 2 +- karma.conf.js | 2 +- package-lock.json | 250 +++++++++++++++++++++--- package.json | 32 +-- src/index.d.ts | 12 +- src/render.js | 12 +- test-utils/src/index.js | 17 +- test/_util/bench.js | 2 +- test/benchmarks/performance.test.js | 2 +- test/browser/components.test.js | 2 +- test/browser/fragments.test.js | 8 +- test/ts/VNode-test.tsx | 6 - 18 files changed, 330 insertions(+), 87 deletions(-) create mode 100644 biome.json diff --git a/benches/scripts/analyze.js b/benches/scripts/analyze.js index a3ead8a7be..1606508962 100644 --- a/benches/scripts/analyze.js +++ b/benches/scripts/analyze.js @@ -231,8 +231,8 @@ async function getStatsFromLogs(version, logPaths, getThreadId, trackEventsIn) { unit: key.startsWith('Count') ? '' : key.includes('usedHeapSize') - ? 'MB' - : null + ? 'MB' + : null }, browser: { name: 'chrome' diff --git a/biome.json b/biome.json new file mode 100644 index 0000000000..6231be54f5 --- /dev/null +++ b/biome.json @@ -0,0 +1,56 @@ +{ + "formatter": { + "enabled": true, + "formatWithErrors": false, + "indentStyle": "tab", + "indentWidth": 2, + "lineEnding": "lf", + "lineWidth": 80, + "attributePosition": "auto", + "ignore": [ + "**/.DS_Store", + "**/node_modules", + "**/npm-debug.log", + "**/dist", + "*/package-lock.json", + "**/yarn.lock", + "**/.vscode", + "**/.idea", + "test/ts/**/*.js", + "**/coverage", + "**/*.sw[op]", + "**/*.log", + "**/package/", + "**/preact-*.tgz", + "**/preact.tgz", + "benches/dist/", + "benches/results/", + "benches/logs/", + "benches/logs-saved/", + "benches/node_modules/", + "benches/proxy-packages/*/package-lock.json", + "**/package-lock.json" + ] + }, + "organizeImports": { "enabled": true }, + "linter": { "enabled": true, "rules": { "recommended": true } }, + "javascript": { + "formatter": { + "jsxQuoteStyle": "double", + "quoteProperties": "asNeeded", + "trailingComma": "none", + "semicolons": "always", + "arrowParentheses": "asNeeded", + "bracketSpacing": true, + "bracketSameLine": false, + "quoteStyle": "single", + "attributePosition": "auto" + } + }, + "overrides": [ + { + "include": ["*.json", ".*rc", "*.yml"], + "formatter": { "indentWidth": 2, "indentStyle": "space" } + } + ] +} diff --git a/compat/src/index.d.ts b/compat/src/index.d.ts index dbbc61b954..810629c199 100644 --- a/compat/src/index.d.ts +++ b/compat/src/index.d.ts @@ -176,7 +176,9 @@ declare namespace React { export type ComponentPropsWithRef< C extends ComponentType | keyof JSXInternal.IntrinsicElements - > = C extends new (props: infer P) => Component + > = C extends new ( + props: infer P + ) => Component ? PropsWithoutRef

& RefAttributes> : ComponentProps; diff --git a/debug/src/debug.js b/debug/src/debug.js index 2704dcfb16..fab1d7915b 100644 --- a/debug/src/debug.js +++ b/debug/src/debug.js @@ -72,7 +72,7 @@ export function initDebug() { useEffect: new WeakMap(), useLayoutEffect: new WeakMap(), lazyPropTypes: new WeakMap() - }; + }; const deprecations = []; options._catchError = (error, vnode, oldVNode, errorInfo) => { diff --git a/debug/test/browser/debug-compat.test.js b/debug/test/browser/debug-compat.test.js index aea131fef3..d177406d99 100644 --- a/debug/test/browser/debug-compat.test.js +++ b/debug/test/browser/debug-compat.test.js @@ -30,7 +30,7 @@ describe('debug compat', () => { afterEach(() => { /** @type {*} */ - (console.error).restore(); + console.error.restore(); console.warn.restore(); teardown(scratch); diff --git a/debug/test/browser/debug.test.js b/debug/test/browser/debug.test.js index 782739fe37..e435d5cb50 100644 --- a/debug/test/browser/debug.test.js +++ b/debug/test/browser/debug.test.js @@ -34,7 +34,7 @@ describe('debug', () => { afterEach(() => { /** @type {*} */ - (console.error).restore(); + console.error.restore(); console.warn.restore(); teardown(scratch); }); diff --git a/jsx-runtime/src/index.js b/jsx-runtime/src/index.js index 144ac83712..454df6308a 100644 --- a/jsx-runtime/src/index.js +++ b/jsx-runtime/src/index.js @@ -120,7 +120,7 @@ function jsxAttr(name, value) { prop[0] == '-' ? prop : JS_TO_CSS[prop] || - (JS_TO_CSS[prop] = prop.replace(CSS_REGEX, '-$&').toLowerCase()); + (JS_TO_CSS[prop] = prop.replace(CSS_REGEX, '-$&').toLowerCase()); let suffix = ';'; if ( diff --git a/karma.conf.js b/karma.conf.js index bec8c1ad76..ce2ab1468d 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -214,7 +214,7 @@ function createEsbuildPlugin() { } } ] - ] + ] : [], plugins: [ coverage && [ diff --git a/package-lock.json b/package-lock.json index 8c05a28e49..1214cb4b2b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "@babel/plugin-transform-react-jsx-source": "^7.7.4", "@babel/preset-env": "^7.7.1", "@babel/register": "^7.7.0", + "@biomejs/biome": "1.7.3", "@types/chai": "^4.1.2", "@types/mocha": "^5.0.0", "@types/node": "^14.14.10", @@ -55,7 +56,6 @@ "npm-merge-driver-install": "^1.1.1", "npm-run-all": "^4.0.0", "preact-render-to-string": "^5.2.5", - "prettier": "^2.8.6", "prop-types": "^15.7.2", "sade": "^1.7.4", "sinon": "^9.2.3", @@ -1835,6 +1835,161 @@ "node": ">=6.9.0" } }, + "node_modules/@biomejs/biome": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.7.3.tgz", + "integrity": "sha512-ogFQI+fpXftr+tiahA6bIXwZ7CSikygASdqMtH07J2cUzrpjyTMVc9Y97v23c7/tL1xCZhM+W9k4hYIBm7Q6cQ==", + "dev": true, + "hasInstallScript": true, + "bin": { + "biome": "bin/biome" + }, + "engines": { + "node": ">=14.21.3" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/biome" + }, + "optionalDependencies": { + "@biomejs/cli-darwin-arm64": "1.7.3", + "@biomejs/cli-darwin-x64": "1.7.3", + "@biomejs/cli-linux-arm64": "1.7.3", + "@biomejs/cli-linux-arm64-musl": "1.7.3", + "@biomejs/cli-linux-x64": "1.7.3", + "@biomejs/cli-linux-x64-musl": "1.7.3", + "@biomejs/cli-win32-arm64": "1.7.3", + "@biomejs/cli-win32-x64": "1.7.3" + } + }, + "node_modules/@biomejs/cli-darwin-arm64": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.7.3.tgz", + "integrity": "sha512-eDvLQWmGRqrPIRY7AIrkPHkQ3visEItJKkPYSHCscSDdGvKzYjmBJwG1Gu8+QC5ed6R7eiU63LEC0APFBobmfQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-darwin-x64": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.7.3.tgz", + "integrity": "sha512-JXCaIseKRER7dIURsVlAJacnm8SG5I0RpxZ4ya3dudASYUc68WGl4+FEN03ABY3KMIq7hcK1tzsJiWlmXyosZg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-arm64": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.7.3.tgz", + "integrity": "sha512-phNTBpo7joDFastnmZsFjYcDYobLTx4qR4oPvc9tJ486Bd1SfEVPHEvJdNJrMwUQK56T+TRClOQd/8X1nnjA9w==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-arm64-musl": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.7.3.tgz", + "integrity": "sha512-c8AlO45PNFZ1BYcwaKzdt46kYbuP6xPGuGQ6h4j3XiEDpyseRRUy/h+6gxj07XovmyxKnSX9GSZ6nVbZvcVUAw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-x64": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.7.3.tgz", + "integrity": "sha512-vnedYcd5p4keT3iD48oSKjOIRPYcjSNNbd8MO1bKo9ajg3GwQXZLAH+0Cvlr+eMsO67/HddWmscSQwTFrC/uPA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-x64-musl": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.7.3.tgz", + "integrity": "sha512-UdEHKtYGWEX3eDmVWvQeT+z05T9/Sdt2+F/7zmMOFQ7boANeX8pcO6EkJPK3wxMudrApsNEKT26rzqK6sZRTRA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-win32-arm64": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.7.3.tgz", + "integrity": "sha512-unNCDqUKjujYkkSxs7gFIfdasttbDC4+z0kYmcqzRk6yWVoQBL4dNLcCbdnJS+qvVDNdI9rHp2NwpQ0WAdla4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-win32-x64": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.7.3.tgz", + "integrity": "sha512-ZmByhbrnmz/UUFYB622CECwhKIPjJLLPr5zr3edhu04LzbfcOrz16VYeNq5dpO1ADG70FORhAJkaIGdaVBG00w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.21.3" + } + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -12930,21 +13085,6 @@ "node": ">=4" } }, - "node_modules/prettier": { - "version": "2.8.6", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.6.tgz", - "integrity": "sha512-mtuzdiBbHwPEgl7NxWlqOkithPyp4VN93V7VeHVWBF+ad3I5avc0RVDT4oImXQy9H/AqxA2NSQH8pSxHW6FYbQ==", - "dev": true, - "bin": { - "prettier": "bin-prettier.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, "node_modules/pretty-bytes": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", @@ -17359,6 +17499,78 @@ "to-fast-properties": "^2.0.0" } }, + "@biomejs/biome": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.7.3.tgz", + "integrity": "sha512-ogFQI+fpXftr+tiahA6bIXwZ7CSikygASdqMtH07J2cUzrpjyTMVc9Y97v23c7/tL1xCZhM+W9k4hYIBm7Q6cQ==", + "dev": true, + "requires": { + "@biomejs/cli-darwin-arm64": "1.7.3", + "@biomejs/cli-darwin-x64": "1.7.3", + "@biomejs/cli-linux-arm64": "1.7.3", + "@biomejs/cli-linux-arm64-musl": "1.7.3", + "@biomejs/cli-linux-x64": "1.7.3", + "@biomejs/cli-linux-x64-musl": "1.7.3", + "@biomejs/cli-win32-arm64": "1.7.3", + "@biomejs/cli-win32-x64": "1.7.3" + } + }, + "@biomejs/cli-darwin-arm64": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.7.3.tgz", + "integrity": "sha512-eDvLQWmGRqrPIRY7AIrkPHkQ3visEItJKkPYSHCscSDdGvKzYjmBJwG1Gu8+QC5ed6R7eiU63LEC0APFBobmfQ==", + "dev": true, + "optional": true + }, + "@biomejs/cli-darwin-x64": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.7.3.tgz", + "integrity": "sha512-JXCaIseKRER7dIURsVlAJacnm8SG5I0RpxZ4ya3dudASYUc68WGl4+FEN03ABY3KMIq7hcK1tzsJiWlmXyosZg==", + "dev": true, + "optional": true + }, + "@biomejs/cli-linux-arm64": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.7.3.tgz", + "integrity": "sha512-phNTBpo7joDFastnmZsFjYcDYobLTx4qR4oPvc9tJ486Bd1SfEVPHEvJdNJrMwUQK56T+TRClOQd/8X1nnjA9w==", + "dev": true, + "optional": true + }, + "@biomejs/cli-linux-arm64-musl": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.7.3.tgz", + "integrity": "sha512-c8AlO45PNFZ1BYcwaKzdt46kYbuP6xPGuGQ6h4j3XiEDpyseRRUy/h+6gxj07XovmyxKnSX9GSZ6nVbZvcVUAw==", + "dev": true, + "optional": true + }, + "@biomejs/cli-linux-x64": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.7.3.tgz", + "integrity": "sha512-vnedYcd5p4keT3iD48oSKjOIRPYcjSNNbd8MO1bKo9ajg3GwQXZLAH+0Cvlr+eMsO67/HddWmscSQwTFrC/uPA==", + "dev": true, + "optional": true + }, + "@biomejs/cli-linux-x64-musl": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.7.3.tgz", + "integrity": "sha512-UdEHKtYGWEX3eDmVWvQeT+z05T9/Sdt2+F/7zmMOFQ7boANeX8pcO6EkJPK3wxMudrApsNEKT26rzqK6sZRTRA==", + "dev": true, + "optional": true + }, + "@biomejs/cli-win32-arm64": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.7.3.tgz", + "integrity": "sha512-unNCDqUKjujYkkSxs7gFIfdasttbDC4+z0kYmcqzRk6yWVoQBL4dNLcCbdnJS+qvVDNdI9rHp2NwpQ0WAdla4Q==", + "dev": true, + "optional": true + }, + "@biomejs/cli-win32-x64": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.7.3.tgz", + "integrity": "sha512-ZmByhbrnmz/UUFYB622CECwhKIPjJLLPr5zr3edhu04LzbfcOrz16VYeNq5dpO1ADG70FORhAJkaIGdaVBG00w==", + "dev": true, + "optional": true + }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -25677,12 +25889,6 @@ "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", "dev": true }, - "prettier": { - "version": "2.8.6", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.6.tgz", - "integrity": "sha512-mtuzdiBbHwPEgl7NxWlqOkithPyp4VN93V7VeHVWBF+ad3I5avc0RVDT4oImXQy9H/AqxA2NSQH8pSxHW6FYbQ==", - "dev": true - }, "pretty-bytes": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", diff --git a/package.json b/package.json index 03713d2e07..06a26eb00b 100644 --- a/package.json +++ b/package.json @@ -136,14 +136,11 @@ "lint": "run-s eslint tsc", "tsc": "tsc -p jsconfig-lint.json", "eslint": "eslint src test debug compat hooks test-utils", - "format": "prettier --write \"**/*.{js,jsx,mjs,cjs,ts,tsx,yml,json,html,md,css,scss}\"", - "format:check": "prettier --check '**/*.{js,jsx,mjs,cjs,ts,tsx,yml,json,html,md,css,scss}'" + "format": "biome format --write .", + "format:check": "biome format ." }, "eslintConfig": { - "extends": [ - "developit", - "prettier" - ], + "extends": ["developit", "prettier"], "settings": { "react": { "pragma": "createElement" @@ -153,11 +150,7 @@ "camelcase": [ 1, { - "allow": [ - "__test__*", - "unstable_*", - "UNSAFE_*" - ] + "allow": ["__test__*", "unstable_*", "UNSAFE_*"] } ], "no-unused-vars": [ @@ -183,21 +176,10 @@ "react/no-find-dom-node": 0 } }, - "eslintIgnore": [ - "test/fixtures", - "test/ts/", - "*.ts", - "dist", - "benchmarks" - ], - "prettier": { - "singleQuote": true, - "trailingComma": "none", - "arrowParens": "avoid" - }, + "eslintIgnore": ["test/fixtures", "test/ts/", "*.ts", "dist", "benchmarks"], "lint-staged": { "**/*.{js,jsx,mjs,cjs,ts,tsx,yml,json,html,md,css,scss}": [ - "prettier --write" + "biome format --write --no-errors-on-unmatched" ] }, "husky": { @@ -267,6 +249,7 @@ "@babel/plugin-transform-react-jsx-source": "^7.7.4", "@babel/preset-env": "^7.7.1", "@babel/register": "^7.7.0", + "@biomejs/biome": "1.7.3", "@types/chai": "^4.1.2", "@types/mocha": "^5.0.0", "@types/node": "^14.14.10", @@ -305,7 +288,6 @@ "npm-merge-driver-install": "^1.1.1", "npm-run-all": "^4.0.0", "preact-render-to-string": "^5.2.5", - "prettier": "^2.8.6", "prop-types": "^15.7.2", "sade": "^1.7.4", "sinon": "^9.2.3", diff --git a/src/index.d.ts b/src/index.d.ts index 4c0ab0e702..269e242bfb 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -83,8 +83,8 @@ export type ComponentProps< > = C extends ComponentType ? P : C extends keyof JSXInternal.IntrinsicElements - ? JSXInternal.IntrinsicElements[C] - : never; + ? JSXInternal.IntrinsicElements[C] + : never; export interface FunctionComponent

{ (props: RenderableProps

, context?: any): VNode | null; @@ -195,8 +195,8 @@ export function createElement( | null, ...children: ComponentChildren[] ): VNode< - | JSXInternal.DOMAttributes & - ClassAttributes + JSXInternal.DOMAttributes & + ClassAttributes >; export function createElement< P extends JSXInternal.HTMLAttributes, @@ -242,8 +242,8 @@ export function h( | null, ...children: ComponentChildren[] ): VNode< - | JSXInternal.DOMAttributes & - ClassAttributes + JSXInternal.DOMAttributes & + ClassAttributes >; export function h< P extends JSXInternal.HTMLAttributes, diff --git a/src/render.js b/src/render.js index eeeb452a4f..e0fec45424 100644 --- a/src/render.js +++ b/src/render.js @@ -45,16 +45,16 @@ export function render(vnode, parentDom, replaceNode) { !isHydrating && replaceNode ? [replaceNode] : oldVNode - ? null - : parentDom.firstChild - ? slice.call(parentDom.childNodes) - : null, + ? null + : parentDom.firstChild + ? slice.call(parentDom.childNodes) + : null, commitQueue, !isHydrating && replaceNode ? replaceNode : oldVNode - ? oldVNode._dom - : parentDom.firstChild, + ? oldVNode._dom + : parentDom.firstChild, isHydrating, refQueue ); diff --git a/test-utils/src/index.js b/test-utils/src/index.js index f8df33393d..b6efc22d40 100644 --- a/test-utils/src/index.js +++ b/test-utils/src/index.js @@ -35,14 +35,17 @@ export function act(cb) { try { const result = cb(); if (isThenable(result)) { - return result.then(() => { - --actDepth; - }, (e) => { - --actDepth; - throw e; - }) + return result.then( + () => { + --actDepth; + }, + e => { + --actDepth; + throw e; + } + ); } - } catch(e) { + } catch (e) { --actDepth; throw e; } diff --git a/test/_util/bench.js b/test/_util/bench.js index 5085daa118..3ad6e65fce 100644 --- a/test/_util/bench.js +++ b/test/_util/bench.js @@ -27,7 +27,7 @@ export default function bench(benches, callback) { bench.name === result.fastest.name ? 0 : (((result.fastest.hz - bench.hz) / result.fastest.hz) * 100) | - 0, + 0, hz: bench.hz.toFixed(bench.hz < 100 ? 2 : 0), rme: bench.stats.rme.toFixed(2), size: bench.stats.sample.length, diff --git a/test/benchmarks/performance.test.js b/test/benchmarks/performance.test.js index 5b3ec2d877..f39e743694 100644 --- a/test/benchmarks/performance.test.js +++ b/test/benchmarks/performance.test.js @@ -306,7 +306,7 @@ describe('performance', function () { it('should mutate styles/properties quickly', done => { let counter = 0; - const keyLooper = n => c => c % n ? `${c}px` : c; + const keyLooper = n => c => (c % n ? `${c}px` : c); const get = (obj, i) => obj[i % obj.length]; const CLASSES = ['foo', 'foo bar', '', 'baz-bat', null]; const STYLES = []; diff --git a/test/browser/components.test.js b/test/browser/components.test.js index 39a5dc8457..3019e4d317 100644 --- a/test/browser/components.test.js +++ b/test/browser/components.test.js @@ -2780,7 +2780,7 @@ describe('Components', () => { } class App extends Component { - children = (); + children = ; render() { return this.children; } diff --git a/test/browser/fragments.test.js b/test/browser/fragments.test.js index 20fed865e4..7eb0b0924d 100644 --- a/test/browser/fragments.test.js +++ b/test/browser/fragments.test.js @@ -874,13 +874,13 @@ describe('Fragment', () => { - ] + ] : [ , - ]; + ]; } render(, scratch); @@ -1338,7 +1338,7 @@ describe('Fragment', () => {

  • 4
  • 5
  • - ] + ] : [
  • 4
  • @@ -1348,7 +1348,7 @@ describe('Fragment', () => {
  • 1
  • ,
  • 2
  • ,
  • 3
  • - ]} + ]} ); diff --git a/test/ts/VNode-test.tsx b/test/ts/VNode-test.tsx index dd050d2e67..9169183a36 100644 --- a/test/ts/VNode-test.tsx +++ b/test/ts/VNode-test.tsx @@ -154,7 +154,6 @@ class ComponentWithFunctionChild extends Component<{ return null; } } - {num => num.toFixed(2)} ; @@ -164,7 +163,6 @@ class ComponentWithStringChild extends Component<{ children: string }> { return null; } } - child; class ComponentWithNumberChild extends Component<{ children: number }> { @@ -172,7 +170,6 @@ class ComponentWithNumberChild extends Component<{ children: number }> { return null; } } - {1}; class ComponentWithBooleanChild extends Component<{ children: boolean }> { @@ -180,7 +177,6 @@ class ComponentWithBooleanChild extends Component<{ children: boolean }> { return null; } } - {false}; class ComponentWithNullChild extends Component<{ children: null }> { @@ -188,7 +184,6 @@ class ComponentWithNullChild extends Component<{ children: null }> { return null; } } - {null}; class ComponentWithNumberChildren extends Component<{ children: number[] }> { @@ -196,7 +191,6 @@ class ComponentWithNumberChildren extends Component<{ children: number[] }> { return null; } } - {1} {2}