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.
@@ -1,4 +1,7 @@
1
- export const MATCHERS = [
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MATCHERS = void 0;
4
+ exports.MATCHERS = [
2
5
  'toHaveTitle',
3
6
  'toHaveTitleContaining',
4
7
  'toHaveUrl',
package/build/index.d.ts CHANGED
@@ -1,24 +1,54 @@
1
- declare const rules: {
2
- 'await-expect': import("eslint").Rule.RuleModule;
3
- 'no-debug': import("eslint").Rule.RuleModule;
4
- 'no-pause': import("eslint").Rule.RuleModule;
5
- };
6
- declare const configs: {
7
- recommended: {
8
- globals: {
9
- $: boolean;
10
- $$: boolean;
11
- browser: boolean;
12
- driver: boolean;
13
- expect: boolean;
14
- multiremotebrowser: boolean;
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
- rules: {
17
- 'wdio/await-expect': string;
18
- 'wdio/no-debug': string;
19
- 'wdio/no-pause': string;
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 { rules, configs, };
53
+ export = _default;
24
54
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,KAAK;;;;CAIV,CAAA;AAED,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;CAgBZ,CAAA;AAED,OAAO,EACH,KAAK,EACL,OAAO,GACV,CAAA"}
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
- import awaitExpect from './rules/await-expect.js';
2
- import noDebug from './rules/no-debug.js';
3
- import noPause from './rules/no-pause.js';
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 configs = {
10
- recommended: {
11
- globals: {
12
- $: false,
13
- $$: false,
14
- browser: false,
15
- driver: false,
16
- expect: false,
17
- multiremotebrowser: false,
18
- },
19
- rules: {
20
- 'wdio/await-expect': 'error',
21
- 'wdio/no-debug': 'error',
22
- 'wdio/no-pause': 'error',
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
- import { MATCHERS } from '../constants.js';
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
- export default rule;
46
+ exports.default = rule;
@@ -1,4 +1,6 @@
1
- import { isCommand } from '../utils/helpers.js';
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
- export default rule;
29
+ exports.default = rule;
@@ -1,4 +1,6 @@
1
- import { isCommand } from '../utils/helpers.js';
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
- export default rule;
29
+ exports.default = rule;
@@ -1,6 +1,10 @@
1
- export const isCommand = function (expression, command) {
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 rules = {
11
- 'await-expect': await_expect_js_1.default,
12
- 'no-debug': no_debug_js_1.default,
13
- 'no-pause': no_pause_js_1.default
8
+ const sharedGlobals = {
9
+ $: false,
10
+ $$: false,
11
+ browser: false,
12
+ driver: false,
13
+ expect: false,
14
+ multiremotebrowser: false,
14
15
  };
15
- exports.rules = rules;
16
- const configs = {
17
- recommended: {
18
- globals: {
19
- $: false,
20
- $$: false,
21
- browser: false,
22
- driver: false,
23
- expect: false,
24
- multiremotebrowser: false,
25
- },
26
- rules: {
27
- 'wdio/await-expect': 'error',
28
- 'wdio/no-debug': 'error',
29
- 'wdio/no-pause': 'error',
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.24.12",
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
- "types": "./build/index.d.ts",
16
- "import": "./build/index.js",
17
- "require": "./cjs/index.js"
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": "^8.10.0"
42
+ "eslint": "^9.0.0"
44
43
  },
45
- "gitHead": "ebf1ba1875fe210fda7067c1c13944c50cb6a694"
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 rules = {
6
- 'await-expect': awaitExpect,
7
- 'no-debug': noDebug,
8
- 'no-pause': noPause
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 configs = {
12
- recommended: {
13
- globals: {
14
- $: false,
15
- $$: false,
16
- browser: false,
17
- driver: false,
18
- expect: false,
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
- rules,
31
- configs,
47
+ export = {
48
+ ...index,
49
+ configs: {
50
+ 'flat/recommended': flatConfig,
51
+ recommended: legacyConfig,
52
+ },
32
53
  }