Skip to content
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

Merged
merged 6 commits into from
Feb 5, 2025
Merged

chore: update eslint to v9 #1439

merged 6 commits into from
Feb 5, 2025

Conversation

B4nan
Copy link
Member

@B4nan B4nan commented Jan 28, 2025

Closes #1276

@B4nan B4nan requested a review from honzajavorek as a code owner January 28, 2025 11:13
@github-actions github-actions bot added this to the 107th sprint - Tooling team milestone Jan 28, 2025
@github-actions github-actions bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Jan 28, 2025
@B4nan B4nan requested review from vladfrangu and removed request for honzajavorek January 28, 2025 11:14
apify-docs-theme/src/theme/Layout/index.jsx Outdated Show resolved Hide resolved
Comment on lines +11 to +17
{
languageOptions: {
parserOptions: {
project: 'tsconfig.eslint.json',
},
},
},
Copy link
Member

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

Copy link
Member Author

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)

Copy link
Member Author

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

@B4nan B4nan requested a review from vladfrangu February 5, 2025 10:57
@B4nan B4nan merged commit dcb9aca into master Feb 5, 2025
7 checks passed
@B4nan B4nan deleted the eslint9 branch February 5, 2025 11:08
@@ -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;
Copy link
Contributor

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? 😅

Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t-tooling Issues with this label are in the ownership of the tooling team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update eslint to v9, use new flat Apify eslint config
3 participants