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 Eslint to templates #71

Open
timotius02 opened this issue Nov 4, 2022 · 7 comments
Open

Add Eslint to templates #71

timotius02 opened this issue Nov 4, 2022 · 7 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@timotius02
Copy link

Was there ever a consideration to add ESLint (specifically https://github.com/solidjs-community/eslint-plugin-solid) to these templates so that right off the bat, people who are experimenting with Solid will get yelled at when they violate important rules?

I found that when people are just dabbling with Solid, they will immediately run into issues, such as the destructuring props rule, and will just quit out of confusion.

In something like React, when violating the rule of hooks, the environment will actually error and give you explicit message that you might be doing so, so it's not without precedent.

I feel like the best way to solve this would be to add these directly into the templates people are using (especially before SolidStart full release) so that people could start immediately learning about the important Solid rules right out of the box.

P.S. I know that it's technically okay to violate certain rules but I believe those who are doing so will be smart enough to do an ESlint ignore.

@amoutonbrady
Copy link
Member

Hey! Thanks for filling out the issue 🙏🏻

At the time these starter templates were created, there was no such things as eslint plugin for Solid.
Although I totally agree with you, I've also learned on my own that not everyone is fund of eslint.

I'd love these template to be something people would only need to install stuff and not uninstall stuff if you see what I'm trying to say.

I wonder however if we couldn't add something in the README or even as postinstall script of the package.json to hint at how to setup this tooling. What do you think?

@samuelstroschein
Copy link

People could remove eslint if they don't want it.

The starter templates should probably optimize for the experience of getting started with Solid. Experiences like solidjs/solid#1521 (comment) will hurt Solid's adoption and reputation.

@timotius02
Copy link
Author

I was just thinking that, as someone who hangs out in the discord a lot, we would get a lot less questions if we had this warning built into our "get started" experience.

@samuelstroschein
Copy link

@timotius02 I agree. I was replying to @amoutonbrady :)

@joshwilsonvu
Copy link

I’d love to see the Solid ESLint plugin added to templates, but I also acknowledge there are people who don’t want to use it, and especially for newcomers we want to avoid forcing tooling setup/teardown as much as possible.

I know some initializer CLIs prompt with a series of questions like “Would you like to setup ESLint?” and I know no initializer exists yet but maybe this is an argument in favor of creating one.

I still think it’s probably more benefit than harm to include ESLint in templates. For extra safety, we could disable the reactivity rule by default, since that’s the one that most often causes frustration, and provide instructions on how to enable it.

@leventdeniz
Copy link

I wonder who the target audience for these templates might be.
As a react developer hearing about solid and wanting to try it, I see these templates as a best way to just jump right in and try things out. Especially with the current docs not covering everything (see) it is just frustrating running into reactivity issues.

I can't think of any scenario where having Eslint would hurt the experience of new solidjs devs more than it would benefit them.

For experienced devs, that use these templates, it would be a matter of removing one file and 2 - 3 lines in the package.json.
That is not enough effort to justify the worse new-developer experience (even being a experienced react-dev).

@amoutonbrady
Copy link
Member

It seems like most of you guys would like this backed in!
If anyone is up for the challenge of adding it, that'd be awesome :)

@amoutonbrady amoutonbrady added enhancement New feature or request good first issue Good for newcomers labels Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants