A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.npmjs.com/package/prettier-plugin-awk below:

prettier-plugin-awk - npm

An opinionated formatter for AWK language built as a plugin for Prettier with help of tree-sitter and tree-sitter-awk.

npm install --global prettier@^2 prettier-plugin-awk

Then run:

prettier --write /path/to/your/awesome_script.awk

First you need to init new node project with:

npm init -y

Then add development dependencies:

npm add --save-dev prettier@^2 prettier-plugin-awk

Then run with:

npx prettier --write ./awesome_script.awk

You can then create pre-commit hook with something like husky or incorporate such check as CI step.

To ignore node in a syntax tree prepend it with # prettier-ignore comment like this:

# prettier-ignore
BEGIN{x=12}

More in official docs

Although most of the options are unsupported or make no sense in regard to AWK you can still configure tab or print width.

To do so create .prettierrc in your project directory with following content:

{
  "printWidth": 80,
  "tabWidth": 4
}

More in official docs


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4