Skip to content

Commit

Permalink
chore: remove unused eslint disable comments (jestjs#7640)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB authored and captain-yossarian committed Jul 18, 2019
1 parent 432b1d2 commit 2a997ad
Show file tree
Hide file tree
Showing 19 changed files with 41 additions and 54 deletions.
58 changes: 29 additions & 29 deletions e2e/__tests__/__snapshots__/failures.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -187,39 +187,39 @@ exports[`not throwing Error objects 5`] = `
22 |
> 23 | test('Object thrown during test', () => {
| ^
24 | // eslint-disable-next-line no-throw-literal
25 | throw deepObject;
26 | });
24 | throw deepObject;
25 | });
26 |
at Object.test (__tests__/duringTests.test.js:23:1)
● Error during test
ReferenceError: doesNotExist is not defined
28 | test('Error during test', () => {
29 | // eslint-disable-next-line no-undef
> 30 | doesNotExist.alsoThisNot;
27 | test('Error during test', () => {
28 | // eslint-disable-next-line no-undef
> 29 | doesNotExist.alsoThisNot;
| ^
31 | });
32 |
33 | test('done(Error)', done => {
30 | });
31 |
32 | test('done(Error)', done => {
at Object.doesNotExist (__tests__/duringTests.test.js:30:3)
at Object.doesNotExist (__tests__/duringTests.test.js:29:3)
done(Error)
this is an error
32 |
33 | test('done(Error)', done => {
> 34 | done(new Error('this is an error'));
31 |
32 | test('done(Error)', done => {
> 33 | done(new Error('this is an error'));
| ^
35 | });
36 |
37 | test('done(non-error)', done => {
34 | });
35 |
36 | test('done(non-error)', done => {
at Object.<anonymous>.done (__tests__/duringTests.test.js:34:8)
at Object.<anonymous>.done (__tests__/duringTests.test.js:33:8)
● done(non-error)
Expand All @@ -232,15 +232,15 @@ exports[`not throwing Error objects 5`] = `
],
}
36 |
37 | test('done(non-error)', done => {
> 38 | done(deepObject);
35 |
36 | test('done(non-error)', done => {
> 37 | done(deepObject);
| ^
39 | });
40 |
41 | test('returned promise rejection', () => Promise.reject(deepObject));
38 | });
39 |
40 | test('returned promise rejection', () => Promise.reject(deepObject));
at Object.done (__tests__/duringTests.test.js:38:3)
at Object.done (__tests__/duringTests.test.js:37:3)
● returned promise rejection
Expand All @@ -253,13 +253,13 @@ exports[`not throwing Error objects 5`] = `
],
}
39 | });
40 |
> 41 | test('returned promise rejection', () => Promise.reject(deepObject));
38 | });
39 |
> 40 | test('returned promise rejection', () => Promise.reject(deepObject));
| ^
42 |
41 |
at Object.test (__tests__/duringTests.test.js:41:1)
at Object.test (__tests__/duringTests.test.js:40:1)
"
`;
Expand Down
1 change: 0 additions & 1 deletion e2e/failures/__tests__/duringTests.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ test('undefined thrown during test', () => {
});

test('Object thrown during test', () => {
// eslint-disable-next-line no-throw-literal
throw deepObject;
});

Expand Down
2 changes: 0 additions & 2 deletions examples/enzyme/__tests__/CheckboxWithLabel-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Copyright 2004-present Facebook. All Rights Reserved.

/* eslint-disable no-unused-vars */

import React from 'react';
import Enzyme, {shallow} from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
Expand Down
2 changes: 0 additions & 2 deletions examples/react/__tests__/CheckboxWithLabel-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Copyright 2004-present Facebook. All Rights Reserved.

/* eslint-disable no-unused-vars */

import React from 'react';
import ReactDOM from 'react-dom';
import * as TestUtils from 'react-dom/test-utils';
Expand Down
1 change: 0 additions & 1 deletion examples/snapshot/__tests__/clock.react.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Copyright 2004-present Facebook. All Rights Reserved.
/* eslint-disable no-unused-vars */

'use strict';

Expand Down
1 change: 0 additions & 1 deletion examples/snapshot/__tests__/link.react.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Copyright 2004-present Facebook. All Rights Reserved.
/* eslint-disable no-unused-vars */

'use strict';

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"clean-e2e": "find ./e2e -not \\( -path ./e2e/presets/js -prune \\) -not \\( -path ./e2e/presets/json -prune \\) -mindepth 2 -type d \\( -name node_modules -prune \\) -exec rm -r '{}' +",
"jest": "node ./packages/jest-cli/bin/jest.js",
"jest-coverage": "yarn jest --coverage",
"lint": "eslint . --cache --ext js,md",
"lint": "eslint . --cache --report-unused-disable-directives --ext js,md",
"lint-es5-build": "eslint --no-eslintrc --no-ignore --env=browser packages/*/build-es5",
"lint:md": "yarn --silent lint:md:ci --fix",
"lint:md:ci": "prettylint '**/*.md' --ignore-path .gitignore",
Expand Down
2 changes: 0 additions & 2 deletions packages/jest-environment-node/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ class NodeEnvironment {
}

// Disabling rule as return type depends on script's return type.
/* eslint-disable flowtype/no-weak-types */
runScript(script: Script): ?any {
/* eslint-enable flowtype/no-weak-types */
if (this.context) {
return script.runInContext(this.context);
}
Expand Down
1 change: 0 additions & 1 deletion packages/jest-jasmine2/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import type {Environment} from 'types/Environment';
import type {GlobalConfig, ProjectConfig} from 'types/Config';
import type {SnapshotState} from 'jest-snapshot';
import type {TestResult} from 'types/TestResult';
// eslint-disable-next-line import/no-extraneous-dependencies
import type Runtime from 'jest-runtime';

import path from 'path';
Expand Down
1 change: 0 additions & 1 deletion packages/jest-jasmine2/src/jasmine/CallTracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/* @flow */
/* eslint-disable sort-keys */

function CallTracker() {
let calls = [];
Expand Down
1 change: 0 additions & 1 deletion packages/jest-jasmine2/src/jasmine/ReportDispatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/* @flow */
/* eslint-disable sort-keys */

export default function ReportDispatcher(methods: Array<string>) {
const dispatchedMethods = methods || [];
Expand Down
1 change: 0 additions & 1 deletion packages/jest-jasmine2/src/jasmine/SpyStrategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/* @flow */
/* eslint-disable sort-keys */

export default function SpyStrategy(options: Object) {
options = options || {};
Expand Down
1 change: 0 additions & 1 deletion packages/jest-jasmine2/src/jasmine/Timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/* @flow */
/* eslint-disable sort-keys */

const defaultNow = (function(Date) {
return function() {
Expand Down
4 changes: 0 additions & 4 deletions packages/jest-util/src/FakeTimers.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ import setGlobal from './setGlobal';
* we are disabling the flowtype/no-weak-types rule here.
*/

/* eslint-disable flowtype/no-weak-types */
type Callback = (...args: any) => void;
/* eslint-enable flowtype/no-weak-types */

type TimerID = string;

Expand Down Expand Up @@ -50,11 +48,9 @@ type TimerAPI = {
* here.
*/

/* eslint-disable flowtype/no-weak-types */
setImmediate(callback: Callback, ms?: number, ...args: Array<any>): number,
setInterval(callback: Callback, ms?: number, ...args: Array<any>): number,
setTimeout(callback: Callback, ms?: number, ...args: Array<any>): number,
/* eslint-enable flowtype/no-weak-types */
};

type TimerConfig<Ref> = {|
Expand Down
1 change: 0 additions & 1 deletion packages/jest-util/src/__tests__/fakeTimers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ describe('FakeTimers', () => {
});

describe('construction', () => {
/* eslint-disable no-new */
it('installs setTimeout mock', () => {
const global = {process};
const timers = new FakeTimers({global, moduleMocker, timerConfig});
Expand Down
3 changes: 3 additions & 0 deletions packages/jest-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"merge-stream": "^1.0.1",
"supports-color": "^6.1.0"
},
"devDependencies": {
"worker-farm": "^1.6.0"
},
"engines": {
"node": ">= 6"
}
Expand Down
1 change: 0 additions & 1 deletion packages/jest-worker/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ export default class JestWorker {
});
}

// eslint-disable-next-line no-unclear-flowtypes
_callFunctionWithArgs(method: string, ...args: Array<any>): Promise<any> {
if (this._ending) {
throw new Error('Farm is ended, no more calls can be done to it');
Expand Down
2 changes: 0 additions & 2 deletions packages/jest-worker/src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
// coming from any of the other processes cannot be typed. Thus, many types
// include "any" as a flow type, which is (unfortunately) correct here.

/* eslint-disable no-unclear-flowtypes */

export const CHILD_MESSAGE_INITIALIZE: 0 = 0;
export const CHILD_MESSAGE_CALL: 1 = 1;
export const CHILD_MESSAGE_END: 2 = 2;
Expand Down
10 changes: 8 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4495,7 +4495,7 @@ err-code@^1.0.0:
resolved "https://registry.yarnpkg.com/err-code/-/err-code-1.1.2.tgz#06e0116d3028f6aef4806849eb0ea6a748ae6960"
integrity sha1-BuARbTAo9q70gGhJ6w6mp0iuaWA=

errno@^0.1.1, errno@~0.1.1:
errno@^0.1.1, errno@~0.1.1, errno@~0.1.7:
version "0.1.7"
resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618"
integrity sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==
Expand Down Expand Up @@ -13375,6 +13375,13 @@ wordwrap@~0.0.2:
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107"
integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc=

worker-farm@^1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.6.0.tgz#aecc405976fab5a95526180846f0dba288f3a4a0"
integrity sha512-6w+3tHbM87WnSWnENBUvA2pxJPLhQUg5LKwUQHq3r+XPhIM+Gh2R5ycbwPCyuGbNg+lPgdcnQUhuC02kJCvffQ==
dependencies:
errno "~0.1.7"

wrap-ansi@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85"
Expand Down Expand Up @@ -13648,4 +13655,3 @@ [email protected]:
version "0.1.2"
resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419"
integrity sha1-AI4G2AlDIMNy28L47XagymyKxBk=

0 comments on commit 2a997ad

Please sign in to comment.