Thank you so much for your contributions!
If you find a bug, please open an issue to describe it. If you can also open a PR with a failing test, that would be awesome.
Currently there are several HACK
s and FIXME
s in the code. If you happen to find a bug, it might be worthwhile to look through those to see if they might be the culprit.
Find me on the Ember Discord at hm_krystan#0533
if I don't respond to your issue in a timely manner.
-
Ensure you have the following set up in your development environment:
-
Fork this repo and pull.
-
Install dependencies:
pnpm install --recursive
-
Run the tests to ensure your development environment is working properly:
Watch mode:
pnpm test
Single run:
pnpm test:run
Watch mode with a cute UI in the browser:
pnpm test:ui
We love pull requests. Here's a quick guide:
-
Follow the Development guide above to set up your environment.
-
Add a test for your change. Only refactoring and documentation changes require no new tests. If you are adding functionality or fixing a bug, we need a test! The best tests will fail without your code and pass with it. See the Tests section below for tips on writing tests.
-
Make the test pass. See the Examples section below for a useful development workflow.
-
Update the README, etc, as necessary if the documentation is affected by your change.
-
Ensure that the linters and Prettier pass:
To lint:
pnpm lint
To run auto-fix:
pnpm lint:fix
-
Commit your changes. Please include a useful commit message. If your pull request fixes an issue, specify the issue number in the commit message (e.g.
FIXES #123
). -
Push to your fork and submit a pull request. Please provide us with some explanation of why you made the changes you made. For new features make sure to explain a standard use case to us.
-
Find me on the Ember Discord at
hm_krystan#0533
if I don't respond to your pull request in a timely manner.
NOTE: Partially copied from https://github.com/emberjs/ember.js/blob/master/CONTRIBUTING.md
-
Follow the Development guide above to set up your environment.
-
Edit
example.gjs
orexample.gts
to make the ugliest component file you can think of. -
Run
pnpm run example
orpnpm run example-ts
to prettify your ugly file. 😍 (Note thatrun example
will also build the project, so it may take a second.) -
Don't commit your changes to the example files.
Most of the tests are generated by formatting example files from the cases
directory and comparing the output to Vitest snapshots.
To add a new case, add your case file(s) in the appropriate place(s) here: https://github.com/gitKrystan/prettier-plugin-ember-template-tag/tree/main/tests/cases
New cases will be tested against a variety of configs. If you also want to test against for "ambiguous expressions" issues as described here, you can include the comment /*AMBIGUOUS*/
anywhere in your test cases and it will be replaced by the ambiguous cases listed here in a variety of generated tests. If you find a new ambiguous case, add it to that list.
Once you make your changes and/or add new cases pnpm test:run -u
to update the snapshots then carefully inspect the results to ensure the output matches your expectations.
Prettier plugin development documentation
Ember Template Imports method to preprocess embedded templates
Sample AST and Prettier doc for preprocessed embedded templates