From 3d283dd202db5f2181d5de8e7cad5ed5c65e89f3 Mon Sep 17 00:00:00 2001 From: Anthony Shew Date: Mon, 25 Nov 2024 13:04:30 -0700 Subject: [PATCH] WIP --- packages/eslint-plugin-turbo/README.md | 74 +++++++++++++------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/packages/eslint-plugin-turbo/README.md b/packages/eslint-plugin-turbo/README.md index 21299b643f0f8..cc8f6367ffdb4 100644 --- a/packages/eslint-plugin-turbo/README.md +++ b/packages/eslint-plugin-turbo/README.md @@ -16,45 +16,9 @@ npm install eslint --save-dev npm install eslint-plugin-turbo --save-dev ``` -## Usage (Legacy `eslintrc*`) - -Add `turbo` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix: - -```json -{ - "plugins": ["turbo"] -} -``` - -Then configure the rules you want to use under the rules section. - -```json -{ - "rules": { - "turbo/no-undeclared-env-vars": "error" - } -} -``` - -## Example (Legacy `eslintrc*`) - -```json -{ - "plugins": ["turbo"], - "rules": { - "turbo/no-undeclared-env-vars": [ - "error", - { - "allowList": ["^ENV_[A-Z]+$"] - } - ] - } -} -``` - ## Usage (Flat Config `eslint.config.js`) -In ESLint v8, both the legacy system and the new flat config system are supported. In ESLint v9, only the new system will be supported. See the [official ESLint docs](https://eslint.org/docs/latest/use/configure/configuration-files). +ESLint v9 uses the Flat Config format seen below: ```js import turbo from "eslint-plugin-turbo"; @@ -100,3 +64,39 @@ export default [ }, ]; ``` + +## Usage (Legacy `eslintrc*`) + +Add `turbo` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix: + +```json +{ + "plugins": ["turbo"] +} +``` + +Then configure the rules you want to use under the rules section. + +```json +{ + "rules": { + "turbo/no-undeclared-env-vars": "error" + } +} +``` + +## Example (Legacy `eslintrc*`) + +```json +{ + "plugins": ["turbo"], + "rules": { + "turbo/no-undeclared-env-vars": [ + "error", + { + "allowList": ["^ENV_[A-Z]+$"] + } + ] + } +} +```