Skip to content

Commit bffc462

Browse files
committed
Bump eslint from v8 to v9
1 parent c90828d commit bffc462

File tree

31 files changed

+119
-144
lines changed

31 files changed

+119
-144
lines changed

.eslintrc.js

Lines changed: 0 additions & 63 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,3 @@ updates:
1515
ignore:
1616
- dependency-name: "escape-string-regexp"
1717
versions: [">=5.0"]
18-
- dependency-name: "eslint"
19-
versions: [ ">8.57.0" ]
20-

eslint.config.mjs

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import globals from "globals";
2+
import path from "node:path";
3+
import {fileURLToPath} from "node:url";
4+
import js from "@eslint/js";
5+
import {FlatCompat} from "@eslint/eslintrc";
6+
7+
const __filename = fileURLToPath(import.meta.url);
8+
const __dirname = path.dirname(__filename);
9+
const compat = new FlatCompat({
10+
baseDirectory: __dirname,
11+
recommendedConfig: js.configs.recommended,
12+
allConfig: js.configs.all
13+
});
14+
15+
export default [{
16+
ignores: ["test/data/output", "lib/css2xpath/*"],
17+
}, ...compat.extends("airbnb-base"), {
18+
languageOptions: {
19+
globals: {
20+
...globals.node,
21+
},
22+
23+
ecmaVersion: 2020,
24+
sourceType: "commonjs",
25+
},
26+
27+
rules: {
28+
"func-names": 0,
29+
"no-use-before-define": 0,
30+
"no-unused-vars": 0,
31+
"no-underscore-dangle": 0,
32+
"no-undef": 0,
33+
"prefer-destructuring": 0,
34+
"no-param-reassign": 0,
35+
"max-len": 0,
36+
camelcase: 0,
37+
"no-shadow": 0,
38+
"consistent-return": 0,
39+
"no-console": 0,
40+
"global-require": 0,
41+
"class-methods-use-this": 0,
42+
"no-plusplus": 0,
43+
"no-return-assign": 0,
44+
"prefer-rest-params": 0,
45+
"no-useless-escape": 0,
46+
"no-restricted-syntax": 0,
47+
"no-unused-expressions": 0,
48+
"guard-for-in": 0,
49+
"no-multi-assign": 0,
50+
"require-yield": 0,
51+
"prefer-spread": 0,
52+
"import/no-dynamic-require": 0,
53+
"no-continue": 0,
54+
"no-mixed-operators": 0,
55+
"default-case": 0,
56+
"import/no-extraneous-dependencies": 0,
57+
"no-cond-assign": 0,
58+
"import/no-unresolved": 0,
59+
"no-await-in-loop": 0,
60+
"arrow-body-style": 0,
61+
"no-loop-func": 0,
62+
"arrow-parens": 0,
63+
"default-param-last": 0,
64+
semi: 0,
65+
"operator-linebreak": 0,
66+
"nonblock-statement-body-position": 0,
67+
curly: 0,
68+
"implicit-arrow-linebreak": 0,
69+
indent: 0,
70+
"object-curly-newline": 0,
71+
"semi-style": 0,
72+
"function-paren-newline": 0,
73+
"prefer-template": 0,
74+
"newline-per-chained-call": 0,
75+
"prefer-arrow-callback": 0,
76+
"no-bitwise": 0,
77+
"prefer-const": 0,
78+
"no-extra-semi": 0,
79+
"max-classes-per-file": 0
80+
},
81+
}];

examples/fragments/Signin.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable */
21
let I;
32

43
module.exports = {

examples/pages/Admin.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable */
21
let I;
32

43
module.exports = {

lib/command/gherkin/snippets.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,6 @@ ${step.type}(${step.regexp ? '/^' : "'"}${step}${step.regexp ? '$/' : "'"}, () =
127127

128128
if (!options.dryRun) {
129129
output.success(`Snippets added to ${output.colors.bold(stepFile)}`);
130-
fs.writeFileSync(stepFile, fs.readFileSync(stepFile).toString() + snippets.join('\n') + '\n'); // eslint-disable-line
130+
fs.writeFileSync(stepFile, fs.readFileSync(stepFile).toString() + snippets.join('\n') + '\n');
131131
}
132132
};

lib/command/workers/runTests.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ const container = require('../../container');
1313
const { getConfig } = require('../utils');
1414
const { tryOrDefault, deepMerge } = require('../../utils');
1515

16-
// eslint-disable-next-line no-unused-vars
1716
let stdout = '';
18-
/* eslint-enable no-unused-vars */
17+
1918
const stderr = '';
2019

2120
// Requiring of Codecept need to be after tty.getWindowSize is available.

lib/heal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class Heal {
113113
});
114114

115115
if (typeof codeSnippet === 'string') {
116-
const I = Container.support('I'); // eslint-disable-line
116+
const I = Container.support('I');
117117
await eval(codeSnippet); // eslint-disable-line
118118
} else if (typeof codeSnippet === 'function') {
119119
await codeSnippet(Container.support());

lib/helper/Appium.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -493,15 +493,14 @@ class Appium extends Webdriver {
493493
*
494494
* @param {*} fn
495495
*/
496-
/* eslint-disable */
496+
497497
async runInWeb(fn) {
498498
if (!this.isWeb) return
499499
recorder.session.start('Web-only actions')
500500

501501
recorder.add('restore from Web session', () => recorder.session.restore(), true)
502502
return recorder.promise()
503503
}
504-
/* eslint-enable */
505504

506505
_runWithCaps(caps, fn) {
507506
if (typeof caps === 'object') {
@@ -1077,7 +1076,7 @@ class Appium extends Webdriver {
10771076
*
10781077
* Appium: support Android and iOS
10791078
*/
1080-
/* eslint-disable */
1079+
10811080
async swipe(locator, xoffset, yoffset, speed = 1000) {
10821081
onlyForApps.call(this)
10831082
const res = await this.browser.$(parseLocator.call(this, locator))
@@ -1087,7 +1086,6 @@ class Appium extends Webdriver {
10871086
y: (await res.getLocation()).y + yoffset,
10881087
})
10891088
}
1090-
/* eslint-enable */
10911089

10921090
/**
10931091
* Perform a swipe on the screen.

lib/helper/Nightmare.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,7 +1324,7 @@ class Nightmare extends Helper {
13241324
offsetY,
13251325
)
13261326
}
1327-
// eslint-disable-next-line prefer-arrow-callback
1327+
13281328
return this.executeScript(
13291329
function (x, y) {
13301330
return window.scrollTo(x, y)
@@ -1345,7 +1345,6 @@ class Nightmare extends Helper {
13451345
* {{> scrollPageToBottom }}
13461346
*/
13471347
async scrollPageToBottom() {
1348-
/* eslint-disable prefer-arrow-callback, comma-dangle */
13491348
return this.executeScript(function () {
13501349
const body = document.body
13511350
const html = document.documentElement
@@ -1354,21 +1353,19 @@ class Nightmare extends Helper {
13541353
Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight),
13551354
)
13561355
})
1357-
/* eslint-enable */
13581356
}
13591357

13601358
/**
13611359
* {{> grabPageScrollPosition }}
13621360
*/
13631361
async grabPageScrollPosition() {
1364-
/* eslint-disable comma-dangle */
13651362
function getScrollPosition() {
13661363
return {
13671364
x: window.pageXOffset,
13681365
y: window.pageYOffset,
13691366
}
13701367
}
1371-
/* eslint-enable comma-dangle */
1368+
13721369
return this.executeScript(getScrollPosition)
13731370
}
13741371
}

0 commit comments

Comments
 (0)