Re-style the javascript for gulpfile#3912
Conversation
|
Thanks for looking into this, this is definitely an improvement. I'm used to and prefer no semicolon line ends. I'm used to projects enforcing style with ESLint and an .eslintrc file, and providing lint and lint-fix scripts in package.json. The .eslintrc files I use are and the bits of package.json I'm not sure if all the dependencies are needed. What do you think about adding these scripts? |
|
@djencks I was planning to add the similar formatting eslint and prettier styling as that in camel-website. I think the code you showed is similar to that. |
|
Great! Mine is derived from Antora so is very similar. |
|
I think it would be better to have this in the .eslintrc file: /eslint semi: ["error", "never"]/ Can we remove the unused import here instead of suppressing the warning? /* eslint-disable-next-line no-unused-vars */ Unfortunately there's a merge conflict now, can you rebase on master? I think it might be clearer (if you can figure out how :-) to have the added lint-config files in one commit and the effect of running lint in a separate commit. I've found this useful for splitting commits: https://hisham.hm/2019/02/12/splitting-a-git-commit-into-one-commit-per-file/ |
|
Also, I prefer separate lint and lint-fix scripts. If lint changes the source, you have to run git status to find out if anything changed, and lint can't be run to fail the build if there are lint errors. |
|
@djencks I thought to remove it but I wanted to check if there was any importance to include it in the first place. That's why I suppressed the warning for the meanwhile. |
zregvart
left a comment
There was a problem hiding this comment.
Seems that we have one set of files missing here.
gulpfile.js. I have replaced the usage of == with === and != with !== to create a strict comparison.