Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove unused eslint disable comments #7640

Merged
merged 3 commits into from
Jan 16, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"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=