Skip to content

Commit c8369a3

Browse files
committed
Fix some eslint rules
1 parent c48e76e commit c8369a3

30 files changed

+86
-95
lines changed

.eslintrc.json

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,33 +23,18 @@
2323
"prefer-rest-params": 0,
2424
"no-useless-escape": 0,
2525
"no-restricted-syntax": 0,
26-
"one-var": 0,
2726
"no-unused-expressions": 0,
28-
"eqeqeq": 0,
2927
"guard-for-in": 0,
3028
"no-multi-assign": 0,
3129
"require-yield": 0,
3230
"prefer-spread": 0,
33-
"radix": 0,
3431
"import/no-dynamic-require": 0,
35-
"prefer-const": 0,
36-
"no-empty": 0,
3732
"no-continue": 0,
3833
"no-mixed-operators": 0,
3934
"default-case": 0,
4035
"import/no-extraneous-dependencies": 0,
41-
"no-bitwise": 0,
42-
"no-array-constructor": 0,
4336
"no-cond-assign": 0,
44-
"no-var": 0,
45-
"no-buffer-constructor": 0,
46-
"no-eval": 0,
4737
"array-callback-return": 0,
48-
"no-loop-func": 0,
49-
"quotes": 0,
50-
"import/no-unresolved": 0,
51-
"no-redeclare": 0,
52-
"function-paren-newline": 0,
53-
"no-useless-return": 0
38+
"function-paren-newline": 0
5439
}
5540
}

examples/pages/Admin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ let I;
33
module.exports = {
44

55
_init() {
6-
I = require('codeceptjs/actor')();
6+
I = actor();
77
},
88

99
// insert your locators and methods here

lib/codecept.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Codecept {
2020
constructor(config, opts) {
2121
this.config = Config.create(config);
2222
this.opts = opts;
23-
this.testFiles = new Array();
23+
this.testFiles = [];
2424
}
2525

2626
/**

lib/command/init.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,9 @@ module.exports = function (initPath) {
195195
print('Configure helpers...');
196196
inquirer.prompt(helperConfigs, (helperResult) => {
197197
Object.keys(helperResult).forEach((key) => {
198-
let helperName,
199-
configName;
200198
const parts = key.split('_');
201-
helperName = parts[0];
202-
configName = parts[1];
199+
const helperName = parts[0];
200+
const configName = parts[1];
203201
if (!configName) return;
204202
config.helpers[helperName][configName] = helperResult[key];
205203
});

lib/command/run-multiple.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ const output = require('../output');
99
const path = require('path');
1010

1111
const runner = path.join(__dirname, '/../../bin/codecept');
12-
let config,
13-
childOpts = {};
12+
let config;
13+
const childOpts = {};
1414
const copyOptions = ['steps', 'reporter', 'verbose', 'config', 'reporter-options', 'grep', 'fgrep', 'debug'];
1515

1616
// codeceptjs run:multiple smoke:chrome regression:firefox - will launch smoke suite in chrome and regression in firefox

lib/command/run.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ module.exports = function (test, options) {
1313
// registering options globally to use in config
1414
process.profile = options.profile;
1515
const configFile = options.config;
16-
let codecept,
17-
outputDir;
16+
let codecept;
17+
let outputDir;
1818

1919
const testRoot = getTestRoot(configFile);
2020
let config = getConfig(configFile);

lib/config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ module.exports = Config;
9595

9696
function loadConfigFile(configFile) {
9797
// .conf.js config file
98-
if (path.extname(configFile) == '.js') {
98+
if (path.extname(configFile) === '.js') {
9999
return Config.create(require(configFile).config);
100100
}
101101

102102
// json config provided
103-
if (path.extname(configFile) == '.json') {
103+
if (path.extname(configFile) === '.json') {
104104
return Config.create(JSON.parse(fs.readFileSync(configFile, 'utf8')));
105105
}
106106
throw new Error(`Config file ${configFile} can't be loaded`);

lib/container.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ function createSupportObjects(config) {
148148
if (!objects.I) {
149149
objects.I = require('./actor')();
150150

151-
if (container.translation.I != 'I') {
151+
if (container.translation.I !== 'I') {
152152
objects[container.translation.I] = objects.I;
153153
}
154154
}

lib/data/table.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class DataTable {
55
constructor(array) {
66
this.array = array;
7-
this.rows = new Array();
7+
this.rows = [];
88
}
99

1010
add(array) {

lib/helper/Appium.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,6 @@ function parseLocator(locator) {
12551255

12561256
// in the end of a file
12571257
function onlyForApps(expectedPlatform) {
1258-
let callerName;
12591258
const stack = new Error().stack || '';
12601259
const re = /Appium.(\w+)/g;
12611260
const caller = stack.split('\n')[2].trim();
@@ -1265,7 +1264,7 @@ function onlyForApps(expectedPlatform) {
12651264
throw new Error(`Invalid caller ${caller}`);
12661265
}
12671266

1268-
callerName = m[1] || m[2];
1267+
const callerName = m[1] || m[2];
12691268
if (!expectedPlatform) {
12701269
if (!this.platform) {
12711270
throw new Error(`${callerName} method can be used only with apps`);

0 commit comments

Comments
 (0)