eslint-plugin-jasmine
    Overview
    Documentation
    Tutorials
    Insights
    Code
    Dependencies
    Contributors
    Jobs

eslint-plugin-jasmine

ESLint rules for Jasmine

2.10.1  •  Updated 2 years ago  •  by Tom Vincent  •  MIT License

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()' 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()' expectation function names
no-focused-tests 2
no-global-setup 2
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

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.

Popularity

Weekly Downloads
90.5K
Stars
68

Maintenance

Development

Last ver 2 years ago
Created 5 years ago
Last commit 4 months ago
11 days between commits

Technology

Node version: 4.9.1
190K unpacked

Compliance

MIT License
OSI Approved
0 vulnerabilities

Contributors

31 contributors
Tom Vincent
Maintainer, 68 commits, 26 merges, 5 PRs
Works at onarray
BuraBure
Maintainer, 5 commits, 30 merges, 2 PRs
Works at SantiagoLab
Bogdan Lupu
27 commits
Diana Suvorova
Maintainer, 5 commits, 12 merges, 17 PRs
greenkeeperio-bot
9 commits, 50 PRs
Works at greenkeeperio
Emil Ajdyna
8 commits, 2 PRs
Works at buxlabs

Tags

eslint
eslint-plugin
eslintplugin
jasmine
Openbase helps developers choose among and use millions of open-source packages, so they can build amazing products faster.
FacebookTwitterLinkedIn
© 2020 Devstore, Inc.