Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

eslint-plugin-jasmine

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-jasmine

ESLint rules for Jasmine

latest
Source
npmnpm
Version
4.2.2
Version published
Weekly downloads
204K
-16.39%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-plugin-jasmine

Build Status npm version License

ESLint rules for Jasmine

Usage

  • Install eslint-plugin-jasmine as a dev-dependency:

    npm install --save-dev eslint-plugin-jasmine
    
  • 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

RuleRecommendedOptions
expect-matcher1,
expect-single-argument1,
missing-expect0, 'expect()', 'expectAsync()'expectation function names
named-spy0
new-line-before-expect1
new-line-between-declarations1
no-assign-spyon0
no-describe-variables0
no-disabled-tests1
no-expect-in-setup-teardown1, 'expect()', 'expectAsync()'expectation function names
no-focused-tests2
no-global-setup2
no-pending-tests1
no-promise-without-done-fail1
no-spec-dupes1, 'block'['block', 'branch']
no-suite-callback-args2
no-suite-dupes1, 'block'['block', 'branch']
no-unsafe-spy1
valid-expectdeprecated
prefer-jasmine-matcher1
prefer-promise-strategies1
prefer-toHaveBeenCalledWith1
prefer-toBeUndefined0['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.

Keywords

eslint

FAQs

Package last updated on 18 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts