-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
39 lines (37 loc) · 1.15 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* @file eslint.config.mjs
* @description ESLint configuration file that sets up linting rules and environments for JavaScript and Jest.
*
* This configuration extends the recommended ESLint rules for JavaScript, includes Jest-specific linting rules,
* and integrates environment globals for Node.js and Jest.
*
* Key features:
*
* - **Globals**: Sets global variables for Node.js and Jest environments.
* - **Plugins**: Includes the `eslint-plugin-jest` plugin for Jest-specific linting rules.
* - **Recommended Rules**: Applies the recommended configuration from the ESLint `@eslint/js` package.
*
* @module .eslintrc
*/
import globals from "globals";
import pluginJs from "@eslint/js";
import jest from 'eslint-plugin-jest';
export default [
// Specify the environment globals for Node.js and Jest
{
languageOptions: {
globals: {
...globals.node, // Node.js globals
...jest.environments.globals.globals // Jest globals
}
}
},
// Add Jest plugin for Jest-specific linting rules
{
plugins: {
jest
}
},
// Apply the recommended ESLint rules for JavaScript
pluginJs.configs.recommended
];