Skip to content

Commit

Permalink
feat: update eslint-config-turbo to support ESLint Flat Config. (#9502
Browse files Browse the repository at this point in the history
)

### Description

Adds ESLint Flat Config Support to `eslint-config-turbo`. Users will be
able to use:
```
import turboConfig from "eslint-config-turbo/flat"

export default [
  ...turboConfig
]
```

This is meant to be backwards compatible with ESLint v8, leaving the
`extends` key in place for that purpose.

### Testing Instructions

Difficult to test this, so we'll be cutting a canary shortly after to
make sure.
  • Loading branch information
anthonyshew authored Nov 22, 2024
1 parent c6a804f commit e92e99c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/eslint-config-turbo/flat/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const plugin = require("eslint-plugin-turbo");

module.exports = [
{
plugins: {
turbo: plugin,
},
rules: {
"turbo/no-undeclared-env-vars": "error",
},
},
];
4 changes: 4 additions & 0 deletions packages/eslint-config-turbo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
"eslint-config"
],
"main": "index.js",
"exports": {
"./flat": "./flat/index.js",
".": "./index.js"
},
"author": "Vercel",
"dependencies": {
"eslint-plugin-turbo": "workspace:*"
Expand Down

0 comments on commit e92e99c

Please sign in to comment.