Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/platinumazure/eslint-plugin-microtemplates
ESLint plugin for processing files that use Resig-style microtemplates (including Underscore.js and Lodash).
https://github.com/platinumazure/eslint-plugin-microtemplates
Last synced: 11 days ago
JSON representation
ESLint plugin for processing files that use Resig-style microtemplates (including Underscore.js and Lodash).
- Host: GitHub
- URL: https://github.com/platinumazure/eslint-plugin-microtemplates
- Owner: platinumazure
- License: mit
- Created: 2015-12-26T19:12:41.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-05T21:31:22.000Z (over 8 years ago)
- Last Synced: 2024-08-04T00:06:14.768Z (3 months ago)
- Language: JavaScript
- Size: 31.3 KB
- Stars: 4
- Watchers: 5
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-eslint - Microtemplates
README
# eslint-plugin-microtemplates
[![Build Status](https://travis-ci.org/platinumazure/eslint-plugin-microtemplates.svg?branch=master)](https://travis-ci.org/platinumazure/eslint-plugin-microtemplates)
[![npm](https://img.shields.io/npm/v/eslint-plugin-microtemplates.svg)](https://www.npmjs.com/package/eslint-plugin-microtemplates)
[![npm](https://img.shields.io/npm/dm/eslint-plugin-microtemplates.svg)](https://www.npmjs.com/package/eslint-plugin-microtemplates)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT)
[![Join the chat at https://gitter.im/platinumazure/eslint-plugin-microtemplates](https://badges.gitter.im/platinumazure/eslint-plugin-microtemplates.svg)](https://gitter.im/platinumazure/eslint-plugin-microtemplates?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)ESLint plugin for linting Resig-style microtemplate strings.
## Installation
You'll first need to install [ESLint](http://eslint.org):
```
$ npm i eslint --save-dev
```Next, install `eslint-plugin-microtemplates`:
```
$ npm install eslint-plugin-microtemplates --save-dev
```**Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `eslint-plugin-microtemplates` globally.
## Usage
### Basic Configuration
Add `microtemplates` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
```json
{
"plugins": [
"microtemplates"
]
}
```You should also ensure ESLint will process HTML files. This can be done on the cli or in the CLIEngine API.
CLI:
```shell
$> eslint --ext .js,.htm,.html
```CLIEngine:
```js
var CLIEngine = require("eslint").CLIEngine;var engine = new CLIEngine({
extensions: [".js", ".htm", ".html"],
// etc.
});
```## Avoiding False Positives
You will want to configure ESLint to avoid common false positives. This might mean creating a separate config file for microtemplate use.
Here are some rules that may be worth disabling for microtemplates:
```json
{
"rules": {
"no-undef": 0
}
}