Lint, autocomplete, and generate types for CSS Modules. Version 1.0.3 runs on Node >=20 and supports TypeScript, Vite, and ESLint. Includes a TypeScript Language Service Plugin for real-time diagnostics, Vite plugin for automatic .d.ts generation, and an ESLint plugin with undefined/unused class rules. Differentiators include unified tooling for both type generation and linting, CLI for CI integration, and support for SCSS, CSS, and Less modules.
npm install css-modules-lintNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Full setup with init command, manual configurations for TypeScript, Vite, ESLint, .gitignore, and CI script.
Update Node, TypeScript, ESLint, or Vite to the required versions.
Migrate ESLint config to flat config and use ESM imports (e.g., import cssModulesLint from 'css-modules-lint/eslint').
After adding plugin to tsconfig.json, reload the TypeScript language server (e.g., VS Code: Ctrl+Shift+P -> TypeScript: Reload Project).
Prefer using the Vite plugin cssModulesDts() for automatic generation during dev/build; CLI generate is still valid for CI.
Add *.module.scss.d.ts, *.module.css.d.ts, *.module.less.d.ts to .gitignore.
Use import statement: import cssModulesLint from 'css-modules-lint/eslint'; and ensure package.json has "type": "module" or file extension .mjs.
Ensure tsconfig.json has: "plugins": [{ "name": "css-modules-lint" }] (not 'css-modules-lint/typescript' or other paths).Upgrade to ESLint >=9 and use eslint.config.js with import syntax.
Change import to: import cssModulesDts from 'css-modules-lint/vite'; (not named import).