{"id":25218,"library":"ember-template-lint-plugin-css-modules","title":"ember-template-lint-plugin-css-modules","description":"An ember-template-lint plugin for enforcing best practices with ember-css-modules. Version 1.0.0 (stable) switches to ES Modules, requires Node >=12.22.0 and ember-template-lint ^4.2.0. Provides two rules: 'no-class' (disallows all class attributes) and 'static-local-class' (requires local-class values to be static strings). Differentiates from generic linting by being tailor-made for the ember-css-modules addon, ensuring modular CSS patterns are enforced at template level.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/simplabs/ember-template-lint-plugin-css-modules","tags":["javascript"],"install":[{"cmd":"npm install ember-template-lint-plugin-css-modules","lang":"bash","label":"npm"},{"cmd":"yarn add ember-template-lint-plugin-css-modules","lang":"bash","label":"yarn"},{"cmd":"pnpm add ember-template-lint-plugin-css-modules","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; plugin is designed to work with ember-template-lint >=4.2.0","package":"ember-template-lint","optional":false}],"imports":[{"note":"The plugin is referenced by package name in .template-lintrc.js; no direct import needed.","wrong":"plugins: ['ember-template-lint-plugin-css-modules/index']","symbol":"plugin","correct":"plugins: ['ember-template-lint-plugin-css-modules']"},{"note":"Rule names must be prefixed with 'css-modules/' to namespace them correctly.","wrong":"rules: { 'no-class': true }","symbol":"rules","correct":"rules: { 'css-modules/no-class': true }"},{"note":"Since v1.0.0, the package is ESM-only; require() will fail.","wrong":"const plugin = require('ember-template-lint-plugin-css-modules');","symbol":"default import (ESM)","correct":"import plugin from 'ember-template-lint-plugin-css-modules';"}],"quickstart":{"code":"// .template-lintrc.js - ESM (requires Node ES module)\nimport plugin from 'ember-template-lint-plugin-css-modules';\n\nexport default {\n  plugins: ['ember-template-lint-plugin-css-modules'],\n  rules: {\n    'css-modules/no-class': true,\n    'css-modules/static-local-class': true,\n  },\n};","lang":"javascript","description":"Shows how to configure ember-template-lint with the plugin and both available rules."},"warnings":[{"fix":"Use import syntax or dynamic import if using CommonJS project (e.g., 'const plugin = await import(...)').","message":"v1.0.0 ships as ES Module only. CommonJS require() will throw.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Upgrade Node.js to a supported major version (12.22+, 14.17+, 16+).","message":"Node.js <12.22.0 or between 13.x and 15.x may not be supported.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Upgrade ember-template-lint to v4.2.0 or higher.","message":"ember-template-lint v3 is not supported; peer dependency requires ^4.2.0","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use 'css-modules/no-class' instead of 'no-class'.","message":"Rules must be prefixed with 'css-modules/' in .template-lintrc.js","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'1.0.0':24 '12.22.0':32 '4.2.0':38 'addon':78 'attribut':48 'best':16 'class':44,47,53,57 'css':6,21,76,81 'differenti':63 'disallow':45 'ember':2,10,20,35,75 'ember-css-modul':19,74 'ember-template-lint':9,34 'ember-template-lint-plugin-css-modul':1 'enforc':15,84 'ensur':79 'es':28 'generic':65 'javascript':88 'level':87 'lint':4,12,37,66 'local':52,56 'local-class':55 'made':71 'modul':7,22,29,77 'modular':80 'no-class':42 'node':31 'pattern':82 'plugin':5,13 'practic':17 'provid':39 'requir':30,54 'rule':41 'stabl':25 'static':51,61 'static-local-class':50 'string':62 'switch':26 'tailor':70 'tailor-mad':69 'templat':3,11,36,86 'two':40 'valu':58 'version':23","created_at":"2026-05-01T13:43:38.010879+00:00","updated_at":"2026-05-01T13:43:38.010879+00:00","problems":[{"fix":"Convert project to ESM or use dynamic import: const plugin = (await import('ember-template-lint-plugin-css-modules')).default;","cause":"CommonJS project trying to require the ESM-only plugin (v1.0.0+)","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module from /path/to/ember-template-lint-plugin-css-modules/index.js not supported. Instead rename the index.js to a file of .cjs extension..."},{"fix":"Run 'npm install --save-dev ember-template-lint-plugin-css-modules' and ensure ember-template-lint ^4.2.0 is installed.","cause":"Plugin not installed or peer dependency ember-template-lint missing","error":"Cannot find module 'ember-template-lint-plugin-css-modules'"},{"fix":"Change rule key to 'css-modules/no-class' in your .template-lintrc.js.","cause":"Rule specified without the 'css-modules/' prefix","error":"Validation error: Invalid rule name 'no-class' in config. Did you mean 'css-modules/no-class'?"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/simplabs/ember-template-lint-plugin-css-modules","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/ember-template-lint-plugin-css-modules","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}