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 VS Code auto-formatting support for JS and non-JS files #25117

Merged
merged 5 commits into from Oct 18, 2019
Merged

🏗 Add VS Code auto-formatting support for JS and non-JS files #25117

merged 5 commits into from Oct 18, 2019

Conversation

rsimha
Copy link
Contributor

@rsimha rsimha commented Oct 17, 2019

Background:

We now run two checks on Travis to ensure code correctness / style / formatting:

  • gulp lint uses eslint to check JS files
  • gulp prettify uses prettier to check non-JS files

Travis builds often fail due to errors from these checks, which can be annoying and waste VM resources.

PR highlights:

  • Add VS Code support for auto-formatting JS and non-JS files on save using amphtml's preferred rules
  • Add a project specific .vscode/settings.json settings file
  • Document the preferred workflow to enable auto-fix-on-save behavior
  • Include files in dot directories during lint / prettify

For example, syntax highlighting + auto-correction for an OWNERS file:

Screenshot from 2019-10-17 19-28-15

Copy link
Contributor

@rcebulko rcebulko left a comment

Choose a reason for hiding this comment

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

LGTM

.vscode/settings.json Show resolved Hide resolved
contributing/getting-started-e2e.md Show resolved Hide resolved
contributing/getting-started-e2e.md Show resolved Hide resolved
Copy link
Contributor Author

@rsimha rsimha left a comment

Choose a reason for hiding this comment

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

I've verified this workflow on Linux and Mac OS. All that's left to do is a documentation review by @mrjoro.

@rsimha rsimha merged commit 880c91c into ampproject:master Oct 18, 2019
@rsimha rsimha deleted the 2019-10-15-OwnersIde branch October 18, 2019 17:06
micajuine-ho pushed a commit to micajuine-ho/amphtml that referenced this pull request Dec 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants