-
Notifications
You must be signed in to change notification settings - Fork 81
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
chore: update eslint to v9 #1439
Conversation
{ | ||
languageOptions: { | ||
parserOptions: { | ||
project: 'tsconfig.eslint.json', | ||
}, | ||
}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not fully sure if this works, in my own project I had to do something like this to define tsconfig for the rules but maybe it works without it anymore
https://github.com/vladfrangu/highlight/blob/7d1a50341d175192e2cf54219d730f8d58407944/eslint.config.js#L19-L27
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i believe it does, without it i get warnings like
Error: Error while loading rule '@typescript-eslint/no-floating-promises': You have used a rule which requires type information, but don't have parserOptions set to generate type information for this file. See https://typescript-eslint.io/getting-started/typed-linting for enabling linting with type information.
Parser: typescript-eslint/parser
and before I've added the sources and examples folders it was complaining about that like
/Users/adamek/htdocs/apify/apify-docs/examples/ts-parallel-scraping/orchestrator/src/main.ts
0:0 error Parsing error: "parserOptions.project" has been provided for @typescript-eslint/parser.
The file was not found in any of the provided project(s): examples/ts-parallel-scraping/orchestrator/src/main.ts
/Users/adamek/htdocs/apify/apify-docs/examples/ts-parallel-scraping/scraper/src/main.ts
0:0 error Parsing error: "parserOptions.project" has been provided for @typescript-eslint/parser.
The file was not found in any of the provided project(s): examples/ts-parallel-scraping/scraper/src/main.ts
so i guess this is enough (and the CI confirms that)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess its because the apify eslint config is using that plugin
https://github.com/apify/apify-eslint-config/blob/master/index.js#L145
@@ -95,7 +75,7 @@ const prettifyPRLinks = () => (tree) => { | |||
const prLinkRegex = /https:\/\/github.com\/[^\s]+\/pull\/(\d+)/g; | |||
const match = prLinkRegex.exec(node.value); | |||
|
|||
if (!match) return; | |||
if (!match) return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a hunch this might be why the apify-sdk-python
docs build is stalling, as returning an index from the visitor means "continue by visiting my n-th sibling", which, with 0, might potentially cause an infinite loop.
Was this a quick eslint's consistent-return
fix, or did you have a deeper reason for this? 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this a quick eslint's consistent-return fix, or did you have a deeper reason for this? 😅
Yeah, exactly, feel free to revert that.
Mixed return types are evil, especially in vanilla JS. This is just another proof :D
Closes #1276