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

Add linting and formatting #2

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

ohheyjosh
Copy link

Knocked something together with ESLint and Prettier per issue #1

Note that I didn't add NPM scripts as I believe IDE integration is a much smoother dev experience. If you're using VS Code, here are the extensions I recommend:

@ohheyjosh
Copy link
Author

@thecodepixi Main thing I'm iffy about here is the inclusion of some ES6-ification. If that makes you uneasy for legacy compatibility purposes, I can revert that part.

@thecodepixi
Copy link
Owner

Hey! Couple things:

  • I personally prefer to use yarn for my projects (you'll notice the postversion script uses yarn). It looks like you used npm and committed the package-lock.json. Would you mind using yarn instead and adding the lockfile to .gitignore?
  • I'm on board with adding consistent formatting but this does add a lot of weight to the development environment of something fairly small (we don't even have tests for this right now lol). I wonder if there's a way we can accomplish a similar end goal (consistent formatting) with less stuff?
  • As for the ES6 thing, I'm generally neutral on it. Either way is fine.

also cc @achasveachas for his opinions

@ohheyjosh
Copy link
Author

ohheyjosh commented May 19, 2021

Sorry for dropping out of this for a bit. The command worked for me but it might be env or version specific so I'll revert the delete on that line. I'll also NPM => Yarn.

As for the linting/formatting tool weight: yeah, introducing stuff like ESLint and Prettier do add a lot of weight to a repo. It's a beef I have with JS dev in general — they're considered required adds for most projects along with Babel and Webpack but boy is that a lot of extra files and folders just to begin working.

Rome is one popular attempt to all-in-one these different bits but I haven't used it firsthand. Most team JS projects want some control over the rulesets and outputs of linting, formatting, and bundling so they all fall back to having the clutter in their repo.

I'll try to pair the branch changes down to the bare minimum to accomplish what I feel are the linting/formatting requirements this project deserves and see how it looks to you then.

Edit: there's also Standard which looks really nice and I'm gonna try that somewhere to see how it works.

@ohheyjosh
Copy link
Author

Cleaned up my bin/NPM oopsies and reduced the number of loose config files a bit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants