{"id":24994,"library":"bemlinter","title":"BEM Linter","description":"A CLI tool to lint BEM component isolation in CSS/SCSS files, currently at version 2.0.0-beta.8. It enforces two main rules: a CSS block file should only contain its own classes, and a CSS file should not style classes from another block. This helps maintain modularity in large-scale CSS projects. The tool supports configuration via JSON files, including options for sources, exclusions, snapshots, lower-case checks, class prefixes, file patterns, and module overrides. It requires Node.js >=6 and is published under the MIT license. Compared to other linters, bemlinter focuses specifically on BEM methodology and isolation, rather than general CSS quality or formatting.","status":"active","version":"2.0.0-beta.8","language":"javascript","source_language":"en","source_url":"https://github.com/M6Web/bemlinter","tags":["javascript","bem","lint","linter","cli"],"install":[{"cmd":"npm install bemlinter","lang":"bash","label":"npm"},{"cmd":"yarn add bemlinter","lang":"bash","label":"yarn"},{"cmd":"pnpm add bemlinter","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package is CommonJS only; ESM import will not work.","wrong":"import bemlinter from 'bemlinter'","symbol":"default","correct":"const bemlinter = require('bemlinter')"},{"note":"Named export for the lint function.","symbol":"lint","correct":"const { lint } = require('bemlinter')"},{"note":"Cli class for programmatic use; ESM import also fails.","wrong":"import { Cli } from 'bemlinter'","symbol":"Cli","correct":"const Cli = require('bemlinter').Cli"}],"quickstart":{"code":"const { lint } = require('bemlinter');\nconst result = lint('src/**/*.scss', {\n  excludeBlock: ['old-block'],\n  checkLowerCase: true\n});\nconsole.log('Errors:', result.errors);\nconsole.log('Warnings:', result.warnings);","lang":"javascript","description":"Shows programmatic usage of the lint function with configuration options."},"warnings":[{"fix":"Pin to exact version and monitor for stable releases.","message":"Package is in beta (2.0.0-beta.8). API may change before stable release.","severity":"deprecated","affected_versions":"2.0.0-beta.x"},{"fix":"Always provide a path like 'bemlinter lint *.scss'.","message":"The CLI command requires a path argument; missing it will cause a confusing error.","severity":"gotcha","affected_versions":"*"},{"fix":"Only enable snapshot if you understand its purpose and have read the docs.","message":"The 'snapshot' option is experimental; enabling it may produce unexpected behaviors.","severity":"gotcha","affected_versions":"*"},{"fix":"Migrate your bemlinter.json to the new format; see migration guide in docs.","message":"Version 2.0.0-beta.x introduced a new configuration file structure that is incompatible with version 1.x.","severity":"breaking","affected_versions":">=2.0.0-beta.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 bemlinter --save-dev' in your project.","cause":"Missing installation or global install without local install.","error":"Error: Cannot find module 'bemlinter'"},{"fix":"Replace 'import bemlinter from \"bemlinter\"' with 'const bemlinter = require(\"bemlinter\")'.","cause":"Using ESM import syntax with a CommonJS package.","error":"SyntaxError: Unexpected token import"},{"fix":"Verify the glob pattern or path; e.g., 'bemlinter lint src/**/*.scss'.","cause":"The provided path does not match any files.","error":"bemlinter: lint: no such file or directory"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}