-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.cjs
More file actions
79 lines (71 loc) · 1.9 KB
/
Copy patheslint.config.cjs
File metadata and controls
79 lines (71 loc) · 1.9 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
/*
https://eslint.org/docs/latest/rules/
https://typescript-eslint.io/rules/
*/
const typescriptPlugin = require("@typescript-eslint/eslint-plugin");
const typescriptParser = require("@typescript-eslint/parser");
const prettierPlugin = require("eslint-plugin-prettier");
const playwrightPlugin = require("eslint-plugin-playwright");
module.exports = [
{
plugins: {
prettier: prettierPlugin,
},
rules: {
"prettier/prettier": "error", // Apply Prettier formatting rule globally
},
},
{
files: ["**/*.ts", "**/*.tsx"],
plugins: {
"@typescript-eslint": typescriptPlugin,
},
languageOptions: {
parser: typescriptParser,
parserOptions: {
project: "./tsconfig.json",
// eslint-disable-next-line no-undef
tsconfigRootDir: __dirname,
},
},
rules: {
"@typescript-eslint/no-unused-vars": "error", // Check for unused vars in TypeScript files
},
},
{
files: ["tests/**", "pages/**"], // Target Playwright test files
plugins: {
playwright: playwrightPlugin, // Use Playwright plugin
},
rules: {
...playwrightPlugin.configs["flat/recommended"].rules, // Apply Playwright's recommended rules
// Customize Playwright rules here
},
},
{
files: ["**/*.js", "**/*.jsx", "**/*.cjs"],
languageOptions: {
globals: {
console: "readonly", // Allow 'console' as a read-only global variable in JavaScript files
},
},
rules: {
"no-unused-vars": "error", // Check for unused vars in JS files
"no-undef": "error", // Ensure variables are defined in JS files
},
},
{
ignores: [
"node_modules/",
"test-results/",
"playwright-report",
"summary.json",
".vscode/*",
".DS_Store",
"Thumbs.db",
"*_spec3.json",
"playwright.actions.config.ts",
"playwright.config.ts",
],
},
];