.opencode/skills/nx-import/references/TURBOREPO.md
Turborepo monorepos ship with internal workspace packages that share configuration:
@repo/typescript-config (or similar) — tsconfig files (base.json, nextjs.json, react-library.json, etc.)@repo/eslint-config (or similar) — ESLint config files and all ESLint plugin dependenciesThese are not code libraries. They distribute config via Node module resolution (e.g., "extends": "@repo/typescript-config/nextjs.json"). This is the default Turborepo pattern — expect it in virtually every Turborepo import. Package names vary — check package.json files to identify the actual names.
Before doing any config merging, check whether the destination workspace uses shared root configuration. This decides how to handle the config packages.
tsconfig.base.json and/or root eslint.config.mjs that projects extend, merge the config packages into these root configs (see steps below).turbo.json, eslint-plugin-turbo) and leave the config packages in place, or ask the user how they want to handle them.If unclear, check for the presence of tsconfig.base.json at the root or ask the user.
The config package contains a hierarchy of tsconfig files. Each project extends one via package name.
nextjs.json extends base.json).tsconfig.base.json — absorb compilerOptions from the base config. Add Nx paths for cross-project imports (Turborepo doesn't use path aliases, Nx relies on them).tsconfig.json:
"extends" from "@repo/typescript-config/<variant>.json" to the relative path to root tsconfig.base.json."module": "ESNext", "moduleResolution": "Bundler", "jsx": "preserve", "noEmit": true; React library: "jsx": "react-jsx").outDir, include, exclude, etc.).devDependencies.The config package centralizes ESLint plugin dependencies and exports composable flat configs.
eslint.config.mjs — absorb base rules (JS recommended, TypeScript-ESLint, Prettier, etc.). Drop eslint-plugin-turbo.eslint.config.mjs — switch from importing @repo/eslint-config/<variant> to extending the root config, adding framework-specific plugins inline.devDependencies.@nx/eslint plugin is configured with inferred targets, remove "lint" scripts from project package.json files.devDependencies.turbo, eslint-plugin-turbo.turbo.json files (root and per-package).nx run-many -t build lint test typecheck) to confirm nothing broke.@repo/...) to relative paths (../../tsconfig.base.json).Helpful docs: