ember-template-lint-plugin-discourse
raw JSON → 3.0.0 verified Fri May 01 auth: no javascript
A shareable Ember template lint plugin providing a recommended ruleset for Discourse projects. Version 3.0.0 is the latest stable release. It extends ember-template-lint with Discourse-specific Handlebars/HTMLBars conventions. Unlike general lint plugins, this package enforces Discourse's custom formatting rules, making it essential for Discourse addon or theme development. Release cadence is low; updates typically track Discourse core changes.
Common errors
error Cannot find module 'ember-template-lint-plugin-discourse' ↓
cause Plugin not installed or missing in node_modules.
fix
Run npm install --save-dev ember-template-lint-plugin-discourse
error Unknown configuration extends value "discourse:recommended" ↓
cause Plugin not included in plugins array.
fix
Add 'ember-template-lint-plugin-discourse' to the plugins array in .template-lintrc.js
Warnings
gotcha The plugin must be listed in 'plugins' before using 'extends: discourse:recommended'. ↓
fix Ensure the plugin is included in the plugins array.
deprecated Older versions (<3.0) may have used a different extends value or plugin name. ↓
fix Upgrade to 3.0 and use 'discourse:recommended'.
breaking Version 3.0 drops support for Node.js 10 and older Ember versions. ↓
fix Use Node.js 12+ and Ember 3.20+.
Install
npm install ember-template-lint-plugin-discourse yarn add ember-template-lint-plugin-discourse pnpm add ember-template-lint-plugin-discourse Imports
- plugin object (default import not used) wrong
const plugin = require('ember-template-lint-plugin-discourse')correctplugins: ['ember-template-lint-plugin-discourse']; extends: 'discourse:recommended' - extend string wrong
extends: 'discourse'correctextends: 'discourse:recommended' - ES module import (if used programmatically) wrong
const plugin = require('ember-template-lint-plugin-discourse')correctimport plugin from 'ember-template-lint-plugin-discourse'
Quickstart
// Install with ember-template-lint
// npm install --save-dev ember-template-lint ember-template-lint-plugin-discourse
// .template-lintrc.js
module.exports = {
plugins: ['ember-template-lint-plugin-discourse'],
extends: 'discourse:recommended',
rules: {
// Override or add rules as needed
}
};
// Run linting
// npx ember-template-lint .