You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> LMC's ESLint config for projects using Jest as test runner
4
+
5
+
These configuration files are suitable to lint Jest test files.
6
+
7
+
## Install
8
+
9
+
```bash
10
+
npm install @lmc-eu/eslint-config-jest -D
11
+
```
12
+
13
+
or
14
+
15
+
```bash
16
+
yarn add @lmc-eu/eslint-config-jest -D
17
+
```
18
+
19
+
## Usage
20
+
21
+
Create a _.eslintrc.js_ file with the following contents:
22
+
23
+
```js
24
+
module.exports= {
25
+
extends: [
26
+
// ... (base eslint config)
27
+
'@lmc-eu/eslint-config-jest',
28
+
],
29
+
};
30
+
```
31
+
32
+
The shareable config can be customized in your [**eslint** configuration file](https://eslint.org/docs/user-guide/configuring).
33
+
34
+
Use this ruleset to configure ESLint to lint your Jest test files. Jest test files are by default identified by `*.test.*` or `*.spec.*` filenames or by being in the _test/_ directory in your project root or by using `__test__/` directories near your tested files.
35
+
36
+
> ⚠️ You can use this environment ruleset in combination with any of the existing environment rulesets. Just make sure this one comes in as the last one.
For available rules see [ESLint plugin Jest](https://github.com/jest-community/eslint-plugin-jest/tree/main/docs/rules) and [ESLint plugin Jest Formatting](https://github.com/dangreenisrael/eslint-plugin-jest-formatting/tree/master/docs/rules)
0 commit comments