generated from insurgent-lab/javascript-lib-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
60 lines (59 loc) · 1.38 KB
/
eslint.config.js
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import js from "@eslint/js";
import importPlugin from "eslint-plugin-import";
import nodePlugin from "eslint-plugin-n";
import prettierConfig from "eslint-plugin-prettier/recommended";
import jestPlugin from "eslint-plugin-jest";
import globals from "globals";
export default [
{
files: ["**/*.js"],
},
{
// Ignore patterns
ignores: ["coverage/**"],
},
js.configs.recommended,
nodePlugin.configs["flat/recommended-script"],
importPlugin.flatConfigs.recommended,
prettierConfig,
{
// Base settings
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
globals: {
...globals.node,
...globals.es6,
},
},
rules: {
"prettier/prettier": "warn",
"n/file-extension-in-import": ["error", "always"],
},
},
{
// Jest settings for test files
files: ["tests/**/*.js", "**/*.spec.js"],
languageOptions: {
globals: {
...globals.jest,
},
},
plugins: {
jest: jestPlugin,
},
rules: {
...jestPlugin.configs.recommended.rules,
...jestPlugin.configs.style.rules,
"jest/no-conditional-expect": "off",
"jest/prefer-expect-assertions": [
"error",
{
onlyFunctionsWithAsyncKeyword: true,
onlyFunctionsWithExpectInLoop: true,
onlyFunctionsWithExpectInCallback: true,
},
],
},
},
];