Skip to content

bem/eslint-plugin-bem-xjst

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESLint environments for bem-xjst

NPM Status Travis Status

This plugin includes two ESLint environments:

  • bem-xjst/bemhtml - for BEMHTML templates
  • bem-xjst/bemtree - for BEMTREE templates

Install

You'll first need to install ESLint:

$ npm install eslint --save-dev

Note: You may install ESLint globally using the -g flag.

Next, install eslint-plugin-bem-xjst:

$ npm install eslint-plugin-bem-xjst --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-bem-xjst globally.

A globally-installed instance of ESLint can only use globally-installed ESLint plugins. A locally-installed ESLint can make use of both locally- and globally- installed ESLint plugins.

Usage

Add bem-xjst to the plugins section of your .eslintrc configuration file.

{
    "plugins": [
        "bem-xjst"
    ]
}

Note: We omitted the eslint-plugin- prefix since it is automatically assumed by ESLint.

For BEMHTML templates add the bem-xjst/bemhtml environment to .eslintrc:

{
    "env": {
        "bem-xjst/bemhtml": true
    }
}

For BEMTREE templates add the bem-xjst/bemtree environment to .eslintrc:

{
    "env": {
        "bem-xjst/bemtree": true
    }
}

License

MIT © Andrew Abramov