{"id":25225,"library":"ember-template-lint","title":"ember-template-lint","description":"Linter for Ember or Handlebars templates, version 7.9.3. Released regularly with monthly minor/patch updates. It provides over 100 built-in rules covering accessibility, styling, and best practices, with presets for recommended, stylistic, and a11y. Key differentiator: first-class integration with Ember projects, auto-fix support, and plugin architecture. Unlike generic HTML linters, it understands Handlebars syntax and Ember-specific patterns like components and modifiers. Requires Node ^18.18.0 || >=20.9.0.","status":"active","version":"7.9.3","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/ember-template-lint/ember-template-lint","tags":["javascript","ember","ember.js","handlebars","lint","linter"],"install":[{"cmd":"npm install ember-template-lint","lang":"bash","label":"npm"},{"cmd":"yarn add ember-template-lint","lang":"bash","label":"yarn"},{"cmd":"pnpm add ember-template-lint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Manages todo comments for lint results","package":"@ember-template-lint/todo-utils","optional":false},{"reason":"Used for colored terminal output","package":"chalk","optional":false},{"reason":"Parses and transforms handlebars templates","package":"ember-template-recast","optional":false}],"imports":[{"note":"Default export; ESM import preferred. CommonJS require is still supported for backward compatibility.","wrong":"const Linter = require('ember-template-lint')","symbol":"Linter","correct":"import Linter from 'ember-template-lint'"},{"note":"CommonJS destructured import works; direct property access also works but less idiomatic.","wrong":"const Linter = require('ember-template-lint').Linter","symbol":"Linter","correct":"const { Linter } = require('ember-template-lint')"},{"note":"Utility to load and merge config files.","symbol":"getConfig","correct":"import { getConfig } from 'ember-template-lint'"},{"note":"List of rule names that support auto-fix.","symbol":"FIXABLE_RULES","correct":"import { FIXABLE_RULES } from 'ember-template-lint'"}],"quickstart":{"code":"// Create .template-lintrc.js\n'use strict';\n\nmodule.exports = {\n  extends: 'recommended',\n  rules: {\n    'no-bare-strings': true,\n  },\n};\n\n// Run lint via CLI\n// npx ember-template-lint .\n\n// Or use programmatic API\nimport Linter from 'ember-template-lint';\n\nconst linter = new Linter();\nconst results = await linter.verify({\n  source: '<div>A bare string</div>',\n  filePath: 'app/templates/application.hbs',\n  config: {\n    rules: {\n      'no-bare-strings': true,\n    },\n  },\n});\n\nconsole.log(results);\n// [\n//   {\n//     rule: 'no-bare-strings',\n//     severity: 2,\n//     filePath: 'app/templates/application.hbs',\n//     message: 'Non-translated string used',\n//     line: 1,\n//     column: 5\n//   }\n// ]\n\n// Auto-fix\nimport { verifyAndFix } from 'ember-template-lint';\nconst fixed = await verifyAndFix({\n  source: '<div>A bare string</div>',\n  filePath: 'app/templates/application.hbs',\n  config: {\n    rules: {\n      'no-bare-strings': 'fix',\n    },\n  },\n});","lang":"javascript","description":"Setup config file, run CLI, use programmatic API to lint and fix a template."},"warnings":[{"fix":"Upgrade Node.js to ^18.18.0 || ^20.9.0 || >=21.1.0.","message":"Node.js versions <18.18.0 or <20.9.0 are no longer supported as of v7.0.0.","severity":"breaking","affected_versions":">=7.0.0"},{"fix":"Pass config object directly, or use `getConfig` to load from file.","message":"The `config` option in the Linter constructor no longer accepts a file path string; must be an object.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Replace rule name in config.","message":"Rule `no-unnecessary-curly-strings` deprecated in favor of `no-curly-component-invocation`.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Use `await linter.verify(...)`.","message":"`Linter.verify()` is async; forgetting `await` results in a Promise object.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Ensure unique rule names or use plugin namespacing.","message":"Rules with the same name from different plugins may conflict; later plugin overrides earlier.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Use `ember-template-lint --format=json`.","message":"The `--json` flag is deprecated in favor of `--format=json`","severity":"deprecated","affected_versions":">=5.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `npm install --save-dev ember-template-lint` or check your node_modules.","cause":"Package not installed or path resolution issue.","error":"Cannot find module 'ember-template-lint'"},{"fix":"Add `'no-bare-strings': true` to rules in config file.","cause":"Rule not enabled in .template-lintrc.js or used outside a project.","error":"Rule 'no-bare-strings' is not configured."},{"fix":"Increase file descriptor limit (e.g., `ulimit -n 4096`) or lint fewer files at once.","cause":"Max file descriptors reached when linting many files.","error":"Error: EMFILE: too many open files"},{"fix":"Load config with `require` or use `getConfig` and pass the object.","cause":"Passing deprecated string path to Linter constructor.","error":"The `config` option must be an object, not a string"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}