-
-
Notifications
You must be signed in to change notification settings - Fork 564
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
Switch to xo + prettier #1080
Switch to xo + prettier #1080
Conversation
}, | ||
"homepage": "https://github.com/pi-hole/AdminLTE#readme", | ||
"scripts": { | ||
"xo": "xo", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One can autofix some of the issues with npm run xo -- --fix
. If you prefer to have a separate script for this let me know how you want it named and I'll add it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be something we encourage contributors to do, or something that CI just does and pushes back to the PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is useful for people fiddling with the source code. CI will just run the normal script
2ec3cb9
to
798efc5
Compare
This will be ready after my open PRs are merged and I rebase this. So what's left is to sort out my comments, namely CI. |
84c7a55
to
934e4c6
Compare
e66b201
to
0034d10
Compare
This, I'm assuming, adds a development dependency that we did not have before, right? Namely Regards point 2, presumably this is something we can knock together on travis? What scripts would it need to run? |
53f83a2
to
f805da9
Compare
We can just use GitHub Actions CI, no need to add Travis CI. And yeah this adds Node.js as a development dependency, which I guess #1079 requires too? (and the new web repo) Do not that I have not tested this with any browser, nor the current devel branch with IE |
Actions is all voodoo to me (actually, so is any CI, if I'm being honest!) Happy to enable stuff on the repo, but will need some pointers... |
It's enabled, I can add GItHub Actions CI support here. Please also check my comment above about autofix (CC @DL6ER in case you want this or not) |
The second error might be related to the first, though. We need to fix padStart and see if the second error occurs. IE is weird in general... |
Perhaps a polyfill, per MDN? |
I think we should keep this simple. Yes, we could use a polyfill, but this one case should be easy to work around by rewriting the code. IMHO we shouldn't start adding polyfills. We just need to make sure we don't introduce any further incompatibilities and this PR will at least catch any ES5+ code, plus it will ensure consistency which is what #1079 does, but this is only for the JS part. |
Anyway, let's leave padStart for another PR. It might be simpler to add the polyfill, but if we know the number of characters we need to pad, we could probably use |
5aa09b5
to
d1c612b
Compare
2c5c381
to
57d6498
Compare
I split most of the non-stylistic changes to separate PRs. Let's keep this on hold until everything else is merged and I'll rebase and finally we can move on with this. |
All merged, go ahead. |
Use prettier for formatting. Signed-off-by: XhmikosR <[email protected]>
Signed-off-by: XhmikosR <[email protected]>
Signed-off-by: XhmikosR <[email protected]>
Signed-off-by: XhmikosR <[email protected]>
@XhmikosR I'm happy to merge this if you are happy that it is ready? |
This is ready from my side. Just keep in mind that any other JS PRs will need to be rebased and have them formatted. |
By submitting this pull request, I confirm the following:
{please fill any appropriate checkboxes, e.g: [X]}
{Please ensure that your pull request is for the 'devel' branch!}
git rebase
)git commit --signoff
)With this in place we'll have proper JS linting. It will still use prettier for the formatting part.
Notes:
Closes #1090