Nobody Pays (for) Magazines
Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

metalsmith-eslint

4.0.0 • Public • Published

metalsmith-eslint

Gitter Travis David David Codecov npm npm

An Eslint plugin for Metalsmith.

Installation

npm install --save metalsmith-eslint

Getting Started

If you haven't checked out Metalsmith before, head over to their website and check out the documentation.

Usage

var eslint = require("metalsmith-elint");
 
metalsmith
  .use(eslint({
    src: ["**/*.js", "!**/vendor/**/*.js"],
    formatter: "unix",
    eslintConfig: JSON.parse(fs.readFileSync(path.join(process.cwd(), ".eslintrc"), "utf8"))
  }))

Options

You can check the tests out to see some usage examples.

src

A multimatch expression that can be used to limit the files that will be eslinted. Default is ["**/*.js"]

formatter

One of the formatter name that is integrated to eslint. See the list here. Default is stylish.

eslintConfig

A valid eslint config that will be passed to eslint. You can also read an .eslintrc file and pass the contents to this key directly. Default none, a configuration is required

To read .eslintrc you can use the following: JSON.parse(fs.readFileSync(path.join(process.cwd(), ".eslintrc"), "utf8"))

Contributing

Just open an issue or prepare a pull request.

install

npm i metalsmith-eslint

Downloadsweekly downloads

191

version

4.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability