Skip to content

Commit

Permalink
All: Enable ESLint recommended rules
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinji authored and trentmwillis committed Apr 10, 2018
1 parent 3700f57 commit 0a391ac
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 15 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.json
Expand Up @@ -2,7 +2,7 @@
"env": {
"es6": true
},
"extends": "jquery",
"extends": ["eslint:recommended", "jquery"],
"parserOptions": {
"sourceType": "module"
},
Expand All @@ -18,7 +18,9 @@
"SwitchCase": 0,
"outerIIFEBody": 1
}],
"no-console": "off",
"no-const-assign": "error",
"no-constant-condition": ["error", { "checkLoops": false }],
"no-dupe-class-members": "error",
"no-duplicate-imports": "error",
"no-multi-spaces": ["error", { "ignoreEOLComments": true }],
Expand Down
2 changes: 1 addition & 1 deletion bin/find-reporter.js
Expand Up @@ -31,7 +31,7 @@ function findReporter( reporterName ) {

// If we didn't find a reporter, display the available reporters and exit
displayAvailableReporters( reporterName );
};
}

function displayAvailableReporters( inputReporterName ) {
const message = [];
Expand Down
2 changes: 1 addition & 1 deletion bin/run.js
Expand Up @@ -100,7 +100,7 @@ function run( args, options ) {
process.exitCode = 0;
}
} );
};
}

run.restart = function( args ) {
clearTimeout( this._restartDebounceTimer );
Expand Down
2 changes: 1 addition & 1 deletion reporter/html.js
Expand Up @@ -747,7 +747,7 @@ export function escapeText( s ) {
// Strip tags, html entity and whitespaces
return string
.replace( /<\/?[^>]+(>|$)/g, "" )
.replace( /\&quot;/g, "" )
.replace( /&quot;/g, "" )
.replace( /\s+/g, "" );
}

Expand Down
2 changes: 1 addition & 1 deletion test/cli/fixtures/npm-reporter/index.js
@@ -1,6 +1,6 @@
function NPMReporter( runner ) {
runner.on( "runEnd", this.onRunEnd );
};
}

NPMReporter.init = function( runner ) {
return new NPMReporter( runner );
Expand Down
2 changes: 1 addition & 1 deletion test/main/assert/timeout.js
Expand Up @@ -34,7 +34,7 @@ QUnit.module( "assert.timeout", function() {
assert.timeout( 1 );

var wait = Date.now() + 10;
while ( Date.now() < wait ) {}
while ( Date.now() < wait ) {} // eslint-disable-line no-empty

assert.ok( true );
} );
Expand Down
10 changes: 5 additions & 5 deletions test/main/deepEqual.js
Expand Up @@ -509,17 +509,17 @@ QUnit.test( "RegExp", function( assert ) {

// Compare unicode modifier
try {
r2 = new RegExp( "foo", "umig" );
r3 = new RegExp( "foo", "mgiu" );
r2 = /foo/umig;
r3 = /foo/mgiu;
assert.equal( QUnit.equiv( r2, r3 ), true, "Modifier order" );
assert.equal( QUnit.equiv( r1, r2 ), false, "Modifier" );

ru1 = new RegExp( "/u{1D306}", "u" );
ru2 = new RegExp( "/u{1D306}", "u" );
ru1 = /\u{1D306}/u;
ru2 = /\u{1D306}/u;
assert.equal( QUnit.equiv( ru1, rg1 ), false, "Modifier" );
assert.equal( QUnit.equiv( rg1, ru1 ), false, "Modifier" );
assert.equal( QUnit.equiv( ru1, ru2 ), true, "Modifier" );
} catch ( e ) {}
} catch ( e ) {} // eslint-disable-line no-empty

// Different regex, same modifiers
r1 = /[a-z]/gi;
Expand Down
2 changes: 1 addition & 1 deletion test/reporter-html/reporter-html.js
Expand Up @@ -125,7 +125,7 @@ QUnit.test( "logs location", function( assert ) {
assert.equal( source.firstChild.innerHTML, "Source: " );

// The file test/reporter-html/reporter-html.js is a direct reference to this test file
assert.ok( /\/test\/reporter-html\/reporter-html\.js\:\d+/.test( source.innerHTML ),
assert.ok( /\/test\/reporter-html\/reporter-html\.js:\d+/.test( source.innerHTML ),
"Source references to the current file and line number"
);
} );
2 changes: 1 addition & 1 deletion test/reporter-html/single-testid.js
Expand Up @@ -2,7 +2,7 @@ QUnit.config.testId = [ "2e48c6fa", "9ccf6855" ];

QUnit.test( "Check for changed header after running filtered test", function( assert ) {
var html = document.getElementById( "qunit-filteredTest" ).innerHTML;
var result = html.match( /Rerunning selected tests\: 2e48c6fa\, 9ccf6855/ );
var result = html.match( /Rerunning selected tests: 2e48c6fa, 9ccf6855/ );
assert.ok( result );
} );

Expand Down
2 changes: 1 addition & 1 deletion test/reporter-html/window-onerror-preexisting-handler.html
Expand Up @@ -19,6 +19,6 @@
<script src="./window-onerror-preexisting-handler.js"></script>
</head>
<body>
<div id="qunit" />
<div id="qunit"></div>
</body>
</html>
2 changes: 1 addition & 1 deletion test/reporter-html/window-onerror-preexisting-handler.js
@@ -1,4 +1,4 @@
/* global onerrorReturnValue, onerrorCallingContext */
/* global onerrorReturnValue: true, onerrorCallingContext: true */
/* exported onerrorReturnValue */

QUnit.module( "window.onerror (with preexisting handler)", function( hooks ) {
Expand Down

0 comments on commit 0a391ac

Please sign in to comment.