Skip to content

Latest commit

 

History

History
84 lines (56 loc) · 2.05 KB

CONTRIBUTING.md

File metadata and controls

84 lines (56 loc) · 2.05 KB

Contributing to @garrettjohnson/prettier-plugin-lava

Requirements:

  • Node v16+
  • Yarn
git clone [email protected]/garrettjohnson/prettier-plugin-lava
yarn
yarn test

Context

There's a lot of abstract concepts that goes into making this plugin.

The source code for this plugin is in TypeScript.

Standards

  • PR should explain what the feature does, and why the change exists.
  • PR should include any carrier specific documentation explaining how it works.
  • Code should be generic and reusable.

Formating

This plugin uses prettier to format its TypeScript codebase. To format your code before a commit, run the following command:

yarn format

Testing

This prettier plugin has two suites of tests: unit tests and integration tests.

To run the unit tests:

yarn test:unit

To run the integration tests (where we make sure an input file gets transformed into another after running prettier):

yarn test:integration

To run all tests:

yarn test

To run from source on another repo or file:

# build the code so you can run it (only need to do it once)
yarn build

# run prettier on a file or folder
prettier --plugin . --write path/to/files.lava

Running from source on another code base

Adding new integration tests

  • Copy any of the folder in the test/ directory and rename it to something appropriate.
  • In the index.lava file, type code that should be made prettier
  • In the fixed.lava file, type what you'd expect the plugin to output

How to contribute

  1. Fork it ( https://github.com/garrettjohnson/prettier-plugin-lava/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request