GithubHelp home page GithubHelp logo

qpc-github / babel-plugin-eslint-test-generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shopify/babel-plugin-eslint-test-generator

1.0 2.0 1.0 20 KB

License: MIT License

JavaScript 100.00%

babel-plugin-eslint-test-generator's Introduction

Travis

babel-plugin-eslint-test-generator

This is a Babel Plugin which will generate ci tests based on eslint results. Basically developers can't ignore linting when it's in CI

Installation

$ npm install babel-plugin-eslint-test-generator

Example

The following is an example .babelrc file:

{
  "presets": ["es2015"],
  "plugins": [
    ["eslint-test-generator", {
      "template": "mocha",
      "paths": [
        "src/**/*.js",
        "test/**/*.js",
      ]
    }]
  ]
}

Using with .eslintrc

It should be noted when using this module you should use explicit paths to plugins in your .eslintrc. For instance:

"extends": [
  "./node_modules/coding-standard/eslintDefaults.js",
  "./node_modules/coding-standard/.eslintrc-es6",
  "./node_modules/coding-standard/.eslintrc-jsx"
]

More on that here: http://eslint.org/docs/user-guide/configuring#using-a-configuration-file

Plugin Options

  • template- Required String which can be either be a handlebars template. Or one of the following if you'd like to use a pre-existing template:
    • mocha
    • qunit
  • paths - Required Array or String. Paths can be an Array of glob strings defining which files should be linted. You can also pass in a glob string instead of an Array.
  • file - A String that is a file that we'd like to append the generated tests into. eg. 'test-lint.js'
  • optsEslint - Optional eslint options object.
  • maxWarnings - Optional (default: -1), equivalent to --max-warnings on eslint's CLI. -1 means there is no maximum.

License

MIT, see LICENSE.md for details.

babel-plugin-eslint-test-generator's People

Contributors

mikkoh avatar minasmart avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.