-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs: eslint v9 #7909
Comments
Would definitely appreciate help on this one! I just explored this a little bit and it looks like this will be a net-positive change for Turborepo users, but haven't had time to explore figuring out the new syntax. |
Digging in between other work, FYI |
This comment was marked as spam.
This comment was marked as spam.
Is there any workaround for eslint configs like the one from Turbo that dont have a flat config yet? :) |
I recently created my own solution that works pretty well. I just created a new project and just ported over the eslint in this repo: https://github.com/ChurroC/EslintV9-with-TurboPack. This works for me but it is pretty sketch currently. |
The following flat config works great for me: import turboPlugin from 'eslint-plugin-turbo';
export default {
name: 'eslint-config-turbo (recreated flat)',
plugins: {
turbo: { rules: turboPlugin.rules },
},
rules: {
'turbo/no-undeclared-env-vars': 'error',
},
} |
I'm not sure I understood your configuration @controversial, would this export file have to be in the root of the monorepo? |
@Merieli The exported object is one configuration object A minimal standalone // eslint.config.js
import turboPlugin from 'eslint-plugin-turbo';
export default [
// ... more configuration objects ...
{
name: 'eslint-config-turbo (recreated flat)',
plugins: {
turbo: { rules: turboPlugin.rules },
},
rules: {
'turbo/no-undeclared-env-vars': 'error',
},
},
]; You’d usually include multiple such configuration objects in the top-level array |
@controversial Okay, understand... But where you installed the dependencie? Has any repository to reproduce? I am obtain erros with this config, because my linter in files do'nt work and the script to lint throw an error as bellow:
Even though eslint runs and finds errors in the files, there is something wrong with my config. |
The configuration example I shared depends on having at least I think your error is likely unrelated to |
I'm new to turborepo, should I have a single flat config file in the root dir, or a shared config that would be extended in every package like examples for the old config? |
We still recommend having a configuration file in each package for better cache hit ratios. |
turborepo/packages/eslint-plugin-turbo/lib/configs/recommended.ts Lines 13 to 19 in 3d75092
Because of the import turbo from 'eslint-plugin-turbo';
/** @type {import('eslint').Linter.Config} */
export default {
plugins: {
turbo,
},
rules: {
...turbo.configs.recommended.rules,
},
settings: {
...turbo.configs.recommended.settings,
},
}; |
So.. in the end is there a working Turborepo starter with flat ESLint config that uses multiple files (as recommended by Turborepo team) instead of root global config? Or it's just not possible? I'd like to do everything properly if possible. |
Above I had a template for flat eslint setup that uses multiple files. This was my eslint package folder: https://github.com/ChurroC/EslintV9-with-TurboPack/tree/main/packages/eslint-config. |
Just want to update quick:
Thanks for the patience everyone! |
#9515 updates READMEs and docs! Thanks, everyone! |
What is the improvement or update you wish to see?
Documentation on supporting users who have migrated to the new
eslint.config.js
config file or who want to continue to useestlintrc
but run >= v9 of eslintAiming to take a look at this myself, but flagging in case someone has more time to spend on this or a solution already
Is there any context that might help us understand?
With the recent v9 release of eslint, it now uses flat config files by default and support for the deprecated
eslintrc
config file will be removed entirely in v10Does the docs page already exist? Please link to it.
https://turbo.build/repo/docs/handbook/linting/eslint
The text was updated successfully, but these errors were encountered: