eslint-plugin-wdio 9.0.8 → 9.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -1
- package/build/index.cjs +1 -1
- package/build/index.js +1 -1
- package/build/utils/helpers.d.ts +4 -1
- package/build/utils/helpers.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/utils/helpers.ts +11 -3
package/README.md
CHANGED
|
@@ -22,6 +22,8 @@ npm install eslint-plugin-wdio --save-dev
|
|
|
22
22
|
|
|
23
23
|
This plugin export a recommended configuration that enforce good practices.
|
|
24
24
|
|
|
25
|
+
### With Eslint v8 and below
|
|
26
|
+
|
|
25
27
|
To enable this configuration use the extends property in your `.eslintrc` config file:
|
|
26
28
|
|
|
27
29
|
```json
|
|
@@ -34,7 +36,25 @@ To enable this configuration use the extends property in your `.eslintrc` config
|
|
|
34
36
|
}
|
|
35
37
|
```
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
### With Eslint v9 and Flat Config
|
|
40
|
+
|
|
41
|
+
If you are using the latest version of Eslint with the [flat configuration](https://eslint.org/docs/latest/use/configure/migration-guide), you can embed this plugin as follows:
|
|
42
|
+
|
|
43
|
+
```js
|
|
44
|
+
// eslint.config.mjs
|
|
45
|
+
import { config as wdioConfig } from "eslint-plugin-wdio";
|
|
46
|
+
|
|
47
|
+
export default [
|
|
48
|
+
{
|
|
49
|
+
extends: [
|
|
50
|
+
wdioConfig['flat/recommended'],
|
|
51
|
+
// ...
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
];
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
See [ESLint documentation](https://eslint.org/docs/latest/use/configure/configuration-files) for more information about extending configuration files.
|
|
38
58
|
|
|
39
59
|
## List of supported rules
|
|
40
60
|
|
package/build/index.cjs
CHANGED
|
@@ -95,7 +95,7 @@ var await_expect_default = rule;
|
|
|
95
95
|
// src/utils/helpers.ts
|
|
96
96
|
var isCommand = function(expression, command) {
|
|
97
97
|
const callee = expression?.callee;
|
|
98
|
-
return callee && callee
|
|
98
|
+
return callee && "object" in callee && "name" in callee.object && callee.object?.name === "browser" && "property" in callee && "name" in callee.property && callee.property?.name === command;
|
|
99
99
|
};
|
|
100
100
|
|
|
101
101
|
// src/rules/no-debug.ts
|
package/build/index.js
CHANGED
|
@@ -67,7 +67,7 @@ var await_expect_default = rule;
|
|
|
67
67
|
// src/utils/helpers.ts
|
|
68
68
|
var isCommand = function(expression, command) {
|
|
69
69
|
const callee = expression?.callee;
|
|
70
|
-
return callee && callee
|
|
70
|
+
return callee && "object" in callee && "name" in callee.object && callee.object?.name === "browser" && "property" in callee && "name" in callee.property && callee.property?.name === command;
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
// src/rules/no-debug.ts
|
package/build/utils/helpers.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Rule } from 'eslint';
|
|
2
|
+
type CallExpression = Parameters<NonNullable<Rule.NodeListener['CallExpression']>>[0];
|
|
3
|
+
export declare const isCommand: (expression: CallExpression, command: "pause" | "debug") => boolean;
|
|
4
|
+
export {};
|
|
2
5
|
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,eAAwB,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAElC,KAAK,cAAc,GAAG,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAErF,eAAO,MAAM,SAAS,eAAwB,cAAc,WAAW,OAAO,GAAG,OAAO,KAAG,OAY1F,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-wdio",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.4.4",
|
|
4
4
|
"description": "Eslint rules for WebdriverIO",
|
|
5
5
|
"author": "Christian Bromann <mail@bromann.dev>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/eslint-plugin-wdio",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"@types/estree": "^1.0.1",
|
|
40
40
|
"eslint": "^9.0.0"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "d327d86e07d16eaa0ecdf0656c1868ba73261393"
|
|
43
43
|
}
|
package/src/utils/helpers.ts
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Rule } from 'eslint'
|
|
2
|
+
|
|
3
|
+
type CallExpression = Parameters<NonNullable<Rule.NodeListener['CallExpression']>>[0]
|
|
4
|
+
|
|
5
|
+
export const isCommand = function(expression: CallExpression, command: 'pause' | 'debug'): boolean {
|
|
2
6
|
const callee = expression?.callee
|
|
3
7
|
|
|
4
8
|
return (
|
|
5
9
|
callee &&
|
|
6
|
-
|
|
7
|
-
|
|
10
|
+
'object' in callee &&
|
|
11
|
+
'name' in callee.object &&
|
|
12
|
+
callee.object?.name === 'browser' &&
|
|
13
|
+
'property' in callee &&
|
|
14
|
+
'name' in callee.property &&
|
|
15
|
+
callee.property?.name === command
|
|
8
16
|
)
|
|
9
17
|
}
|
|
10
18
|
|