Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-template-lint-plugin-prettier

Package Overview
Dependencies
Maintainers
4
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-template-lint-plugin-prettier

A prettier plugin for ember-template-lint

  • 5.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.3K
increased by7.92%
Maintainers
4
Weekly downloads
 
Created
Source

ember-template-lint-plugin-prettier

NPM version

It uses Prettier to lint your handlebars templates with ember-template-lint. The plugin defines a - single - rule. That rule will compare your code with Prettier's output.

Here is an output example:

2:18  error  Replace `·{{@lastName}}··` with `{{@lastName}}`  prettier
  1 | <h1>A title</h1>
> 2 | <p>{{@firstName}}  {{@lastName}}   , welcome!</p>
  3 | <p>Text</p>

Compatibility

Note: ember-template-lint-plugin-prettier@4 is compatible with older versions of prettier, in particular prettier@2.

Note2: ember-template-lint-plugin-prettier@3 is compatible with older versions of ember-template-lint, in particular ember-template-lint@3.

Install

yarn add -D prettier ember-template-lint-plugin-prettier

As peerDependencies, prettier and ember-template-lint will have to be installed in your project. Prettier version local to the project will be used (not any global one!).

A recommended configuration is available. To use it, merge the following object to your .template-lintrc.js file:

module.exports = {
  plugins: ["ember-template-lint-plugin-prettier"],

  extends: ["recommended", "ember-template-lint-plugin-prettier:recommended"]
};

The recommended set will apply these rules.

Configuration

Prettier can be configured via standard prettier config files.

Tips

You may want to define these two scripts in your package.json:

{
  "scripts": {
    "lint:hbs": "ember-template-lint .",
    "format:hbs": "prettier **/*.hbs --write"
  }
}

yarn lint:hbs is useful in CI. yarn format:hbs will let you format your templates if your editor does not have this feature yet.

Credits

This plugin has been inspired by the prettier plugin for Eslint.

Contributing

See CONTRIBUTING.md

Keywords

FAQs

Package last updated on 13 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc