eslint-plugin-turbo

raw JSON →
2.9.6 verified Sat Apr 25 auth: no javascript

Official ESLint plugin for Turborepo, providing lint rules to enforce Turborepo best practices and prevent common misconfigurations. Current stable version is 2.9.6, released alongside Turborepo. It is maintained by Vercel and follows Turborepo's release cadence: canary releases daily, stable releases weekly. Key differentiators: Tight integration with Turborepo's monorepo pipeline; rules like `no-undeclared-env-vars` help catch missing environment variable declarations early. Includes TypeScript type definitions. Requires `turbo >2.0.0` and `eslint >6.6.0`. Supports ESM and CJS.

error Error: Failed to load plugin 'turbo' declared in '...'
cause Missing 'turbo' package as peer dependency.
fix
Install turbo: npm install turbo --save-dev
error TypeError: Cannot read properties of undefined (reading 'default')
cause Using named import 'turbo' instead of default import.
fix
Use default import: import turbo from 'eslint-plugin-turbo' or require('eslint-plugin-turbo')
error ESLint couldn't determine the plugin 'turbo' uniquely.
cause Multiple versions of eslint-plugin-turbo installed in monorepo.
fix
Ensure only one version is installed, e.g., by hoisting the dependency.
deprecated The 'turbo/no-undeclared-env-vars' rule may be deprecated in future versions in favor of a more comprehensive env validation.
fix Watch release notes for migration guidance.
gotcha The plugin requires 'turbo' to be installed as a peer dependency; missing it causes runtime errors.
fix Run 'npm install turbo --save-dev' in your project.
breaking In version 2.0.0, the plugin switched from CommonJS to ESM-first; some CJS setups may break.
fix Ensure your ESLint configuration supports ESM, or use dynamic import if needed.
gotcha The 'recommended' config may not enable all rules; check documentation for additional rules.
fix Explicitly add rules like 'turbo/no-undeclared-env-vars' if needed.
npm install eslint-plugin-turbo
yarn add eslint-plugin-turbo
pnpm add eslint-plugin-turbo

Configure ESLint with the turbo plugin using the recommended config and an explicit rule.

// .eslintrc.cjs
module.exports = {
  plugins: ['turbo'],
  extends: ['plugin:turbo/recommended'],
  rules: {
    'turbo/no-undeclared-env-vars': 'error',
  },
};