eslint-plugin-wdio 7.19.4 → 7.20.8-alpha.504
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.d.ts.map +1 -1
- package/build/constants.js +3 -4
- package/build/index.js +7 -14
- package/build/rules/await-expect.js +4 -6
- package/build/rules/no-debug.js +4 -6
- package/build/rules/no-pause.js +4 -6
- package/build/utils/helpers.d.ts.map +1 -1
- package/build/utils/helpers.js +4 -10
- package/package.json +10 -6
- package/src/constants.ts +2 -0
- package/src/index.ts +16 -16
- package/src/rules/await-expect.ts +2 -2
- package/src/rules/no-debug.ts +2 -2
- package/src/rules/no-pause.ts +2 -2
- package/src/utils/helpers.ts +0 -2
package/build/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,UAkCpB,CAAA"}
|
package/build/constants.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MATCHERS = void 0;
|
|
4
|
-
exports.MATCHERS = [
|
|
1
|
+
export const MATCHERS = [
|
|
5
2
|
'toHaveTitle',
|
|
6
3
|
'toHaveTitleContaining',
|
|
7
4
|
'toHaveUrl',
|
|
@@ -11,7 +8,9 @@ exports.MATCHERS = [
|
|
|
11
8
|
'toBeDisplayed',
|
|
12
9
|
'toBeDisplayedInViewport',
|
|
13
10
|
'toBeEnabled',
|
|
11
|
+
'toExist',
|
|
14
12
|
'toBeExisting',
|
|
13
|
+
'toBePresent',
|
|
15
14
|
'toBeFocused',
|
|
16
15
|
'toBeSelected',
|
|
17
16
|
'toHaveAttribute',
|
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,13 +1,11 @@
|
|
|
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',
|
|
7
5
|
docs: {
|
|
8
6
|
description: 'expect must be prefixed with await',
|
|
9
7
|
category: 'Possible Errors',
|
|
10
|
-
url: 'https://github.com/webdriverio/packages/eslint-plugin-wdio/docs/rules/await-expect.md',
|
|
8
|
+
url: 'https://github.com/webdriverio/webdriverio/blob/main/packages/eslint-plugin-wdio/docs/rules/await-expect.md',
|
|
11
9
|
recommended: false,
|
|
12
10
|
},
|
|
13
11
|
messages: {
|
|
@@ -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,13 +1,11 @@
|
|
|
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',
|
|
7
5
|
docs: {
|
|
8
6
|
description: 'Disallow browser.debug() in tests',
|
|
9
7
|
category: 'Possible Errors',
|
|
10
|
-
url: 'https://github.com/webdriverio/packages/eslint-plugin-wdio/docs/rules/no-debug.md',
|
|
8
|
+
url: 'https://github.com/webdriverio/webdriverio/blob/main/packages/eslint-plugin-wdio/docs/rules/no-debug.md',
|
|
11
9
|
recommended: false,
|
|
12
10
|
},
|
|
13
11
|
messages: {
|
|
@@ -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,13 +1,11 @@
|
|
|
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',
|
|
7
5
|
docs: {
|
|
8
6
|
description: 'Disallow browser.pause() in tests',
|
|
9
7
|
category: 'Possible Errors',
|
|
10
|
-
url: 'https://github.com/webdriverio/packages/eslint-plugin-wdio/docs/rules/no-pause.md',
|
|
8
|
+
url: 'https://github.com/webdriverio/webdriverio/blob/main/packages/eslint-plugin-wdio/docs/rules/no-pause.md',
|
|
11
9
|
recommended: false,
|
|
12
10
|
},
|
|
13
11
|
messages: {
|
|
@@ -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,17 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-wdio",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.20.8-alpha.504+428a9d729",
|
|
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",
|
|
14
|
-
"url": "git://github.com/webdriverio/webdriverio.git"
|
|
17
|
+
"url": "git://github.com/webdriverio/webdriverio.git",
|
|
18
|
+
"directory": "packages/eslint-plugin-wdio"
|
|
15
19
|
},
|
|
16
20
|
"keywords": [
|
|
17
21
|
"eslint",
|
|
@@ -24,8 +28,8 @@
|
|
|
24
28
|
"url": "https://github.com/webdriverio/webdriverio/issues"
|
|
25
29
|
},
|
|
26
30
|
"devDependencies": {
|
|
27
|
-
"@types/estree": "^0.0.
|
|
31
|
+
"@types/estree": "^0.0.52",
|
|
28
32
|
"eslint": "^8.10.0"
|
|
29
33
|
},
|
|
30
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "428a9d729ae6231968a60908732fa3f607d195e9"
|
|
31
35
|
}
|
package/src/constants.ts
CHANGED
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
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Rule } from 'eslint'
|
|
2
2
|
import type { Identifier } from 'estree'
|
|
3
3
|
|
|
4
|
-
import { MATCHERS } from '../constants'
|
|
4
|
+
import { MATCHERS } from '../constants.js'
|
|
5
5
|
|
|
6
6
|
const rule: Rule.RuleModule = {
|
|
7
7
|
meta: {
|
|
@@ -9,7 +9,7 @@ const rule: Rule.RuleModule = {
|
|
|
9
9
|
docs: {
|
|
10
10
|
description: 'expect must be prefixed with await',
|
|
11
11
|
category: 'Possible Errors',
|
|
12
|
-
url: 'https://github.com/webdriverio/packages/eslint-plugin-wdio/docs/rules/await-expect.md',
|
|
12
|
+
url: 'https://github.com/webdriverio/webdriverio/blob/main/packages/eslint-plugin-wdio/docs/rules/await-expect.md',
|
|
13
13
|
recommended: false,
|
|
14
14
|
},
|
|
15
15
|
messages: {
|
package/src/rules/no-debug.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Rule } from 'eslint'
|
|
2
|
-
import { isCommand } from '../utils/helpers'
|
|
2
|
+
import { isCommand } from '../utils/helpers.js'
|
|
3
3
|
|
|
4
4
|
const rule: Rule.RuleModule = {
|
|
5
5
|
meta: {
|
|
@@ -7,7 +7,7 @@ const rule: Rule.RuleModule = {
|
|
|
7
7
|
docs: {
|
|
8
8
|
description: 'Disallow browser.debug() in tests',
|
|
9
9
|
category: 'Possible Errors',
|
|
10
|
-
url: 'https://github.com/webdriverio/packages/eslint-plugin-wdio/docs/rules/no-debug.md',
|
|
10
|
+
url: 'https://github.com/webdriverio/webdriverio/blob/main/packages/eslint-plugin-wdio/docs/rules/no-debug.md',
|
|
11
11
|
recommended: false,
|
|
12
12
|
},
|
|
13
13
|
messages: {
|
package/src/rules/no-pause.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Rule } from 'eslint'
|
|
2
|
-
import { isCommand } from '../utils/helpers'
|
|
2
|
+
import { isCommand } from '../utils/helpers.js'
|
|
3
3
|
|
|
4
4
|
const rule: Rule.RuleModule = {
|
|
5
5
|
meta: {
|
|
@@ -7,7 +7,7 @@ const rule: Rule.RuleModule = {
|
|
|
7
7
|
docs: {
|
|
8
8
|
description: 'Disallow browser.pause() in tests',
|
|
9
9
|
category: 'Possible Errors',
|
|
10
|
-
url: 'https://github.com/webdriverio/packages/eslint-plugin-wdio/docs/rules/no-pause.md',
|
|
10
|
+
url: 'https://github.com/webdriverio/webdriverio/blob/main/packages/eslint-plugin-wdio/docs/rules/no-pause.md',
|
|
11
11
|
recommended: false,
|
|
12
12
|
},
|
|
13
13
|
messages: {
|