Files
vercel__next.js/eslint.cli.config.mjs
Jiwon Choi 5d9ab72cef Add next upgrade --ai and security vulnerability coverage (#98562)
> [!TIP]
> Recommended to review commit by commit.

This PR adds `next upgrade --experimental-ai="security"` flag (alias
`--ai`), which is targeted to help users leverage agents to upgrade
their app to the safe major version when their app's Next.js version has
any security advisories.

Once the command is ran from the user, Next.js will detect the installed
agent harness in user's device, currently limited to Codex and Claude,
and will proceed with starting an agent session once approved. If it is
called within an agent session, the work will continue off within that
agent.

`next upgrade --ai` simply does two things:

- prepare the relevant context to temporary dir
- print hand off prompt, guiding to read those context

The context will guide the agent to run relevant codemods and migration
checklist to proceed. This PR is a base core of the workflow, and will
have wrappers of entry point around this. Also, will add "latest" and
"future" as follow up, which will cover the app to be always latest, and
adopt the future defaults like Cache Components.

This PR also sets up the evals infra and adds evals.
2026-09-18 00:52:20 +02:00

47 lines
1.5 KiB
JavaScript

import { defineConfig } from 'eslint/config'
import baseConfig from './eslint.config.mjs'
export default defineConfig([
{
extends: [baseConfig],
},
{
files: ['**/*.ts', '**/*.tsx'],
// This override adds type-checked rules.
// Linting with type-checked rules is very slow and needs a lot of memory,
// so we exclude non-essential files.
// NOTE: eslint.config.mjs has a config block that mirrors these
// `files`/`ignores` to override non-type-checked rules for the same set of
// files. Keep both in sync if you change the globs.
ignores: [
'bench/**/*',
// Eval fixtures are sandbox workspaces with their own package.json and
// tsconfig, not repo code — EVAL.ts files may import modules that only
// resolve inside the sandbox (e.g. @vercel/agent-eval/eval).
'evals/evals/**/*',
'evals/next-upgrade/evals/**/*',
'evals/next-upgrade/results/**/*',
'evals/next-upgrade/shared/**/*',
'examples/**/*',
'test/**/*',
'**/*.d.ts',
'turbopack/**/*',
],
languageOptions: {
parserOptions: {
project: true,
},
},
// These rules are added on top of the rules that are declared in
// the base config for the matching files.
rules: {
// TODO: enable in follow-up PR
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/switch-exhaustiveness-check': [
'error',
{ requireDefaultForNonUnion: true },
],
},
},
])