apify-docs icon indicating copy to clipboard operation
apify-docs copied to clipboard

style: use consistent code example language markers

Open honzajavorek opened this issue 1 year ago • 4 comments

Some examples were marked as js, some as javascript, some as ts, some as typescript. I chose the verbose variant, but in fact have no strong opinion, just wanted it to be consistent.

honzajavorek avatar May 22 '24 09:05 honzajavorek

We use the short variants everywhere (at least I do), imo the long ones are mostly from the past.

B4nan avatar May 22 '24 09:05 B4nan

I have no opinion as long as syntax highlighting works correctly, but consistency is always welcome.

TC-MO avatar May 22 '24 09:05 TC-MO

We use the short variants everywhere (at least I do), imo the long ones are mostly from the past.

If that's so, I'll change it the other way around!

honzajavorek avatar May 22 '24 10:05 honzajavorek

Eslint punishing me for touching old stuff 😅

honzajavorek avatar May 22 '24 10:05 honzajavorek

apparently if we want to go for the shortest one we could change all python to py, but not sure if there is a point to it.

TC-MO avatar Jun 06 '24 12:06 TC-MO

@TC-MO I'm okay with it! I added a663e40 🐍

Apart from one (temporarily?) timeouting link somewhere else in the docs and failing ESlint I think all should be fine. I don't feel like I should fix lint errors in code as part of this PR just because I've touched the files, I'd like to keep the PR focused only on changing the code block markers.

Is it okay to merge like this?

honzajavorek avatar Jun 17 '24 07:06 honzajavorek

From lychee standpoint I'm ok, this link has been timing out multiple times on multiple pages. Not sure about ESlint maybe @B4nan can weigh in?

TC-MO avatar Jun 17 '24 07:06 TC-MO

I'll do it. Found npm run lint:code:fix, that already did half of the job.

honzajavorek avatar Jun 17 '24 09:06 honzajavorek

Okay, so I did my best, but I couldn't fix it all. I'm not proficient in TypeScript, React, or the JavaScript Apify SDK to fix stuff like "Unexpected any. Specify a different type" or "React Hook "Actor.useState" cannot be called at the top level. React Hooks must be called in a React function component or a custom React Hook function".

I'll let the build to finish, see if only these errors are left, and then I'll merge this PR.

honzajavorek avatar Jun 17 '24 09:06 honzajavorek

All green except those three linter errors. Merging!

honzajavorek avatar Jun 17 '24 09:06 honzajavorek

Apparently it fails on master too 🙀 I thought it only lints changes! Filed https://github.com/apify/apify-docs/issues/1068

honzajavorek avatar Jun 17 '24 09:06 honzajavorek