herbs-cli icon indicating copy to clipboard operation
herbs-cli copied to clipboard

Herbs generated project must to born with lint

Open italojs opened this issue 4 years ago • 12 comments

I was thinking to have an option to add esLint into project

> Do you wanna use lint ? [y/N] y
- esLint
- tsLint
- jsHint

> What code style do you prefer to use?
- standard
- google
- airbnb

To start this feature, I was thinking to use only standard code style

italojs avatar Aug 19 '21 19:08 italojs

if you choose one style, the generated code will follow?

dalssoft avatar Aug 20 '21 20:08 dalssoft

Hi! We can start with one of the options. What do you think we started with eslint using the Vortx One Manager config as default. About the google and airbnb options, we can use the configuration of these packages, respectively, https://github.com/google/eslint-config-google and https://www.npmjs.com/package/eslint-config-airbnb .

maikvortx avatar Aug 30 '21 23:08 maikvortx

I like to start with a default linter, but I prefer the standard JS because it's the standard, this style guide is the more neutral, some developer don't like the airbnb style guide or google style guide but I think the most developers will accept the standardJS because it's neutral

italojs avatar Oct 12 '21 22:10 italojs

As long we choose one and the user don't have to choose, I don't really care. The choice will always be wrong since there will be always someone complaining, so let's pick one.

standard JS sounds ok to me.

dalssoft avatar Oct 12 '21 22:10 dalssoft

I'm working on it

italojs avatar May 13 '22 23:05 italojs

Standard JS sounds good for me too!

maikmb avatar Jul 05 '22 14:07 maikmb

@italojs are you still here with this issue?

jhomarolo avatar Jul 06 '22 17:07 jhomarolo

Hi @jhomarolo i'm not working on this anymore

italojs avatar Jul 11 '22 12:07 italojs

I can work on this issue.

mtperesvx avatar Jul 15 '22 17:07 mtperesvx

Given the inputs on this issue, this is how I think this feature should work:

  • Generate and specify the StandardJS by default on lint file
  • Add a script action on npm to run lint on everyfile of the project.
  • This script to lint all files should run after herbs new. This is important since the current file templates does not respect any lint or even worse (some are a real mess) and the generated file doesn't look good.

dalssoft avatar Jul 15 '22 20:07 dalssoft

@dalssoft I guess should be good to run the script (like npm run lint or lint:fix) after herbs update as well

https://github.com/herbsjs/todolist-on-herbs/blob/97c541a05c7530c769b772d650db6ff19ec2a94a/package.json#L16

jhomarolo avatar Jul 18 '22 17:07 jhomarolo

@jhomarolo makes sense

dalssoft avatar Jul 18 '22 17:07 dalssoft