prettier-plugin-jinks
v1.0.0
Published
Prettier plugin for Jinks Templating files
Downloads
16
Readme
Prettier for Jinks
prettier-plugin-jinks is a prettier plugin for Jinks
Templating. prettier is an opinionated code
formatter that supports multiple languages and integrates with most editors. The idea is to
eliminate discussions of style in code review and allow developers to get back to thinking about
code design instead.
Getting started
To run prettier with the XQuery plugin, you're going to need
node.
If you're using the npm CLI, then add the plugin by:
npm install --save-dev prettier prettier-plugin-jinksOr if you're using yarn, then add the plugin by:
yarn add --dev prettier prettier-plugin-jinksThe prettier executable is now installed and ready for use:
npx prettier --plugin=prettier-plugin-jinks --write '**/*.tpl.*'Add a .prettierrc.js to save the configuration
import prettierPluginJinks from 'prettier-plugin-jinks';
/**
* @type {import('prettier').Config}
*/
const config = {
useTabs: true,
printWidth: 120,
plugins: [prettierPluginJinks],
};
export default config;Configuration
| API Option | CLI Option | Default | Description |
| -------------------------- | ------------------------------ | :----------: | ------------------------------------------------------------------------------------------------------------------------ |
| printWidth | --print-width | 80 | Same as in Prettier (see prettier docs).
| tabWidth | --tab-width | 2 | Same as in Prettier (see prettier docs).
| useTabs | --use-tabs | false | Same as in Prettier (see prettier docs).
Any of these can be added to your existing prettier configuration file. For example:
{
"tabWidth": 4,
"plugins": ["prettier-plugin-jinks"]
}Or, they can be passed to prettier as arguments:
prettier --plugin=prettier-plugin-jinks --tab-width 4 --write '**/*.tpl.*'Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/drrataplan/prettier-plugin-jinks.
License
The package is available as open source under the terms of the MIT License.
