4.1.3 • Published 2 years ago

eslint-plugin-jasmine v4.1.3

Weekly downloads
238,070
License
MIT
Repository
github
Last release
2 years ago

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.

do-fneslint-config-ant-gular@infinitebrahmanuniverse/nolb-eslint-plugin-j@everything-registry/sub-chunk-1612eslint-config-ftgpirvingneon-extension-build@html-validate/eslint-config-protractoreslint-config-weezeventeslint-config-sxt-engineeslint-deltaeslint-config-udemy-jasmine-addonseslint-config-wix-editoreslint-plugin-nebirueslint-plugin-murikieslint-plugin-iqviaeslint-config-benjamin-van-ryseghemeslint-config-build-engineeslint-config-acceleratoreslint-config-afrasaghs-umami-tonkotsu-curator-devtoolseslint-config-nebirueslint-config-nbseslint-config-fbjs-extendedeslint-config-fbjs-opensourceeslint-config-fiskereslint-config-restricteslint-config-socifieslint-config-iplayereslint-config-iplayer-legacyeslint-config-novodaeslint-config-cumul8eslint-config-hnhaddadeslint-config-mnuboeslint-config-morsedigitaleslint-config-ds82-jasmineeslint-config-gfpeslint-config-gametekeslint-config-prettyeslint-config-eq-authoreslint-plugin-banno-prismpath-store@dwp/eslint-config-jasmine@eslint-config-globex/jasmine@frostbitecms/eslint-config@ids-sandbox/npm-testunb-cs2613@josundt/eslint-config@metahub/eslint-config@merkur/tools@merkur/tool-configsutquaesuperdesk-code-style@labforward/eslint-config-drivers@partumgmbh/eslint-config-react@popperjs/scripts@popperjs/test@radon-extension/build@socifi/eslint-config@sunshinesmile/eslint-config-react@webpuppy/eslint-configaxios-retry-ano@argodevops/eslint-configblackjack-utils@bytesquid/eslint-config@beanbag/eslint-plugin@cequens/eslint-config-react-app@colin-etchells/okta-signin-widgetderk-eslint-configdibslint
4.1.3

2 years ago

4.1.2

3 years ago

4.1.1

4 years ago

4.1.0

4 years ago

4.0.0

4 years ago

3.0.0

4 years ago

2.10.1

6 years ago

2.10.0

6 years ago

2.9.3

6 years ago

2.9.2

6 years ago

2.9.1

6 years ago

2.9.0

6 years ago

2.8.6

6 years ago

2.8.5

6 years ago

2.8.4

7 years ago

2.8.3

7 years ago

2.8.2

7 years ago

2.8.1

7 years ago

2.8.0

7 years ago

2.7.1

7 years ago

2.7.0

7 years ago

2.6.2

7 years ago

2.6.1

7 years ago

2.6.0

7 years ago

2.5.0

7 years ago

2.4.0

7 years ago

2.3.2

7 years ago

2.3.1

7 years ago

2.3.0

7 years ago

2.2.0

7 years ago

2.1.2

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.9.0

7 years ago

1.8.1

8 years ago

1.8.0

8 years ago

1.7.0

8 years ago

1.6.0

8 years ago

1.5.2

8 years ago

1.5.1

8 years ago

1.5.0

8 years ago

1.4.0

9 years ago

1.3.1

9 years ago

1.3.0

9 years ago

1.2.0

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago

1.0.0-rc.2

9 years ago