Skip to content

Improve code formatting in JS #656

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

Merged
merged 1 commit into from
Jul 15, 2022

Conversation

kamil-tekiela
Copy link
Member

This change only applies more consistent code formatting to the common.js file. I understand it's highly opinionated, but I do find this easier to read. This was done using TSC compiled, automatic formatted, and some manual adjustments. This PR contains no refactoring, code clean-up or any other changes to the code. It's all purely visual.

@cmb69
Copy link
Member

cmb69 commented Jul 15, 2022

Can we have that formatting automated, like we did with php-cs-fixer? We could start with only this file.

@kamil-tekiela
Copy link
Member Author

I don't know if we could automate that. We could think of simply using TSC to compile JS and commit that, but TSC removes blank lines... so in terms of readability, it's not great. I don't know what other automatic formatter we could use that would give us good results. I think there are a number of linters and different coding styles available for JavaScript. I think as a first step, what I propose is sensible. At least the formatting is more uniform in this one file, even if we don't enforce any particular coding style for JS.

Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we could use ESLint, but I'm okay with merging this PR.

TIL about "bork" :)

@kamil-tekiela kamil-tekiela merged commit 77a0620 into php:master Jul 15, 2022
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