eslint-plugin-jasmine
ESLint rules for Jasmine
Last updated 3 months ago by tlvince .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install eslint-plugin-jasmine 
SYNC missed versions from official npm registry.

eslint-plugin-jasmine

Build Status npm version License

ESLint rules for Jasmine

Usage

  1. Install eslint-plugin-jasmine as a dev-dependency:

    npm install --save-dev eslint-plugin-jasmine
    
  2. Enable the plugin by adding it to your .eslintrc:

    plugins:
      - jasmine
    

ESLint itself provides a Jasmine environment for Jasmine's global variables. It's therefore recommended to also enable it in your .eslintrc:

plugins:
  - jasmine
env:
  jasmine: true

By default, no rules are enabled. See the next section for more.

Configuration

This plugin exports a recommended configuration that enforces good practices.

To enable this configuration, use the extends property in your .eslintrc config file:

plugins:
  - jasmine
env:
  jasmine: true
extends: 'plugin:jasmine/recommended'

See the ESLint config docs for more information about extending configuration files.

Rules

Rule Recommended Options
expect-matcher 1,
expect-single-argument 1,
missing-expect 0, 'expect()', 'expectAsync()' expectation function names
named-spy 0
new-line-before-expect 1
new-line-between-declarations 1
no-assign-spyon 0
no-describe-variables 0
no-disabled-tests 1
no-expect-in-setup-teardown 1, 'expect()', 'expectAsync()' expectation function names
no-focused-tests 2
no-global-setup 2
no-pending-tests 1
no-promise-without-done-fail 1
no-spec-dupes 1, 'block' ['block', 'branch']
no-suite-callback-args 2
no-suite-dupes 1, 'block' ['block', 'branch']
no-unsafe-spy 1
valid-expect deprecated
prefer-jasmine-matcher 1
prefer-toHaveBeenCalledWith 1
prefer-toBeUndefined 0 ['always', 'never']

For example, using the recommended configuration, the no-focused-tests rule is enabled and will cause ESLint to throw an error (with an exit code of 1) when triggered.

You may customise each rule by adding a value in your .eslintrc rules property:

plugins:
  - jasmine
env:
  jasmine: true
rules:
  jasmine/no-focused-tests: 0
  jasmine/no-suite-dupes:
    - 2
    - branch

See configuring rules for more information.

Author

© 2016 - 2017 Tom Vincent git@tlvince.com and contributors.

License

Released under the MIT license.

Current Tags

  • 4.1.1                                ...           latest (3 months ago)

48 Versions

  • 4.1.1                                ...           3 months ago
  • 4.1.0                                ...           8 months ago
  • 4.0.0                                ...           8 months ago
  • 3.0.0                                ...           8 months ago
  • 2.10.1                                ...           2 years ago
  • 2.10.0                                ...           2 years ago
  • 2.9.3                                ...           2 years ago
  • 2.9.2                                ...           2 years ago
  • 2.9.1                                ...           3 years ago
  • 2.9.0                                ...           3 years ago
  • 2.8.6                                ...           3 years ago
  • 2.8.5                                ...           3 years ago
  • 2.8.4                                ...           3 years ago
  • 2.8.3                                ...           3 years ago
  • 2.8.2                                ...           3 years ago
  • 2.8.1                                ...           3 years ago
  • 2.8.0                                ...           3 years ago
  • 2.7.1                                ...           3 years ago
  • 2.7.0                                ...           3 years ago
  • 2.6.2                                ...           3 years ago
  • 2.6.1                                ...           3 years ago
  • 2.6.0                                ...           3 years ago
  • 2.5.0                                ...           3 years ago
  • 2.4.0                                ...           3 years ago
  • 2.3.2                                ...           3 years ago
  • 2.3.1                                ...           3 years ago
  • 2.3.0                                ...           3 years ago
  • 2.2.0                                ...           4 years ago
  • 2.1.2                                ...           4 years ago
  • 2.1.1                                ...           4 years ago
  • 2.1.0                                ...           4 years ago
  • 2.0.1                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.9.0                                ...           4 years ago
  • 1.8.1                                ...           4 years ago
  • 1.8.0                                ...           4 years ago
  • 1.7.0                                ...           4 years ago
  • 1.6.0                                ...           5 years ago
  • 1.5.2                                ...           5 years ago
  • 1.5.1                                ...           5 years ago
  • 1.5.0                                ...           5 years ago
  • 1.4.0                                ...           5 years ago
  • 1.3.1                                ...           5 years ago
  • 1.3.0                                ...           5 years ago
  • 1.2.0                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
  • 1.0.0-rc.2                                ...           5 years ago
Maintainers (1)
Downloads
Today 17
This Week 98
This Month 343
Last Day 81
Last Week 376
Last Month 1,620
Dependencies (0)
None
Dev Dependencies (6)
Dependents (83)

Copyright 2014 - 2016 © taobao.org |