From feab426423d5fd7dc0d03489baab474362a20f95 Mon Sep 17 00:00:00 2001
From: Juraj Uhlar
Date: Thu, 16 Jul 2026 10:20:39 +0100
Subject: [PATCH 1/5] fix: include __tests__ in tsconfig for JSX type-checking
---
tsconfig.json | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tsconfig.json b/tsconfig.json
index f31436f3..60267558 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -19,6 +19,7 @@
"jsx": "react-jsx"
},
"include": [
- "src"
+ "src",
+ "__tests__"
]
}
From 4492a693ff8c78a1dfc67356eef0ae34247649dc Mon Sep 17 00:00:00 2001
From: Juraj Uhlar
Date: Thu, 16 Jul 2026 12:33:33 +0100
Subject: [PATCH 2/5] chore: upgrade ESLint to flat config with dx-team v3
Migrate to ESLint 10 and type-checked flat config.
Lint examples from the root and apply minimal source/test fixes.
---
.eslintrc.js | 31 -
__tests__/fpjs-provider.test.tsx | 2 +-
__tests__/helpers.tsx | 7 +-
__tests__/use-visitor-data.test.tsx | 53 +-
__tests__/with-environment.preact.test.tsx | 6 +-
__tests__/with-environment.test.tsx | 35 +-
eslint.config.mjs | 43 +
examples/create-react-app/package.json | 3 +-
examples/create-react-app/src/index.tsx | 7 +-
.../src/shared/components/Toggler.tsx | 9 +-
.../components/VisitorDataPresenter.tsx | 3 +-
.../src/shared/pages/HomePage.tsx | 7 +-
.../src/shared/pages/SignInPage.tsx | 26 +-
examples/next-appDir/app/HomePage.tsx | 2 +-
examples/next-appDir/app/layout.tsx | 11 +-
examples/next-appDir/app/page.tsx | 2 +-
examples/next-appDir/package.json | 16 +-
examples/next/package.json | 16 +-
examples/next/pages/_app.tsx | 11 +-
examples/preact/.eslintrc.js | 20 -
examples/preact/package.json | 13 +-
examples/preact/preact.config.js | 1 -
examples/preact/src/components/app.tsx | 2 +-
examples/preact/src/index.tsx | 6 +-
examples/vite/eslint.config.js | 23 -
examples/vite/package.json | 10 +-
examples/vite/src/main.tsx | 10 +-
examples/vite/src/vite-env.d.ts | 9 +
examples/vite/vite.config.ts | 2 +
examples/webpack-based/package.json | 3 +-
examples/webpack-based/webpack.config.js | 1 +
package.json | 19 +-
pnpm-lock.yaml | 12889 +++++++---------
scripts/detect-env.js | 1 +
src/components/fingerprint-provider.tsx | 25 +-
src/components/with-environment.tsx | 18 +-
src/detect-env.ts | 8 +-
src/get-env.ts | 2 +-
src/use-visitor-data.ts | 12 +-
src/utils/assert-is-defined.ts | 5 +
src/utils/assert-is-truthy.ts | 5 -
src/utils/use-const.ts | 7 -
src/utils/use-promise-store.ts | 19 +-
tsconfig.eslint.json | 16 +
vite.config.ts | 4 +-
45 files changed, 5985 insertions(+), 7435 deletions(-)
delete mode 100644 .eslintrc.js
create mode 100644 eslint.config.mjs
delete mode 100644 examples/preact/.eslintrc.js
delete mode 100644 examples/vite/eslint.config.js
create mode 100644 examples/vite/src/vite-env.d.ts
create mode 100644 src/utils/assert-is-defined.ts
delete mode 100644 src/utils/assert-is-truthy.ts
delete mode 100644 src/utils/use-const.ts
create mode 100644 tsconfig.eslint.json
diff --git a/.eslintrc.js b/.eslintrc.js
deleted file mode 100644
index faa669bb..00000000
--- a/.eslintrc.js
+++ /dev/null
@@ -1,31 +0,0 @@
-module.exports = {
- ignorePatterns: ['dist/', 'build/'],
- extends: [
- 'next/core-web-vitals',
- '@fingerprintjs/eslint-config-dx-team',
- 'plugin:react/recommended',
- 'plugin:react-hooks/recommended',
- ],
- parserOptions: {
- ecmaFeatures: {
- jsx: true,
- },
- },
- settings: {
- react: {
- version: 'detect',
- },
- },
- rules: {
- 'react/display-name': 'off',
- 'react/self-closing-comp': [
- 'error',
- {
- component: true,
- html: true,
- },
- ],
- 'react/react-in-jsx-scope': 'off',
- '@next/next/no-html-link-for-pages': 'off',
- },
-}
diff --git a/__tests__/fpjs-provider.test.tsx b/__tests__/fpjs-provider.test.tsx
index ba301c15..3c5efeb2 100644
--- a/__tests__/fpjs-provider.test.tsx
+++ b/__tests__/fpjs-provider.test.tsx
@@ -11,7 +11,7 @@ vi.mock('@fingerprint/agent', { spy: true })
const mockStart = vi.mocked(agent.start)
describe('FingerprintProvider', () => {
- it('should configure an instance of the Fp Agent', async () => {
+ it('should configure an instance of the Fp Agent', () => {
const loadOptions = getDefaultLoadOptions()
const wrapper = createWrapper({
cache: {
diff --git a/__tests__/helpers.tsx b/__tests__/helpers.tsx
index d799b015..94faa0fc 100644
--- a/__tests__/helpers.tsx
+++ b/__tests__/helpers.tsx
@@ -8,13 +8,16 @@ export const getDefaultLoadOptions = () => ({
export const createWrapper =
(providerProps: Partial = {}) =>
- ({ children }: PropsWithChildren<{}>) => (
+ ({ children }: PropsWithChildren
-