Conformance Rules
Learn how Conformance improves collaboration, productivity, and software quality at scale.Table of Contents
Conformance is available on Enterprise plans
This page lists all the built-in rules that Conformance will check for by default in your application.
These Conformance rules catch common issues that can happen in Next.js applications.
Test Name | Description |
---|---|
ESLINT_NEXT_RULES_REQUIRED | Requires that ESLint is configured for Next.js. |
NEXTJS_MISSING_MODULARIZE_IMPORTS | Requires that Next.js applications that use libraries with barrel exports use modularizeImports to minimize impact on dev compilation speed and bundle size. |
NEXTJS_MISSING_OPTIMIZE_PACKAGE_IMPORTS | Requires that Next.js applications that use libraries with barrel exports use optimizePackageImports to minimize impact on dev compilation speed and bundle size. |
NEXTJS_MISSING_NEXT13_TYPESCRIPT_PLUGIN | Applications using Next 13 should use the "next" TypeScript plugin for an improved Next.js experience. |
NEXTJS_MISSING_REACT_STRICT_MODE | Applications using Next.js should enable React Strict Mode to identify unsafe lifecycles and legacy API usage. |
NEXTJS_MISSING_SECURITY_HEADERS | Requires that important security headers are set correctly for Next.js apps and contain valid directives. |
NEXTJS_NO_ASYNC_LAYOUT | Ensures that the exported Next.js layout component and its transitive dependencies are not asynchronous, as that can block the rendering of the layout and the rest of the page. |
NEXTJS_NO_ASYNC_PAGE | Ensures that the exported Next.js page component and its transitive dependencies are not asynchronous, as that blocks the rendering of the page. |
NEXTJS_NO_BEFORE_INTERACTIVE | Requires review of usage of the beforeInteractive strategy in Script (next/script ) elements as this can cause performance issues. |
NEXTJS_NO_CLIENT_DEPS_IN_MIDDLEWARE | Disallows dependencies on client libraries to improve bundle size and execution time of Next.js middleware. |
NEXTJS_NO_DYNAMIC_AUTO | Prevent usage of force-dynamic as a dynamic page rendering strategy. |
NEXTJS_NO_FETCH_IN_SERVER_PROPS | Prevent relative fetch calls in getServerSideProps from being added to Next.js applications. |
NEXTJS_NO_GET_INITIAL_PROPS | Requires any use of getInitialProps in Next.js pages be reviewed and approved, and encourages using getServerSideProps or getStaticProps instead. |
NEXTJS_NO_PRODUCTION_SOURCE_MAPS | Applications using Next.js should not enable production source maps so that they don't publicly share source code. |
NEXTJS_NO_SELF_HOSTED_VIDEOS | Prevent video files from being added to Next.js applications to improve performance and bandwidth usage. |
NEXTJS_NO_TURBO_CACHE | Prevent Turborepo from caching the Next.js .next/cache folder to prevent an oversized cache. |
NEXTJS_REQUIRE_EXPLICIT_DYNAMIC | Requires explicitly setting the dynamic route segment option for Next.js pages and routes. |
NEXTJS_SAFE_NEXT_PUBLIC_ENV_USAGE | Usage process.env.NEXTPUBLIC* environment variables must be allowlisted. |
NEXTJS_SAFE_SVG_IMAGES | Prevent dangerouslyAllowSVG without Content Security Policy in Next.js applications. |
NEXTJS_SAFE_URL_IMPORTS | Prevent unsafe URL Imports from being added to Next.js applications. |
NEXTJS_UNNEEDED_GET_SERVER_SIDE_PROPS | Catches usages of getServerSideProps that could use static rendering instead, improving the performance of those pages. |
NEXTJS_USE_NATIVE_FETCH | Requires using native fetch which Next.js provides, removing the need for third-party fetch libraries. |
NEXTJS_USE_NEXT_FONT | Requires using next/font (when possible), which optimizes fonts for improved privacy and performance. |
NEXTJS_USE_NEXT_IMAGE | Requires that next/image is used for all images for improved performance. |
NEXTJS_USE_NEXT_SCRIPT | Requires that next/script is used for all scripts for improved performance. |
NO_FETCH_FROM_MIDDLEWARE | Requires that any fetch call that is depended on transitively by Next.js middleware be reviewed and approved before use for performance reasons. |
REACT_NO_STATIC_IMPORTS_IN_EVENT_HANDLERS | Prevent static imports that are referenced only in React event handlers from being eagerly loaded in React components. |
Last updated on July 23, 2024
Was this helpful?