0.0.8 • Published 5 years ago

eslint-plugin-frontmatter v0.0.8

Weekly downloads
277
License
MIT
Repository
-
Last release
5 years ago

eslint-plugin-frontmatter

Build Status

Remove YAML frontmatter from .js files before calling ESLint. Given the following file:

---
process: true
---

const cat = () => console.log('meow')

This plugin removes the frontmatter and sends the remaining content to ESLint:

const cat = () => console.log('meow')

The use case for this plugin was JavaScript development for a site built with Jekyll.

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-frontmatter:

$ npm install eslint-plugin-frontmatter --save-dev

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

Usage

Add frontmatter to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": [
    "frontmatter"
  ]
}

After adding this plugin, frontmatter will be removed from your JavaScript files before they're linted.

Tests

To start the tests, run:

npm run test
0.0.8

5 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago