eslint-plugin-wdio 8.24.12 → 8.37.0
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/build/constants.js +4 -1
- package/build/index.d.ts +49 -19
- package/build/index.d.ts.map +1 -1
- package/build/index.js +49 -24
- package/build/rules/await-expect.js +5 -3
- package/build/rules/no-debug.js +5 -3
- package/build/rules/no-pause.js +5 -3
- package/build/utils/helpers.js +5 -1
- package/cjs/index.js +42 -24
- package/package.json +11 -12
- package/src/index.ts +44 -23
package/build/constants.js
CHANGED
package/build/index.d.ts
CHANGED
|
@@ -1,24 +1,54 @@
|
|
|
1
|
-
declare const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
declare const _default: {
|
|
2
|
+
configs: {
|
|
3
|
+
'flat/recommended': {
|
|
4
|
+
languageOptions: {
|
|
5
|
+
globals: {
|
|
6
|
+
readonly $: false;
|
|
7
|
+
readonly $$: false;
|
|
8
|
+
readonly browser: false;
|
|
9
|
+
readonly driver: false;
|
|
10
|
+
readonly expect: false;
|
|
11
|
+
readonly multiremotebrowser: false;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
plugins: {
|
|
15
|
+
wdio: {
|
|
16
|
+
configs: {};
|
|
17
|
+
rules: {
|
|
18
|
+
'await-expect': import("eslint").Rule.RuleModule;
|
|
19
|
+
'no-debug': import("eslint").Rule.RuleModule;
|
|
20
|
+
'no-pause': import("eslint").Rule.RuleModule;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
rules: {
|
|
25
|
+
readonly 'wdio/await-expect': "error";
|
|
26
|
+
readonly 'wdio/no-debug': "error";
|
|
27
|
+
readonly 'wdio/no-pause': "error";
|
|
28
|
+
};
|
|
15
29
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
30
|
+
recommended: {
|
|
31
|
+
globals: {
|
|
32
|
+
readonly $: false;
|
|
33
|
+
readonly $$: false;
|
|
34
|
+
readonly browser: false;
|
|
35
|
+
readonly driver: false;
|
|
36
|
+
readonly expect: false;
|
|
37
|
+
readonly multiremotebrowser: false;
|
|
38
|
+
};
|
|
39
|
+
plugins: string[];
|
|
40
|
+
rules: {
|
|
41
|
+
readonly 'wdio/await-expect': "error";
|
|
42
|
+
readonly 'wdio/no-debug': "error";
|
|
43
|
+
readonly 'wdio/no-pause': "error";
|
|
44
|
+
};
|
|
20
45
|
};
|
|
21
46
|
};
|
|
47
|
+
rules: {
|
|
48
|
+
'await-expect': import("eslint").Rule.RuleModule;
|
|
49
|
+
'no-debug': import("eslint").Rule.RuleModule;
|
|
50
|
+
'no-pause': import("eslint").Rule.RuleModule;
|
|
51
|
+
};
|
|
22
52
|
};
|
|
23
|
-
export
|
|
53
|
+
export = _default;
|
|
24
54
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,kBAMC"}
|
package/build/index.js
CHANGED
|
@@ -1,26 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const rules = {
|
|
5
|
-
'await-expect': awaitExpect,
|
|
6
|
-
'no-debug': noDebug,
|
|
7
|
-
'no-pause': noPause
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
4
|
};
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
5
|
+
const await_expect_js_1 = __importDefault(require("./rules/await-expect.js"));
|
|
6
|
+
const no_debug_js_1 = __importDefault(require("./rules/no-debug.js"));
|
|
7
|
+
const no_pause_js_1 = __importDefault(require("./rules/no-pause.js"));
|
|
8
|
+
const sharedGlobals = {
|
|
9
|
+
$: false,
|
|
10
|
+
$$: false,
|
|
11
|
+
browser: false,
|
|
12
|
+
driver: false,
|
|
13
|
+
expect: false,
|
|
14
|
+
multiremotebrowser: false,
|
|
15
|
+
};
|
|
16
|
+
const sharedConfig = {
|
|
17
|
+
rules: {
|
|
18
|
+
'wdio/await-expect': 'error',
|
|
19
|
+
'wdio/no-debug': 'error',
|
|
20
|
+
'wdio/no-pause': 'error',
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
const index = {
|
|
24
|
+
configs: {},
|
|
25
|
+
rules: {
|
|
26
|
+
'await-expect': await_expect_js_1.default,
|
|
27
|
+
'no-debug': no_debug_js_1.default,
|
|
28
|
+
'no-pause': no_pause_js_1.default,
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
const legacyConfig = {
|
|
32
|
+
...sharedConfig,
|
|
33
|
+
globals: sharedGlobals,
|
|
34
|
+
plugins: ['wdio'],
|
|
35
|
+
};
|
|
36
|
+
const flatConfig = {
|
|
37
|
+
...sharedConfig,
|
|
38
|
+
languageOptions: {
|
|
39
|
+
globals: sharedGlobals,
|
|
40
|
+
},
|
|
41
|
+
plugins: {
|
|
42
|
+
wdio: index,
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
module.exports = {
|
|
46
|
+
...index,
|
|
47
|
+
configs: {
|
|
48
|
+
'flat/recommended': flatConfig,
|
|
49
|
+
recommended: legacyConfig,
|
|
50
|
+
},
|
|
25
51
|
};
|
|
26
|
-
export { rules, configs, };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const constants_js_1 = require("../constants.js");
|
|
2
4
|
const rule = {
|
|
3
5
|
meta: {
|
|
4
6
|
type: 'problem',
|
|
@@ -23,7 +25,7 @@ const rule = {
|
|
|
23
25
|
if (node.callee.type !== 'MemberExpression' ||
|
|
24
26
|
node.callee.object.type !== 'CallExpression' ||
|
|
25
27
|
node.callee.object.callee.name !== 'expect' ||
|
|
26
|
-
!MATCHERS.includes(node.callee.property.name)) {
|
|
28
|
+
!constants_js_1.MATCHERS.includes(node.callee.property.name)) {
|
|
27
29
|
return;
|
|
28
30
|
}
|
|
29
31
|
/**
|
|
@@ -41,4 +43,4 @@ const rule = {
|
|
|
41
43
|
};
|
|
42
44
|
}
|
|
43
45
|
};
|
|
44
|
-
|
|
46
|
+
exports.default = rule;
|
package/build/rules/no-debug.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const helpers_js_1 = require("../utils/helpers.js");
|
|
2
4
|
const rule = {
|
|
3
5
|
meta: {
|
|
4
6
|
type: 'problem',
|
|
@@ -17,11 +19,11 @@ const rule = {
|
|
|
17
19
|
create: function (context) {
|
|
18
20
|
return {
|
|
19
21
|
CallExpression(node) {
|
|
20
|
-
if (isCommand(node, 'debug')) {
|
|
22
|
+
if ((0, helpers_js_1.isCommand)(node, 'debug')) {
|
|
21
23
|
context.report({ node, messageId: 'unexpectedDebug' });
|
|
22
24
|
}
|
|
23
25
|
}
|
|
24
26
|
};
|
|
25
27
|
}
|
|
26
28
|
};
|
|
27
|
-
|
|
29
|
+
exports.default = rule;
|
package/build/rules/no-pause.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const helpers_js_1 = require("../utils/helpers.js");
|
|
2
4
|
const rule = {
|
|
3
5
|
meta: {
|
|
4
6
|
type: 'problem',
|
|
@@ -17,11 +19,11 @@ const rule = {
|
|
|
17
19
|
create: function (context) {
|
|
18
20
|
return {
|
|
19
21
|
CallExpression(node) {
|
|
20
|
-
if (isCommand(node, 'pause')) {
|
|
22
|
+
if ((0, helpers_js_1.isCommand)(node, 'pause')) {
|
|
21
23
|
context.report({ node, messageId: 'unexpectedPause' });
|
|
22
24
|
}
|
|
23
25
|
}
|
|
24
26
|
};
|
|
25
27
|
}
|
|
26
28
|
};
|
|
27
|
-
|
|
29
|
+
exports.default = rule;
|
package/build/utils/helpers.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isCommand = void 0;
|
|
4
|
+
const isCommand = function (expression, command) {
|
|
2
5
|
const callee = expression?.callee;
|
|
3
6
|
return (callee &&
|
|
4
7
|
callee?.object?.name === 'browser' &&
|
|
5
8
|
callee?.property?.name === command);
|
|
6
9
|
};
|
|
10
|
+
exports.isCommand = isCommand;
|
package/cjs/index.js
CHANGED
|
@@ -2,32 +2,50 @@
|
|
|
2
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.configs = exports.rules = void 0;
|
|
7
5
|
const await_expect_js_1 = __importDefault(require("./rules/await-expect.js"));
|
|
8
6
|
const no_debug_js_1 = __importDefault(require("./rules/no-debug.js"));
|
|
9
7
|
const no_pause_js_1 = __importDefault(require("./rules/no-pause.js"));
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
const sharedGlobals = {
|
|
9
|
+
$: false,
|
|
10
|
+
$$: false,
|
|
11
|
+
browser: false,
|
|
12
|
+
driver: false,
|
|
13
|
+
expect: false,
|
|
14
|
+
multiremotebrowser: false,
|
|
14
15
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
16
|
+
const sharedConfig = {
|
|
17
|
+
rules: {
|
|
18
|
+
'wdio/await-expect': 'error',
|
|
19
|
+
'wdio/no-debug': 'error',
|
|
20
|
+
'wdio/no-pause': 'error',
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
const index = {
|
|
24
|
+
configs: {},
|
|
25
|
+
rules: {
|
|
26
|
+
'await-expect': await_expect_js_1.default,
|
|
27
|
+
'no-debug': no_debug_js_1.default,
|
|
28
|
+
'no-pause': no_pause_js_1.default,
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
const legacyConfig = {
|
|
32
|
+
...sharedConfig,
|
|
33
|
+
globals: sharedGlobals,
|
|
34
|
+
plugins: ['wdio'],
|
|
35
|
+
};
|
|
36
|
+
const flatConfig = {
|
|
37
|
+
...sharedConfig,
|
|
38
|
+
languageOptions: {
|
|
39
|
+
globals: sharedGlobals,
|
|
40
|
+
},
|
|
41
|
+
plugins: {
|
|
42
|
+
wdio: index,
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
module.exports = {
|
|
46
|
+
...index,
|
|
47
|
+
configs: {
|
|
48
|
+
'flat/recommended': flatConfig,
|
|
49
|
+
recommended: legacyConfig,
|
|
50
|
+
},
|
|
32
51
|
};
|
|
33
|
-
exports.configs = configs;
|
package/package.json
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-wdio",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.37.0",
|
|
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",
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"type": "module",
|
|
9
8
|
"main": "./cjs/index.js",
|
|
10
9
|
"module": "./build/index.js",
|
|
11
10
|
"types": "./build/index.d.ts",
|
|
12
11
|
"exports": {
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"./cjs/index.js"
|
|
20
|
-
|
|
12
|
+
"import": {
|
|
13
|
+
"types": "./build/index.d.ts",
|
|
14
|
+
"default": "./build/index.js"
|
|
15
|
+
},
|
|
16
|
+
"require": {
|
|
17
|
+
"types": "./build/index.d.ts",
|
|
18
|
+
"default": "./cjs/index.js"
|
|
19
|
+
}
|
|
21
20
|
},
|
|
22
21
|
"typeScriptVersion": "3.8.3",
|
|
23
22
|
"engines": {
|
|
@@ -40,7 +39,7 @@
|
|
|
40
39
|
},
|
|
41
40
|
"devDependencies": {
|
|
42
41
|
"@types/estree": "^1.0.1",
|
|
43
|
-
"eslint": "^
|
|
42
|
+
"eslint": "^9.0.0"
|
|
44
43
|
},
|
|
45
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "cefb415aa315075fb6b682c6d059d9ff37fbefb8"
|
|
46
45
|
}
|
package/src/index.ts
CHANGED
|
@@ -2,31 +2,52 @@ import awaitExpect from './rules/await-expect.js'
|
|
|
2
2
|
import noDebug from './rules/no-debug.js'
|
|
3
3
|
import noPause from './rules/no-pause.js'
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
const sharedGlobals = {
|
|
6
|
+
$: false,
|
|
7
|
+
$$: false,
|
|
8
|
+
browser: false,
|
|
9
|
+
driver: false,
|
|
10
|
+
expect: false,
|
|
11
|
+
multiremotebrowser: false,
|
|
12
|
+
} as const
|
|
13
|
+
|
|
14
|
+
const sharedConfig = {
|
|
15
|
+
rules: {
|
|
16
|
+
'wdio/await-expect': 'error',
|
|
17
|
+
'wdio/no-debug': 'error',
|
|
18
|
+
'wdio/no-pause': 'error',
|
|
19
|
+
},
|
|
20
|
+
} as const
|
|
21
|
+
|
|
22
|
+
const index = {
|
|
23
|
+
configs: {},
|
|
24
|
+
rules: {
|
|
25
|
+
'await-expect': awaitExpect,
|
|
26
|
+
'no-debug': noDebug,
|
|
27
|
+
'no-pause': noPause,
|
|
28
|
+
},
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const legacyConfig = {
|
|
32
|
+
...sharedConfig,
|
|
33
|
+
globals: sharedGlobals,
|
|
34
|
+
plugins: ['wdio'],
|
|
9
35
|
}
|
|
10
36
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
multiremotebrowser: false,
|
|
20
|
-
},
|
|
21
|
-
rules: {
|
|
22
|
-
'wdio/await-expect': 'error',
|
|
23
|
-
'wdio/no-debug': 'error',
|
|
24
|
-
'wdio/no-pause': 'error',
|
|
25
|
-
}
|
|
26
|
-
}
|
|
37
|
+
const flatConfig = {
|
|
38
|
+
...sharedConfig,
|
|
39
|
+
languageOptions: {
|
|
40
|
+
globals: sharedGlobals,
|
|
41
|
+
},
|
|
42
|
+
plugins: {
|
|
43
|
+
wdio: index,
|
|
44
|
+
},
|
|
27
45
|
}
|
|
28
46
|
|
|
29
|
-
export {
|
|
30
|
-
|
|
31
|
-
configs
|
|
47
|
+
export = {
|
|
48
|
+
...index,
|
|
49
|
+
configs: {
|
|
50
|
+
'flat/recommended': flatConfig,
|
|
51
|
+
recommended: legacyConfig,
|
|
52
|
+
},
|
|
32
53
|
}
|