Copy for LLM View Markdown Ask AI about this page The eslint-config-turbo package helps you find environment variables that are used in your code that are not a part of Turborepo's hashing. Environment variables used in your source code that are not accounted for in turbo.json will be highlighted in your editor and errors will show as ESLint output.
Install eslint-config-turbo into the location where your ESLint configuration is held:
pnpm yarn npm bun nub aube
pnpm add eslint-config-turbo --filter=@repo/eslint-config yarn workspace @acme/eslint-config add eslint-config-turbo --dev npm install --save-dev eslint-config-turbo -w @acme/eslint-config cd packages/eslint-config && bun install eslint-config-turbo --dev cd packages/eslint-config && nub add eslint-config-turbo --save-dev cd packages/eslint-config && aube add eslint-config-turbo --save-dev
./packages/eslint-config/base.js import turboConfig from " eslint-config-turbo/flat " ;
export default [
... turboConfig ,
// Other configuration
] ;
You can also configure rules available in the configuration:
./packages/eslint-config/base.js import turboConfig from " eslint-config-turbo/flat " ;
export default [
... turboConfig ,
// Other configuration
{
rules : {
" turbo/no-undeclared-env-vars " : [
" error " ,
{
allowList : [ " ^ENV_[A-Z]+$ " ] ,
},
] ,
},
},
] ;
Add turbo to the extends section of your eslint configuration file. You can omit the eslint-config- prefix:
./packages/eslint-config/base.json
You can also configure rules available in the configuration:
./packages/eslint-config/base.json {
" plugins " : [ " turbo " ],
" rules " : {
" turbo/no-undeclared-env-vars " : [
" error " ,
{
" allowList " : [ " ^ENV_[A-Z]+$ " ]
}
]
}
}