Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bemlint

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bemlint

Linting module checks BEM-naming conventions in `class` attribute of the html files

  • 1.4.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
increased by225%
Maintainers
1
Weekly downloads
 
Created
Source

bemlint

This linter checks attribute class in final html files for BEM naming conventions.

Initiative cli code based on ESLint

Installation

npm install -g bemlint

Usage

bemlint test.html test2.html [options]

Options

  • --elem/--e - element delimeter, default:
bemlint test.html --elem='__'
  • --mod/--m - modifier and value delimeter, default:
bemlint test.html --mod='_'
  • --wp/--wordPattern - regex, defines proper names for blocks, default:
bemlint test.html --wp='[a-z0-9]+(?:-[a-z0-9]+)*'
  • --bp/--bem-prefixes - array of block names prefix for lint, example:
bemlint test.html --bp='['b-', 'l-', 'helper-']'
  • --f/--format - specific output format, default:
bemlint test.html --f='stylish'

Available: compact|checkstyle|html|json|table|tap|unix|visualstudio|junit|jslint-xml|html-template-message|html-template-page|html-template-result

Rules

  • dublicate - finds same classes in one attribute
  • isBlockElementInBlock - Block and his element cannot be in one place, wrong => class="b-block b-block__element
  • isBlockModNoBlock - Block mod should be paired with it's block, wrong => class="b-block_mod_val"
  • isElemModNoElement - Element mod should be paired with it's element, wrong => class="b-block__element_mod"

Versions

  • v1.2.0 - minor fixes, readme update
  • v1.1.0 - added formatters, message generator and few cli updates

Keywords

FAQs

Package last updated on 10 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc