diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index b9cde88a..67b71c24 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -38,6 +38,10 @@ jobs: with: useLockFile: false + # TODO: Can be removed if https://github.com/kentcdodds/kcd-scripts/pull/146 is released + - name: Verify format (`npm run format` committed?) + run: npm run format -- --check --no-write + # as requested by the React team :) # https://reactjs.org/blog/2019/10/22/react-release-channels.html#using-the-next-channel-for-integration-testing - name: ⚛️ Setup react diff --git a/package.json b/package.json index 42555be0..1cd283fb 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "build:bundle:main": "dotenv -e .bundle.main.env kcd-scripts build -- --bundle --no-clean", "build:bundle:pure": "dotenv -e .bundle.main.env -e .bundle.pure.env kcd-scripts build -- --bundle --no-clean", "build:main": "kcd-scripts build --no-clean", + "format": "kcd-scripts format", "lint": "kcd-scripts lint", "setup": "npm install && npm run validate -s", "test": "kcd-scripts test", diff --git a/src/index.js b/src/index.js index c89dc1a2..96fbe155 100644 --- a/src/index.js +++ b/src/index.js @@ -5,7 +5,7 @@ import {cleanup} from './pure' // this ensures that tests run in isolation from each other // if you don't like this then either import the `pure` module // or set the RTL_SKIP_AUTO_CLEANUP env variable to 'true'. -if (typeof process === "undefined" || !process.env?.RTL_SKIP_AUTO_CLEANUP) { +if (typeof process === 'undefined' || !process.env?.RTL_SKIP_AUTO_CLEANUP) { // ignore teardown() in code coverage because Jest does not support it /* istanbul ignore else */ if (typeof afterEach === 'function') { diff --git a/types/index.d.ts b/types/index.d.ts index 6d0c67ee..46dd1575 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -13,7 +13,7 @@ export * from '@testing-library/dom' export type RenderResult< Q extends Queries = typeof queries, - Container extends Element | DocumentFragment = HTMLElement + Container extends Element | DocumentFragment = HTMLElement, > = { container: Container baseElement: Element @@ -32,7 +32,7 @@ export type RenderResult< export interface RenderOptions< Q extends Queries = typeof queries, - Container extends Element | DocumentFragment = HTMLElement + Container extends Element | DocumentFragment = HTMLElement, > { container?: Container baseElement?: Element @@ -48,7 +48,7 @@ type Omit = Pick> */ export function render< Q extends Queries = typeof queries, - Container extends Element | DocumentFragment = HTMLElement + Container extends Element | DocumentFragment = HTMLElement, >( ui: React.ReactElement, options: RenderOptions,