# eslint-plugin-jasmine

> ESLint rules for Jasmine

Latest version **4.2.2** (published 2024-09-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install eslint-plugin-jasmine
pnpm add eslint-plugin-jasmine
yarn add eslint-plugin-jasmine
bun add eslint-plugin-jasmine
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.2.2 |
| Published | 2024-09-18 |
| First published | 2015-01-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 0 |
| Unpacked size | 41.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tom Vincent |
| Maintainers | tlvince |
| Keywords | eslint, eslint-plugin, eslintplugin, jasmine |

## Links

- npm: https://www.npmjs.com/package/eslint-plugin-jasmine
- Repository: https://github.com/tlvince/eslint-plugin-jasmine
- Issues: https://github.com/tlvince/eslint-plugin-jasmine/issues
- npm.io page: https://npm.io/package/eslint-plugin-jasmine

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@pandacss/eslint-plugin](https://npm.io/package/@pandacss/eslint-plugin.md) — 18.7K weekly downloads

## Recent versions

- 4.2.2 (latest) — 2024-09-18
- 4.1.4-beta.3 (beta) — 2024-06-13
- 4.2.1 — 2024-08-22
- 4.2.0 — 2024-06-13
- 4.1.4-beta.2 — 2024-06-13
- 4.1.4-beta.1 — 2024-06-12
- 4.1.3 — 2021-11-24
- 4.1.2 — 2021-02-02
- 4.1.1 — 2020-04-13
- 4.1.0 — 2019-11-16
- 4.0.0 — 2019-11-09
- 3.0.0 — 2019-11-09
- 2.10.1 — 2018-05-17
- 2.10.0 — 2018-05-10
- 2.9.3 — 2018-02-28
- … 41 more at https://npm.io/package/eslint-plugin-jasmine/versions

## README

# eslint-plugin-jasmine

[![Build Status][build-image]][build-url]
[![npm version][npm-image]][npm-url]
[![License][license-image]][license-url]

[build-url]: https://github.com/tlvince/eslint-plugin-jasmine/actions
[build-image]: https://img.shields.io/github/actions/workflow/status/tlvince/eslint-plugin-jasmine/releases.yml
[npm-url]: https://www.npmjs.com/package/eslint-plugin-jasmine
[npm-image]: https://img.shields.io/npm/v/eslint-plugin-jasmine.svg
[license-url]: https://opensource.org/licenses/MIT
[license-image]: https://img.shields.io/npm/l/eslint-plugin-jasmine.svg

> ESLint rules for Jasmine

## Usage

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

   ```shell
   npm install --save-dev eslint-plugin-jasmine
   ```

2. Enable the plugin by adding it to your `.eslintrc`:

   ```yaml
   plugins:
     - jasmine
   ```

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

```yaml
plugins:
  - jasmine
env:
  jasmine: true
```

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

[env]: http://eslint.org/docs/user-guide/configuring#specifying-environments

## Configuration

This plugin exports a `recommended` configuration that enforces good practices.

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

```yaml
plugins:
  - jasmine
env:
  jasmine: true
extends: "plugin:jasmine/recommended"
```

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

[eslint config docs]: http://eslint.org/docs/user-guide/configuring#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-promise-strategies][]     | 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:

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

See [configuring rules][] for more information.

[expect-matcher]: docs/rules/expect-matcher.md
[expect-single-argument]: docs/rules/expect-single-argument.md
[missing-expect]: docs/rules/missing-expect.md
[named-spy]: docs/rules/named-spy.md
[new-line-before-expect]: docs/rules/new-line-before-expect.md
[new-line-between-declarations]: docs/rules/new-line-between-declarations.md
[no-assign-spyon]: docs/rules/no-assign-spyon.md
[no-describe-variables]: docs/rules/no-describe-variables.md
[no-disabled-tests]: docs/rules/no-disabled-tests.md
[no-expect-in-setup-teardown]: docs/rules/no-expect-in-setup-teardown.md
[no-focused-tests]: docs/rules/no-focused-tests.md
[no-global-setup]: docs/rules/no-global-setup.md
[no-pending-tests]: docs/rules/no-pending-tests.md
[no-promise-without-done-fail]: docs/rules/no-promise-without-done-fail.md
[no-spec-dupes]: docs/rules/no-spec-dupes.md
[no-suite-callback-args]: docs/rules/no-suite-callback-args.md
[no-suite-dupes]: docs/rules/no-suite-dupes.md
[no-unsafe-spy]: docs/rules/no-unsafe-spy.md
[valid-expect]: docs/rules/valid-expect.md
[prefer-jasmine-matcher]: docs/rules/prefer-jasmine-matcher.md
[prefer-promise-strategies]: docs/rules/prefer-promise-strategies.md
[prefer-toHaveBeenCalledWith]: docs/rules/prefer-toHaveBeenCalledWith.md
[prefer-toBeUndefined]: docs/rules/prefer-toBeUndefined.md
[configuring rules]: http://eslint.org/docs/user-guide/configuring#configuring-rules

## Author

© 2016 - 2017 Tom Vincent <git@tlvince.com> and [contributors][].

[contributors]: https://github.com/tlvince/eslint-plugin-jasmine/graphs/contributors

## License

Released under the [MIT license](http://tlvince.mit-license.org).

---
_Source: https://npm.io/package/eslint-plugin-jasmine · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
