https://github.com/bem/eslint-plugin-bem-xjst
ESLint environments for bem-xjst
https://github.com/bem/eslint-plugin-bem-xjst
Last synced: 11 months ago
JSON representation
ESLint environments for bem-xjst
- Host: GitHub
- URL: https://github.com/bem/eslint-plugin-bem-xjst
- Owner: bem
- License: mit
- Created: 2016-03-22T19:36:52.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-06-22T18:48:30.000Z (about 3 years ago)
- Last Synced: 2025-05-28T09:04:53.950Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 10
- Watchers: 13
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
ESLint environments for bem-xjst
================================
[![NPM Status][npm-img]][npm]
[![Travis Status][test-img]][travis]
[npm]: https://www.npmjs.org/package/eslint-plugin-bem-xjst
[npm-img]: https://img.shields.io/npm/v/eslint-plugin-bem-xjst.svg
[travis]: https://travis-ci.org/bem/eslint-plugin-bem-xjst
[test-img]: https://img.shields.io/travis/bem/eslint-plugin-bem-xjst.svg?label=tests
This plugin includes two ESLint environments:
* `bem-xjst/bemhtml` - for [BEMHTML](https://en.bem.info/technology/bemhtml/v2/rationale/) templates
* `bem-xjst/bemtree` - for [BEMTREE](https://en.bem.info/technology/bemtree/v2/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.
```json
{
"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`:
```json
{
"env": {
"bem-xjst/bemhtml": true
}
}
```
For BEMTREE templates add the `bem-xjst/bemtree` environment to `.eslintrc`:
```json
{
"env": {
"bem-xjst/bemtree": true
}
}
```
License
-------
MIT © [Andrew Abramov](https://github.com/blond)