Socket
Socket
Sign inDemoInstall

eslint-plugin-jasmine

Package Overview
Dependencies
0
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    eslint-plugin-jasmine

ESLint rules for Jasmine


Version published
Weekly downloads
215K
increased by1.77%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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

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

FAQs

Last updated on 13 Jun 2024

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc