Registry / serialization / ember-template-lint-plugin-tailwindcss

ember-template-lint-plugin-tailwindcss

JSON →
library5.1.0jsnpmunverified

An ember-template-lint plugin that enforces Tailwind CSS best practices in Ember/Glimmer templates. Current stable version is 5.1.0, released regularly with semver versioning. Ships TypeScript definitions. Key differentiators: provides two custom lint rules (class-wrap and class-order) specifically designed for Tailwind CSS utility classes, auto-detects Tailwind classes via configurable matchers, and integrates seamlessly with ember-template-lint's recommended configuration. Unlike generic HTML linters, this plugin understands Tailwind's class naming conventions and ordering preferences.

npm install ember-template-lint-plugin-tailwindcss
INSTALL
IMPORT
SIG · EMBER-TEMPLATE-LIN
E
ember-template-lint-plugin-tailwindcss
serializationjavascriptv5.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default (plugin)
✓ module.exports = { plugins: ['ember-template-lint-plugin-tailwindcss'] };
✗ const plugin = require('ember-template-lint-plugin-tailwindcss');
The plugin is auto-discovered by ember-template-lint via the plugins array; no direct require/import of the plugin itself is needed.
rules
✓ import type { LintConfig } from 'ember-template-lint';
✗ const { config } = require('ember-template-lint-plugin-tailwindcss');
Rules are configured via .template-lintrc.js, not imported directly. For TypeScript, import types from ember-template-lint.
recommended config
✓ extends: ['ember-template-lint-plugin-tailwindcss:recommended']
✗ extends: ['recommended', 'tailwindcss:recommended']
Full plugin name must be used in extends; ember-template-lint resolves it from the plugins list.

Configure ember-template-lint to use the tailwindcss plugin with recommended rules plus custom class-wrap settings.

// .template-lintrc.js module.exports = { plugins: ['ember-template-lint-plugin-tailwindcss'], extends: ['recommended', 'ember-template-lint-plugin-tailwindcss:recommended'], rules: { 'class-order': 'error', 'class-wrap': ['error', { classesPerLine: 5 }], }, };
Debug
Known issues
breakingPlugin v5 requires ember-template-lint ^4.0.0 || ^5.0.0; previous plugin v4 required ^3.0.0.
fix
Update ember-template-lint to v4 or v5 and update plugin to v5.
affects: >=5.0.0
deprecatedNode 12 and 14 are no longer supported; updated engine field to require Node >=16.
fix
Use Node 16 or newer.
affects: >=5.0.0
gotchaclass-wrap rule may conflict with ember-template-lint-plugin-prettier; both attempt to control line wrapping in class attributes.
fix
Disable class-wrap if using the prettier plugin, or disable prettier's line-length rules for templates.
affects: >=1.0.0
gotchaCustom matchers and sorters must be functions that return booleans and numbers respectively; configuration is runtime-evaluated, not serializable.
fix
Ensure matcher functions return true/false and sorter functions return negative/positive numbers correctly.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'ember-template-lint-plugin-tailwindcss'
The plugin is not installed or not listed in devDependencies.
fix
Run `yarn add -D ember-template-lint-plugin-tailwindcss` or `npm install --save-dev ember-template-lint-plugin-tailwindcss`.
Rule 'class-order' was found but has invalid configuration
The rule configuration object does not match the expected schema.
fix
Ensure rule configuration is either a boolean or an object with 'matchers', 'sorters', and 'groups' keys. See README for format.
Cannot extend unknown configuration 'ember-template-lint-plugin-tailwindcss:recommended'
The plugin is not listed in the plugins array before the extends property.
fix
Add 'ember-template-lint-plugin-tailwindcss' to the plugins array in .template-lintrc.js.
Upgrade
Version history
5.1.0latest on npm
Audit
Dependencies
ember-template-lintrequiredPeer dependency required to provide the linting framework and rule infrastructure
Agent activity
4 hits · last 30 days
node
4
Resources
ember-template-lint-plugin-tailwindcss — npm install ember-template-lint-plugin-tailwindcss · libregistry