Skip to content

Commit

Permalink
Initial Eslint Standard Code Style
Browse files Browse the repository at this point in the history
  • Loading branch information
ralic committed Oct 24, 2019
1 parent 3f1e01d commit 4eb1ba9
Show file tree
Hide file tree
Showing 144 changed files with 25,636 additions and 24,612 deletions.
26 changes: 26 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = {
env: {
browser: true,
es6: true,
node: true
},
extends: [
'standard'
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'
},
parserOptions: {
ecmaFeatures: {
jsx: true
},
ecmaVersion: 2018,
sourceType: 'module'
},
plugins: [
'react'
],
rules: {
}
}
41 changes: 20 additions & 21 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
'use strict';
'use strict'

var packageJSON = require('./package.json');
var packageJSON = require('./package.json')

module.exports = function (grunt) {
var utils = require('./src/utils')(grunt)
var tunnelId = Math.floor((new Date()).getTime() / 1000 - 1230768000).toString()

var utils = require('./src/utils')(grunt);
var tunnelId = Math.floor((new Date()).getTime() / 1000 - 1230768000).toString();

function negateResult(result, callback) {
function negateResult (result, callback) {
// Reverses the job's passed status. Can be used as the onTestComplete callback for
// the negative tests.
var user = process.env.SAUCE_USERNAME;
var pass = process.env.SAUCE_ACCESS_KEY;
var user = process.env.SAUCE_USERNAME
var pass = process.env.SAUCE_ACCESS_KEY

utils
.makeRequest({
method: 'PUT',
url: ['https://saucelabs.com/rest/v1', user, 'jobs', result.job_id].join('/'),
auth: { user: user, pass: pass },
json: { passed: !result.passed }
})
.thenResolve(!result.passed)
.nodeify(callback);
.makeRequest({
method: 'PUT',
url: ['https://saucelabs.com/rest/v1', user, 'jobs', result.job_id].join('/'),
auth: { user: user, pass: pass },
json: { passed: !result.passed }
})
.thenResolve(!result.passed)
.nodeify(callback)
}

grunt.task.loadTasks('tasks');
grunt.task.loadTasks('tasks')

require('load-grunt-config')(grunt, {
data: {
srcFiles: ['tasks/**/*.js', 'src/**/*.js', 'Gruntfile.js'],
negateResult: negateResult,
tunnelId: tunnelId,
baseSaucelabsTaskOptions: {
build: process.env.TRAVIS_JOB_ID || 'dev-'+process.env.USER+':'+Date.now(),
tags: ['v'+packageJSON.version, 'grunt-saucelabs'],
build: process.env.TRAVIS_JOB_ID || 'dev-' + process.env.USER + ':' + Date.now(),
tags: ['v' + packageJSON.version, 'grunt-saucelabs'],
browsers: [
['Windows 7', 'chrome', '']
],
Expand All @@ -44,5 +43,5 @@ module.exports = function (grunt) {
}
}
}
});
};
})
}
12 changes: 6 additions & 6 deletions examples/custom/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = function (grunt) {
browserName: 'internet explorer',
platform: 'VISTA',
version: '9'
}];
}]

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
Expand Down Expand Up @@ -47,10 +47,10 @@ module.exports = function (grunt) {
}
},
watch: {}
});
})

grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-saucelabs');
grunt.loadNpmTasks('grunt-contrib-connect')
grunt.loadNpmTasks('grunt-saucelabs')

grunt.registerTask('default', ['connect', 'saucelabs-custom']);
};
grunt.registerTask('default', ['connect', 'saucelabs-custom'])
}
12 changes: 6 additions & 6 deletions examples/jasmine/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = function (grunt) {
browserName: 'internet explorer',
platform: 'VISTA',
version: '9'
}];
}]

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
Expand Down Expand Up @@ -48,10 +48,10 @@ module.exports = function (grunt) {
}
},
watch: {}
});
})

grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-saucelabs');
grunt.loadNpmTasks('grunt-contrib-connect')
grunt.loadNpmTasks('grunt-saucelabs')

grunt.registerTask('default', ['connect', 'saucelabs-jasmine']);
};
grunt.registerTask('default', ['connect', 'saucelabs-jasmine'])
}
Loading

0 comments on commit 4eb1ba9

Please sign in to comment.