@synthetixio/synpress
in your package.json
is highly recommended to avoid unexpected issues from breaking changes. Use a specific version like "@synthetixio/synpress": "4.0.5"
rather than "@synthetixio/synpress": "^4.0.0"
.require()
to import it, and make sure your nearest package.json
contains "type": "module"
.tsconfig.json
)strict
compiler option in your tsconfig.json
:
strict: true
: This enables a wide range of type-checking rules that help catch errors early and improve code quality. It’s highly recommended for any TypeScript project.esModuleInterop: true
: This setting improves the interoperability between the different modules and is mandatory for the latest versions of Synpress.target
and module
: The settings you have are probably OK. If you are getting compilation errors, make sure, that the correct module is used."moduleResolution": "bundler"
: If you’re using a modern bundler (like Vite, Webpack, or Rollup), "bundler"
is the recommended setting.tsconfig.json
(for a Playwright project):
include
and files
arrays, that will point to all relevant files.
Example tsconfig.json
(for a Cypress project):
include
and files
arrays, that will point to all relevant files.
By following these guidelines, you’ll ensure that your Synpress project benefits from the full power of TypeScript, including strong type checking, autocompletion, and improved code maintainability.