-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy patheslint.config.js
More file actions
80 lines (79 loc) · 1.8 KB
/
eslint.config.js
File metadata and controls
80 lines (79 loc) · 1.8 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
const js = require("@eslint/js");
const prettier = require("eslint-config-prettier");
const noOnlyTests = require("eslint-plugin-no-only-tests");
module.exports = [
{
ignores: [
"node_modules/",
"test-results/",
"playwright-report/",
"allure-report/",
"allure-results/",
".husky/",
"dist/",
"build/",
],
},
js.configs.recommended,
prettier,
{
files: ["**/*.js"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "commonjs",
globals: {
test: "readonly",
expect: "readonly",
describe: "readonly",
beforeEach: "readonly",
afterEach: "readonly",
beforeAll: "readonly",
afterAll: "readonly",
console: "readonly",
process: "readonly",
Buffer: "readonly",
__dirname: "readonly",
__filename: "readonly",
global: "readonly",
},
},
rules: {
"no-console": ["warn", { allow: ["warn", "error"] }],
"no-unused-vars": ["error", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
"no-var": "error",
"prefer-const": "error",
"prefer-arrow-callback": "warn",
eqeqeq: ["error", "always"],
"no-empty-function": "warn",
"no-duplicate-imports": "error",
},
},
{
files: [
"**/*.config.js",
"**/playwright.config.js",
"**/e2e.config.js",
"**/saucelabs.config.js",
],
rules: {
"no-unused-vars": "off",
"no-console": "off",
},
},
{
files: ["**/*reporter*.js"],
rules: {
"no-console": "off",
},
},
{
files: ["**/*.spec.js", "**/*.test.js"],
plugins: {
"no-only-tests": noOnlyTests,
},
rules: {
"no-unused-expressions": "off",
"no-only-tests/no-only-tests": "error",
},
},
];