Setting up Turborepo with pnpm and shared TypeScript and ESLint configs #5165
-
Goals:
Current setup:Here's the repo that contains a simplified version of the setup I have: https://github.com/wujekbogdan/turbo-eslint-typescript
IssuesThis setup used to work fine before, when I used In ESlint config I have the following section: // packages/eslint-config/index.js
{
// ...
parserOptions: {
tsconfigRootDir: __dirname,
project:[
'./tsconfig.eslint.json',
'./tsconfig.json',
],
},
} Which, to my understanding, means that This is how // apps/my-app/.eslitrc.js
module.exports = {
root: true,
extends: ['@my-namespace/eslint-config'],
}; So, If I get it right, It doesn't work though. I'm getting the following error:
PS WorkaroundA workaround is to remove the module.exports = {
root: true,
extends: ['@flo/eslint-config-custom'],
// Each package in monorepo needs this section:
parserOptions: {
tsconfigRootDir: __dirname,
project: 'tsconfig.json',
},
}; It works, but I'm not a big fan of this solution, especially considering that it used to work fine with yarn |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You're correct! The way you've solved it is great! I wouldn't call it a workaround at all. Rather, it's mostly "how ESLint and typescript-eslint work". However, with ESLint's new coming-soon "flat configs", this will look a lot different soon. |
Beta Was this translation helpful? Give feedback.
You're correct!
pnpm
has tighter symlinking for packages thanyarn
so modules don't leak.The way you've solved it is great! I wouldn't call it a workaround at all. Rather, it's mostly "how ESLint and typescript-eslint work". However, with ESLint's new coming-soon "flat configs", this will look a lot different soon.