Xetera / ghost-cursor

🖱️ Generate human-like mouse movements with puppeteer or on any 2D plane
MIT License
1.03k stars 120 forks source link

style: add prettier for whitespace formatting #142

Closed bvandercar-vt closed 3 months ago

bvandercar-vt commented 3 months ago

Thought I'd try this out and see how it looked, since ts-standard wasn't fixing whitespaces. Just a proposal, up to the repo owners if they like this!

Niek commented 3 months ago

Hmm, I'm a bit scared prettier and standardjs (/ts-standard) will clash on some code. Is there no way to get this working by adding an extra eslint rule to the standardjs ones? Or otherwise, eslint-plugin-prettier?

bvandercar-vt commented 3 months ago

Hmm, I'm a bit scared prettier and standardjs (/ts-standard) will clash on some code. Is there no way to get this working by adding an extra eslint rule to the standardjs ones? Or otherwise, eslint-plugin-prettier?

I've seen many repos with all 3 (ts checking, eslint, and prettier), there shouldn't be any clashing I don't think?

The problem with ts-standard is you can't configure it. You can't add eslint plugins, or configure specific eslint rules. Would have to move towards regular eslint.

Niek commented 3 months ago

Hmm, I'm a bit scared prettier and standardjs (/ts-standard) will clash on some code. Is there no way to get this working by adding an extra eslint rule to the standardjs ones? Or otherwise, eslint-plugin-prettier?

I've seen many repos with all 3 (ts checking, eslint, and prettier), there shouldn't be any clashing I don't think?

The problem with ts-standard is you can't configure it. You can't add eslint plugins, or configure specific eslint rules. Would have to move towards regular eslint.

I think it's definitely possible to add extra rules and configure ts-standard. These can be added to package.json or tsconfig.eslint.json. See: https://standardjs.com/#typescript

bvandercar-vt commented 3 months ago

Hmm, I'm a bit scared prettier and standardjs (/ts-standard) will clash on some code. Is there no way to get this working by adding an extra eslint rule to the standardjs ones? Or otherwise, eslint-plugin-prettier?

I've seen many repos with all 3 (ts checking, eslint, and prettier), there shouldn't be any clashing I don't think? The problem with ts-standard is you can't configure it. You can't add eslint plugins, or configure specific eslint rules. Would have to move towards regular eslint.

I think it's definitely possible to add extra rules and configure ts-standard. These can be added to package.json or tsconfig.eslint.json. See: https://standardjs.com/#typescript

Have tried to get multiple plugins to work with ts-standard-- Nothing I've tried works. Will just close this PR. I do see how prettier has conflicting opinions with ts-standard.