eslint-plugin-wdio 7.21.0 → 8.0.0-alpha.239
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 +1 -4
- package/build/index.js +7 -14
- package/build/rules/await-expect.js +3 -5
- package/build/rules/no-debug.js +3 -5
- package/build/rules/no-pause.js +3 -5
- package/build/utils/helpers.d.ts.map +1 -1
- package/build/utils/helpers.js +4 -10
- package/package.json +8 -5
- package/src/index.ts +16 -16
- package/src/rules/await-expect.ts +1 -1
- package/src/rules/no-debug.ts +1 -1
- package/src/rules/no-pause.ts +1 -1
- package/src/utils/helpers.ts +0 -2
package/build/constants.js
CHANGED
package/build/index.js
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.configs = exports.rules = void 0;
|
|
7
|
-
const await_expect_1 = __importDefault(require("./rules/await-expect"));
|
|
8
|
-
const no_debug_1 = __importDefault(require("./rules/no-debug"));
|
|
9
|
-
const no_pause_1 = __importDefault(require("./rules/no-pause"));
|
|
1
|
+
import awaitExpect from './rules/await-expect.js';
|
|
2
|
+
import noDebug from './rules/no-debug.js';
|
|
3
|
+
import noPause from './rules/no-pause.js';
|
|
10
4
|
const rules = {
|
|
11
|
-
'await-expect':
|
|
12
|
-
'no-debug':
|
|
13
|
-
'no-pause':
|
|
5
|
+
'await-expect': awaitExpect,
|
|
6
|
+
'no-debug': noDebug,
|
|
7
|
+
'no-pause': noPause
|
|
14
8
|
};
|
|
15
|
-
exports.rules = rules;
|
|
16
9
|
const configs = {
|
|
17
10
|
recommended: {
|
|
18
11
|
globals: {
|
|
@@ -30,4 +23,4 @@ const configs = {
|
|
|
30
23
|
}
|
|
31
24
|
}
|
|
32
25
|
};
|
|
33
|
-
|
|
26
|
+
export { rules, configs, };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const constants_1 = require("../constants");
|
|
1
|
+
import { MATCHERS } from '../constants.js';
|
|
4
2
|
const rule = {
|
|
5
3
|
meta: {
|
|
6
4
|
type: 'problem',
|
|
@@ -25,7 +23,7 @@ const rule = {
|
|
|
25
23
|
if (node.callee.type !== 'MemberExpression' ||
|
|
26
24
|
node.callee.object.type !== 'CallExpression' ||
|
|
27
25
|
node.callee.object.callee.name !== 'expect' ||
|
|
28
|
-
!
|
|
26
|
+
!MATCHERS.includes(node.callee.property.name)) {
|
|
29
27
|
return;
|
|
30
28
|
}
|
|
31
29
|
/**
|
|
@@ -43,4 +41,4 @@ const rule = {
|
|
|
43
41
|
};
|
|
44
42
|
}
|
|
45
43
|
};
|
|
46
|
-
|
|
44
|
+
export default rule;
|
package/build/rules/no-debug.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const helpers_1 = require("../utils/helpers");
|
|
1
|
+
import { isCommand } from '../utils/helpers.js';
|
|
4
2
|
const rule = {
|
|
5
3
|
meta: {
|
|
6
4
|
type: 'problem',
|
|
@@ -19,11 +17,11 @@ const rule = {
|
|
|
19
17
|
create: function (context) {
|
|
20
18
|
return {
|
|
21
19
|
CallExpression(node) {
|
|
22
|
-
if (
|
|
20
|
+
if (isCommand(node, 'debug')) {
|
|
23
21
|
context.report({ node, messageId: 'unexpectedDebug' });
|
|
24
22
|
}
|
|
25
23
|
}
|
|
26
24
|
};
|
|
27
25
|
}
|
|
28
26
|
};
|
|
29
|
-
|
|
27
|
+
export default rule;
|
package/build/rules/no-pause.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const helpers_1 = require("../utils/helpers");
|
|
1
|
+
import { isCommand } from '../utils/helpers.js';
|
|
4
2
|
const rule = {
|
|
5
3
|
meta: {
|
|
6
4
|
type: 'problem',
|
|
@@ -19,11 +17,11 @@ const rule = {
|
|
|
19
17
|
create: function (context) {
|
|
20
18
|
return {
|
|
21
19
|
CallExpression(node) {
|
|
22
|
-
if (
|
|
20
|
+
if (isCommand(node, 'pause')) {
|
|
23
21
|
context.report({ node, messageId: 'unexpectedPause' });
|
|
24
22
|
}
|
|
25
23
|
}
|
|
26
24
|
};
|
|
27
25
|
}
|
|
28
26
|
};
|
|
29
|
-
|
|
27
|
+
export default rule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/utils/helpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,eAAwB,GAAG,WAAW,OAAO,GAAG,OAAO,KAAG,OAQ/E,CAAA"}
|
package/build/utils/helpers.js
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.isCommand = void 0;
|
|
5
|
-
const isCommand = function (expression, command) {
|
|
6
|
-
var _a, _b;
|
|
7
|
-
const callee = expression === null || expression === void 0 ? void 0 : expression.callee;
|
|
1
|
+
export const isCommand = function (expression, command) {
|
|
2
|
+
const callee = expression?.callee;
|
|
8
3
|
return (callee &&
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
callee?.object?.name === 'browser' &&
|
|
5
|
+
callee?.property?.name === command);
|
|
11
6
|
};
|
|
12
|
-
exports.isCommand = isCommand;
|
package/package.json
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-wdio",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-alpha.239+00a68ded0",
|
|
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
|
-
"
|
|
8
|
+
"type": "module",
|
|
9
|
+
"exports": "./build/index.js",
|
|
10
|
+
"types": "./build/index.d.ts",
|
|
11
|
+
"typeScriptVersion": "3.8.3",
|
|
9
12
|
"engines": {
|
|
10
|
-
"node": ">=
|
|
13
|
+
"node": "^16.13 || >=18"
|
|
11
14
|
},
|
|
12
15
|
"repository": {
|
|
13
16
|
"type": "git",
|
|
@@ -24,8 +27,8 @@
|
|
|
24
27
|
"url": "https://github.com/webdriverio/webdriverio/issues"
|
|
25
28
|
},
|
|
26
29
|
"devDependencies": {
|
|
27
|
-
"@types/estree": "^
|
|
30
|
+
"@types/estree": "^0.0.52",
|
|
28
31
|
"eslint": "^8.10.0"
|
|
29
32
|
},
|
|
30
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "00a68ded03fea7b5f348eff0ca1d9b771f90fa75"
|
|
31
34
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import awaitExpect from './rules/await-expect'
|
|
2
|
-
import noDebug
|
|
3
|
-
import noPause
|
|
1
|
+
import awaitExpect from './rules/await-expect.js'
|
|
2
|
+
import noDebug from './rules/no-debug.js'
|
|
3
|
+
import noPause from './rules/no-pause.js'
|
|
4
4
|
|
|
5
5
|
const rules = {
|
|
6
|
-
'await-expect'
|
|
7
|
-
'no-debug'
|
|
8
|
-
'no-pause'
|
|
6
|
+
'await-expect': awaitExpect,
|
|
7
|
+
'no-debug': noDebug,
|
|
8
|
+
'no-pause': noPause
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
const configs = {
|
|
12
12
|
recommended: {
|
|
13
13
|
globals: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
browser
|
|
17
|
-
driver
|
|
18
|
-
expect
|
|
19
|
-
multiremotebrowser
|
|
14
|
+
$: false,
|
|
15
|
+
$$: false,
|
|
16
|
+
browser: false,
|
|
17
|
+
driver: false,
|
|
18
|
+
expect: false,
|
|
19
|
+
multiremotebrowser: false,
|
|
20
20
|
},
|
|
21
|
-
rules
|
|
22
|
-
'wdio/await-expect'
|
|
23
|
-
'wdio/no-debug'
|
|
24
|
-
'wdio/no-pause'
|
|
21
|
+
rules: {
|
|
22
|
+
'wdio/await-expect': 'error',
|
|
23
|
+
'wdio/no-debug': 'error',
|
|
24
|
+
'wdio/no-pause': 'error',
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|
package/src/rules/no-debug.ts
CHANGED
package/src/rules/no-pause.ts
CHANGED