1.0.1 • Published 6 years ago

babel-plugin-eslint-validation v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

npm node deps

Installation

npm install --save-dev babel-plugin-eslint-validation

Usage

Via .babelrc (Recommended)

.babelrc

// without options
{
  "plugins": ["babel-plugin-eslint-validation"]
}

// with options
{
  "plugins": [
    ["babel-plugin-eslint-validation", {
        "fix": false,
        "formatter": "stylish",
        "failOnError": true,
        "failOnWarning": false
    }]
  ]
}

Via CLI

babel --plugins babel-plugin-eslint-validation script.js

Via Node API

require("@babel/core").transform("code", {
  plugins: ["babel-plugin-eslint-validation"]
});

Options

fix (default: false)

This option will enable ESLint autofix feature.

formatter (default: eslint stylish formatter)

You can use official eslint formatters, or the path to a custom formatter

{
  "plugins": [
    ["babel-plugin-eslint-validation", {
        "formatter": "eslint-friendly-formatter"
    }]
  ]
}

eslintPath (default: "eslint")

Path to eslint instance that will be used for linting.

failOnWarning (default: false)

Loader will cause the module build to fail if there are any eslint warnings.

failOnError (default: false)

Loader will cause the module build to fail if there are any eslint errors.