# Next.js Core Web Vitals

The config create-next-app ships: Next.js rules plus React, React Hooks, import and accessibility basics.

- Linter: ESLint
- Package: `eslint-config-next` (https://nextjs.org/docs/app/api-reference/config/eslint)
- Author: Vercel (official)
- Rules: 62
- Weekly downloads: 46.8M, +48.8% last quarter
- Technologies: react (33), nextjs (22), a11y (6), imports (1)

## Install

```sh
npm install -D eslint eslint-config-next
pnpm add -D eslint eslint-config-next
yarn add -D eslint eslint-config-next
bun add -d eslint eslint-config-next
```

## Config: `eslint.config.js`

```js
// eslint.config.js
import nextVitals from "eslint-config-next/core-web-vitals";

export default [
  ...nextVitals,
];
```

## Rules it enables

| Rule | Severity | Description | Reach |
| --- | --- | --- | --- |
| [react-hooks/exhaustive-deps](https://lintradar.dev/rules/react-hooks/exhaustive-deps.md) | warn | Verifies the list of dependencies for Hooks like useEffect and similar | 201.1M |
| [react-hooks/rules-of-hooks](https://lintradar.dev/rules/react-hooks/rules-of-hooks.md) | error | Enforces the Rules of Hooks | 201.1M |
| [react/jsx-no-comment-textnodes](https://lintradar.dev/rules/react/jsx-no-comment-textnodes.md) | error | Disallow comments from being inserted as text nodes | 167.2M |
| [react/jsx-no-duplicate-props](https://lintradar.dev/rules/react/jsx-no-duplicate-props.md) | error | Disallow duplicate properties in JSX | 167.2M |
| [react/no-danger-with-children](https://lintradar.dev/rules/react/no-danger-with-children.md) | error | Disallow when a DOM element is using both children and dangerouslySetInnerHTML | 166M |
| [react-hooks/error-boundaries](https://lintradar.dev/rules/react-hooks/error-boundaries.md) | error | Validates usage of error boundaries instead of try/catch for errors in child components | 165.2M |
| [react-hooks/globals](https://lintradar.dev/rules/react-hooks/globals.md) | error | Validates against assignment/mutation of globals during render, part of ensuring that side effects must render outside of render | 165.2M |
| [react-hooks/immutability](https://lintradar.dev/rules/react-hooks/immutability.md) | error | Validates against mutating props, state, and other values that are immutable | 165.2M |
| [react-hooks/incompatible-library](https://lintradar.dev/rules/react-hooks/incompatible-library.md) | warn | Validates against usage of libraries which are incompatible with memoization (manual or automatic) | 165.2M |
| [react-hooks/preserve-manual-memoization](https://lintradar.dev/rules/react-hooks/preserve-manual-memoization.md) | error | Validates that existing manual memoized is preserved by the compiler. React Compiler will only compile components and hooks if its inference matches or exceeds the existing manual memoization | 165.2M |
| [react-hooks/purity](https://lintradar.dev/rules/react-hooks/purity.md) | error | Validates that components/hooks are pure by checking that they do not call known-impure functions | 165.2M |
| [react-hooks/refs](https://lintradar.dev/rules/react-hooks/refs.md) | error | Validates correct usage of refs, not reading/writing during render. See the "pitfalls" section in `useRef()` usage | 165.2M |
| [react-hooks/set-state-in-effect](https://lintradar.dev/rules/react-hooks/set-state-in-effect.md) | error | Validates against calling setState synchronously in an effect. This can indicate non-local derived data, a derived event pattern, or improper external data synchronization. | 165.2M |
| [react-hooks/set-state-in-render](https://lintradar.dev/rules/react-hooks/set-state-in-render.md) | error | Validates against setting state during render, which can trigger additional renders and potential infinite render loops | 165.2M |
| [react-hooks/static-components](https://lintradar.dev/rules/react-hooks/static-components.md) | error | Validates that components are static, not recreated every render. Components that are recreated dynamically can reset state and trigger excessive re-rendering | 165.2M |
| [react-hooks/unsupported-syntax](https://lintradar.dev/rules/react-hooks/unsupported-syntax.md) | warn | Validates against syntax that we do not plan to support in React Compiler | 165.2M |
| [react-hooks/use-memo](https://lintradar.dev/rules/react-hooks/use-memo.md) | error | Validates usage of the useMemo() hook against common mistakes. See `useMemo()` docs for more information. | 165.2M |
| [react-hooks/config](https://lintradar.dev/rules/react-hooks/config.md) | error | Validates the compiler configuration options | 165.2M |
| [react-hooks/gating](https://lintradar.dev/rules/react-hooks/gating.md) | error | Validates configuration of gating mode | 165.2M |
| [react/no-string-refs](https://lintradar.dev/rules/react/no-string-refs.md) | error | Disallow using string references | 163.2M |
| [react/no-children-prop](https://lintradar.dev/rules/react/no-children-prop.md) | error | Disallow passing of children as props | 161.9M |
| [react/no-render-return-value](https://lintradar.dev/rules/react/no-render-return-value.md) | error | Disallow usage of the return value of ReactDOM.render | 161.9M |
| [react/jsx-key](https://lintradar.dev/rules/react/jsx-key.md) | error | Disallow missing `key` props in iterators/collection literals | 158.5M |
| [jsx-a11y/alt-text](https://lintradar.dev/rules/jsx-a11y/alt-text.md) | warn | Enforce all elements that require alternative text have meaningful information to relay back to end user. | 149.9M |
| [jsx-a11y/aria-props](https://lintradar.dev/rules/jsx-a11y/aria-props.md) | warn | Enforce all `aria-*` props are valid. | 149.9M |
| [jsx-a11y/aria-proptypes](https://lintradar.dev/rules/jsx-a11y/aria-proptypes.md) | warn | Enforce ARIA state and property values are valid. | 149.9M |
| [jsx-a11y/aria-unsupported-elements](https://lintradar.dev/rules/jsx-a11y/aria-unsupported-elements.md) | warn | Enforce that elements that do not support ARIA roles, states, and properties do not have those attributes. | 149.9M |
| [jsx-a11y/role-has-required-aria-props](https://lintradar.dev/rules/jsx-a11y/role-has-required-aria-props.md) | warn | Enforce that elements with ARIA roles must have all required attributes for that role. | 149.9M |
| [jsx-a11y/role-supports-aria-props](https://lintradar.dev/rules/jsx-a11y/role-supports-aria-props.md) | warn | Enforce that elements with explicit or implicit roles defined contain only `aria-*` properties supported by that `role`. | 149.9M |
| [react/jsx-no-undef](https://lintradar.dev/rules/react/jsx-no-undef.md) | error | Disallow undeclared variables in JSX | 136.7M |
| [react/no-is-mounted](https://lintradar.dev/rules/react/no-is-mounted.md) | error | Disallow usage of isMounted | 135.4M |
| [react/require-render-return](https://lintradar.dev/rules/react/require-render-return.md) | error | Enforce ES5 or ES6 class for returning value in render function | 135.4M |
| [react/jsx-uses-react](https://lintradar.dev/rules/react/jsx-uses-react.md) | error | Disallow React to be incorrectly marked as unused | 132.6M |
| [react/jsx-uses-vars](https://lintradar.dev/rules/react/jsx-uses-vars.md) | error | Disallow variables used in JSX to be incorrectly marked as unused | 132.6M |
| [react/no-direct-mutation-state](https://lintradar.dev/rules/react/no-direct-mutation-state.md) | error | Disallow direct mutation of this.state | 132M |
| [react/no-find-dom-node](https://lintradar.dev/rules/react/no-find-dom-node.md) | error | Disallow usage of findDOMNode | 131.4M |
| [react/no-unescaped-entities](https://lintradar.dev/rules/react/no-unescaped-entities.md) | error | Disallow unescaped HTML entities from appearing in markup | 131.4M |
| [react/no-deprecated](https://lintradar.dev/rules/react/no-deprecated.md) | error | Disallow usage of deprecated methods | 131.4M |
| [nextjs/google-font-display](https://lintradar.dev/rules/nextjs/google-font-display.md) | warn | Enforce font-display behavior with Google Fonts. | 130.3M |
| [nextjs/google-font-preconnect](https://lintradar.dev/rules/nextjs/google-font-preconnect.md) | warn | Ensure `preconnect` is used with Google Fonts. | 130.3M |
| [nextjs/inline-script-id](https://lintradar.dev/rules/nextjs/inline-script-id.md) | error | Enforce `id` attribute on `next/script` components with inline content. | 130.3M |
| [nextjs/no-document-import-in-page](https://lintradar.dev/rules/nextjs/no-document-import-in-page.md) | error | Prevent importing `next/document` outside of `pages/_document.js`. | 130.3M |
| [nextjs/no-head-element](https://lintradar.dev/rules/nextjs/no-head-element.md) | warn | Prevent usage of `<head>` element. | 130.3M |
| [nextjs/no-head-import-in-document](https://lintradar.dev/rules/nextjs/no-head-import-in-document.md) | error | Prevent usage of `next/head` in `pages/_document.js`. | 130.3M |
| [nextjs/no-img-element](https://lintradar.dev/rules/nextjs/no-img-element.md) | warn | Prevent usage of `<img>` element due to slower LCP and higher bandwidth. | 130.3M |
| [nextjs/no-unwanted-polyfillio](https://lintradar.dev/rules/nextjs/no-unwanted-polyfillio.md) | warn | Prevent duplicate polyfills from Polyfill.io. | 130.3M |
| [react/display-name](https://lintradar.dev/rules/react/display-name.md) | error | Disallow missing displayName in a React component definition | 128M |
| [nextjs/no-sync-scripts](https://lintradar.dev/rules/nextjs/no-sync-scripts.md) | error | Prevent synchronous scripts. | 101.8M |
| [nextjs/next-script-for-ga](https://lintradar.dev/rules/nextjs/next-script-for-ga.md) | warn | Prefer `@next/third-parties/google` when using the inline script for Google Analytics and Tag Manager. | 99.7M |
| [nextjs/no-async-client-component](https://lintradar.dev/rules/nextjs/no-async-client-component.md) | warn | Prevent Client Components from being async functions. | 99.7M |
| [nextjs/no-before-interactive-script-outside-document](https://lintradar.dev/rules/nextjs/no-before-interactive-script-outside-document.md) | warn | Prevent usage of `next/script`'s `beforeInteractive` strategy outside of `pages/_document.js`. | 99.7M |
| [nextjs/no-assign-module-variable](https://lintradar.dev/rules/nextjs/no-assign-module-variable.md) | error | Prevent assignment to the `module` variable. | 99.7M |
| [nextjs/no-css-tags](https://lintradar.dev/rules/nextjs/no-css-tags.md) | warn | Prevent manual stylesheet tags. | 99.7M |
| [nextjs/no-duplicate-head](https://lintradar.dev/rules/nextjs/no-duplicate-head.md) | error | Prevent duplicate usage of `<Head>` in `pages/_document.js`. | 99.7M |
| [nextjs/no-html-link-for-pages](https://lintradar.dev/rules/nextjs/no-html-link-for-pages.md) | error | Prevent usage of `<a>` elements to navigate to internal Next.js pages. | 99.7M |
| [nextjs/no-page-custom-font](https://lintradar.dev/rules/nextjs/no-page-custom-font.md) | warn | Prevent page-only custom fonts. | 99.7M |
| [nextjs/no-script-component-in-head](https://lintradar.dev/rules/nextjs/no-script-component-in-head.md) | error | Prevent usage of `next/script` in `next/head` component. | 99.7M |
| [nextjs/no-styled-jsx-in-document](https://lintradar.dev/rules/nextjs/no-styled-jsx-in-document.md) | warn | Prevent usage of `styled-jsx` in `pages/_document.js`. | 99.7M |
| [nextjs/no-title-in-document-head](https://lintradar.dev/rules/nextjs/no-title-in-document-head.md) | warn | Prevent usage of `<title>` with `Head` component from `next/document`. | 99.7M |
| [nextjs/no-typos](https://lintradar.dev/rules/nextjs/no-typos.md) | warn | Prevent common typos in Next.js data fetching functions. | 99.7M |
| [nextjs/no-location-assign-relative-destination](https://lintradar.dev/rules/nextjs/no-location-assign-relative-destination.md) | warn | Prevent usage of `location.assign` or `location.href` assignment to navigate to internal Next.js pages. | 99.7M |
| [import/no-anonymous-default-export](https://lintradar.dev/rules/import/no-anonymous-default-export.md) | warn | Forbid anonymous values as default exports. | 50.9M |

---

Web page: https://lintradar.dev/presets/next-core-web-vitals. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
