0.0.5 • Published 12 months ago

prettier-plugin-jinja-json-template v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

prettier-plugin-jinja-json-template

Formatter plugin for jinja2 json template files.

Jinja2 + json would be another one an approach

How to use with prettier standalone:

import { format } from 'prettier/standalone';
import { plugin, PLUGIN_KEY } from 'prettier-plugin-jinja-json-template';

export const formatJinjaJson = async (code: string) => {
  return await format(code, {
    parser: PLUGIN_KEY,
    plugins: [plugin],
  });
};

Install

npm install --save-dev prettier prettier-plugin-jinja-json-template
yarn add -D prettier prettier-plugin-jinja-json-template

Add the plugin to your .prettierrc:

{
  "plugins": ["prettier-plugin-jinja-json-template"]
}

Use

To format basic .json files, you'll have to override the used parser inside your .prettierrc:

{
  "overrides": [
    {
      "files": ["*.json"],
      "options": {
        "parser": "jinja-json-template"
      }
    }
  ]
}

Run it on all json jinja files in your project:

npx prettier "**/*.json.jinja" --write

If you don't have a prettier config you can run the plugin with this command:

npx prettier "**/*.json.jinja" --plugin=prettier-plugin-jinja-json-template --parser=jinja-json-template --write 
0.0.5

12 months ago

0.0.4

12 months ago

0.0.3-13

12 months ago

0.0.3-12

12 months ago

0.0.3-11

12 months ago

0.0.3-10

12 months ago

0.0.3-9

12 months ago

0.0.3-8

12 months ago

0.0.3-7

12 months ago

0.0.3-6

12 months ago

0.0.3-5

12 months ago

0.0.3-4

12 months ago

0.0.3-3

12 months ago

0.0.3-2

12 months ago

0.0.3-1

12 months ago

0.0.3-0

12 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.2-1

12 months ago

0.0.2-e-7

12 months ago

0.0.2-d-7

12 months ago

0.0.2-c-7

12 months ago

0.0.2-c.7

12 months ago

0.0.2-b.7

12 months ago

0.0.2-a.7

12 months ago

0.0.2-7

12 months ago

0.0.2-6

12 months ago

0.0.2-5

12 months ago

0.0.2-4

12 months ago

0.0.2-3

12 months ago

0.0.2-2

12 months ago

0.0.2-0

12 months ago

0.0.1

12 months ago