eslint-plugin-turbo
TypeScript icon, indicating that this package has built-in type declarations

2.5.2 • Public • Published

eslint-plugin-turbo

Easy ESLint configuration for Turborepo

Installation

  1. You'll first need to install ESLint:
npm install eslint --save-dev
  1. Next, install eslint-plugin-turbo:
npm install eslint-plugin-turbo --save-dev

Usage (Flat Config eslint.config.js)

ESLint v9 uses the Flat Config format seen below:

import turbo from "eslint-plugin-turbo";

export default [turbo.configs["flat/recommended"]];

Otherwise, you may configure the rules you want to use under the rules section.

import turbo from "eslint-plugin-turbo";

export default [
  {
    plugins: {
      turbo,
    },
    rules: {
      "turbo/no-undeclared-env-vars": "error",
    },
  },
];

Example (Flat Config eslint.config.js)

import turbo from "eslint-plugin-turbo";

export default [
  {
    plugins: {
      turbo,
    },
    rules: {
      "turbo/no-undeclared-env-vars": [
        "error",
        {
          allowList: ["^ENV_[A-Z]+$"],
        },
      ],
    },
  },
];

Usage (Legacy eslintrc*)

Add turbo to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": ["turbo"]
}

Then configure the rules you want to use under the rules section.

{
  "rules": {
    "turbo/no-undeclared-env-vars": "error"
  }
}

Example (Legacy eslintrc*)

{
  "plugins": ["turbo"],
  "rules": {
    "turbo/no-undeclared-env-vars": [
      "error",
      {
        "allowList": ["^ENV_[A-Z]+$"]
      }
    ]
  }
}

Package Sidebar

Install

npm i eslint-plugin-turbo

Weekly Downloads

1,186,688

Version

2.5.2

License

MIT

Unpacked Size

447 kB

Total Files

5

Last publish

Collaborators

  • vercel-release-bot
  • turbobot