-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.mjs
More file actions
100 lines (92 loc) · 2.8 KB
/
Copy patheslint.config.mjs
File metadata and controls
100 lines (92 loc) · 2.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/**
* THIS FILE WAS AUTO-GENERATED.
* PLEASE DO NOT EDIT IT MANUALLY.
* ===============================
* IF YOU'RE COPYING THIS INTO AN ESLINT CONFIG, REMOVE THIS COMMENT BLOCK.
*/
import path from 'node:path';
import { includeIgnoreFile } from '@eslint/compat';
import js from '@eslint/js';
import { configs, plugins } from 'eslint-config-airbnb-extended';
import { rules as prettierConfigRules } from 'eslint-config-prettier';
import prettierPlugin from 'eslint-plugin-prettier';
const gitignorePath = path.resolve('.', '.gitignore');
const jsConfig = [
// ESLint Recommended Rules
{
name: 'js/config',
...js.configs.recommended,
},
// Stylistic Plugin
plugins.stylistic,
// Import X Plugin
plugins.importX,
// Airbnb Base Recommended Config
...configs.base.recommended,
];
const nodeConfig = [
// Node Plugin
plugins.node,
// Airbnb Node Recommended Config
...configs.node.recommended,
];
const typescriptConfig = [
// TypeScript ESLint Plugin
plugins.typescriptEslint,
// Airbnb Base TypeScript Config
...configs.base.typescript,
];
const prettierConfig = [
// Prettier Plugin
{
name: 'prettier/plugin/config',
plugins: {
prettier: prettierPlugin,
},
},
// Prettier Config
{
name: 'prettier/config',
rules: {
...prettierConfigRules,
'prettier/prettier': 'error',
},
},
];
export default [
// Ignore .gitignore files/folder in eslint
includeIgnoreFile(gitignorePath),
// Javascript Config
...jsConfig,
// Node Config
...nodeConfig,
// TypeScript Config
...typescriptConfig,
// Prettier Config
...prettierConfig,
// Custom rules for test automation
{
name: 'custom/test-automation-rules',
rules: {
// Disable no-await-in-loop for test automation where sequential UI interactions are necessary
'no-await-in-loop': 'off',
// Allow console.log/console.time in test automation for debugging and timing
'no-console': 'off',
// Allow for...of loops in test automation for cleaner iteration patterns
'no-restricted-syntax': 'off',
// Allow synchronous operations in test utilities and reporters
'n/no-sync': 'off',
// Allow Node.js features that may be newer than the specified version
'n/no-unsupported-features/node-builtins': 'off',
// Allow unused parameters in test fixtures (common pattern with Playwright fixtures)
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'off',
// Allow single exports in helper files (common pattern in test utilities)
'import-x/prefer-default-export': 'off',
// Allow class methods that don't use 'this' in page objects and helpers
'class-methods-use-this': 'off',
// Allow regex with unescaped characters in test utilities
'no-useless-escape': 'off',
},
},
];