diff --git a/e2e/__tests__/__snapshots__/failures.test.js.snap b/e2e/__tests__/__snapshots__/failures.test.js.snap index a63133b9c045..4955ba573aae 100644 --- a/e2e/__tests__/__snapshots__/failures.test.js.snap +++ b/e2e/__tests__/__snapshots__/failures.test.js.snap @@ -187,9 +187,9 @@ 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) @@ -197,29 +197,29 @@ exports[`not throwing Error objects 5`] = ` 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..done (__tests__/duringTests.test.js:34:8) + at Object..done (__tests__/duringTests.test.js:33:8) ● done(non-error) @@ -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 @@ -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) " `; diff --git a/e2e/failures/__tests__/duringTests.test.js b/e2e/failures/__tests__/duringTests.test.js index 60ba1c3f05b7..c315f5aa7cdc 100644 --- a/e2e/failures/__tests__/duringTests.test.js +++ b/e2e/failures/__tests__/duringTests.test.js @@ -21,7 +21,6 @@ test('undefined thrown during test', () => { }); test('Object thrown during test', () => { - // eslint-disable-next-line no-throw-literal throw deepObject; }); diff --git a/examples/enzyme/__tests__/CheckboxWithLabel-test.js b/examples/enzyme/__tests__/CheckboxWithLabel-test.js index a8e08b42b10a..be7aabef2437 100644 --- a/examples/enzyme/__tests__/CheckboxWithLabel-test.js +++ b/examples/enzyme/__tests__/CheckboxWithLabel-test.js @@ -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'; diff --git a/examples/react/__tests__/CheckboxWithLabel-test.js b/examples/react/__tests__/CheckboxWithLabel-test.js index fab2050fd26b..e563307dab59 100644 --- a/examples/react/__tests__/CheckboxWithLabel-test.js +++ b/examples/react/__tests__/CheckboxWithLabel-test.js @@ -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'; diff --git a/examples/snapshot/__tests__/clock.react.test.js b/examples/snapshot/__tests__/clock.react.test.js index d37ec7ac3fd4..a001ce248355 100644 --- a/examples/snapshot/__tests__/clock.react.test.js +++ b/examples/snapshot/__tests__/clock.react.test.js @@ -1,5 +1,4 @@ // Copyright 2004-present Facebook. All Rights Reserved. -/* eslint-disable no-unused-vars */ 'use strict'; diff --git a/examples/snapshot/__tests__/link.react.test.js b/examples/snapshot/__tests__/link.react.test.js index 6b594f244220..fd9b87115c42 100644 --- a/examples/snapshot/__tests__/link.react.test.js +++ b/examples/snapshot/__tests__/link.react.test.js @@ -1,5 +1,4 @@ // Copyright 2004-present Facebook. All Rights Reserved. -/* eslint-disable no-unused-vars */ 'use strict'; diff --git a/package.json b/package.json index 1d80255bc3c0..fb99a422887b 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/packages/jest-environment-node/src/index.js b/packages/jest-environment-node/src/index.js index 646f846d2ce5..f09b3f7c30a1 100644 --- a/packages/jest-environment-node/src/index.js +++ b/packages/jest-environment-node/src/index.js @@ -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); } diff --git a/packages/jest-jasmine2/src/index.js b/packages/jest-jasmine2/src/index.js index d9f84a70ed73..199afc3f94e2 100644 --- a/packages/jest-jasmine2/src/index.js +++ b/packages/jest-jasmine2/src/index.js @@ -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'; diff --git a/packages/jest-jasmine2/src/jasmine/CallTracker.js b/packages/jest-jasmine2/src/jasmine/CallTracker.js index 60020c8ea62b..3f676d118a05 100644 --- a/packages/jest-jasmine2/src/jasmine/CallTracker.js +++ b/packages/jest-jasmine2/src/jasmine/CallTracker.js @@ -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 = []; diff --git a/packages/jest-jasmine2/src/jasmine/ReportDispatcher.js b/packages/jest-jasmine2/src/jasmine/ReportDispatcher.js index 3194423f9861..aa1ed23997e7 100644 --- a/packages/jest-jasmine2/src/jasmine/ReportDispatcher.js +++ b/packages/jest-jasmine2/src/jasmine/ReportDispatcher.js @@ -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) { const dispatchedMethods = methods || []; diff --git a/packages/jest-jasmine2/src/jasmine/SpyStrategy.js b/packages/jest-jasmine2/src/jasmine/SpyStrategy.js index 57a11332ada6..2a996f085248 100644 --- a/packages/jest-jasmine2/src/jasmine/SpyStrategy.js +++ b/packages/jest-jasmine2/src/jasmine/SpyStrategy.js @@ -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 || {}; diff --git a/packages/jest-jasmine2/src/jasmine/Timer.js b/packages/jest-jasmine2/src/jasmine/Timer.js index 7d5b87d05165..be908df48185 100644 --- a/packages/jest-jasmine2/src/jasmine/Timer.js +++ b/packages/jest-jasmine2/src/jasmine/Timer.js @@ -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() { diff --git a/packages/jest-util/src/FakeTimers.js b/packages/jest-util/src/FakeTimers.js index 8fe11e83295d..c00a3c30da25 100644 --- a/packages/jest-util/src/FakeTimers.js +++ b/packages/jest-util/src/FakeTimers.js @@ -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; @@ -50,11 +48,9 @@ type TimerAPI = { * here. */ - /* eslint-disable flowtype/no-weak-types */ setImmediate(callback: Callback, ms?: number, ...args: Array): number, setInterval(callback: Callback, ms?: number, ...args: Array): number, setTimeout(callback: Callback, ms?: number, ...args: Array): number, - /* eslint-enable flowtype/no-weak-types */ }; type TimerConfig = {| diff --git a/packages/jest-util/src/__tests__/fakeTimers.test.js b/packages/jest-util/src/__tests__/fakeTimers.test.js index 3f153759b93c..c39fb0c2a4e4 100644 --- a/packages/jest-util/src/__tests__/fakeTimers.test.js +++ b/packages/jest-util/src/__tests__/fakeTimers.test.js @@ -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}); diff --git a/packages/jest-worker/package.json b/packages/jest-worker/package.json index 43b6b489284d..76d8bcf3f20e 100644 --- a/packages/jest-worker/package.json +++ b/packages/jest-worker/package.json @@ -11,6 +11,9 @@ "merge-stream": "^1.0.1", "supports-color": "^6.1.0" }, + "devDependencies": { + "worker-farm": "^1.6.0" + }, "engines": { "node": ">= 6" } diff --git a/packages/jest-worker/src/index.js b/packages/jest-worker/src/index.js index b5bc4885b53f..0b3c4a40b59b 100644 --- a/packages/jest-worker/src/index.js +++ b/packages/jest-worker/src/index.js @@ -111,7 +111,6 @@ export default class JestWorker { }); } - // eslint-disable-next-line no-unclear-flowtypes _callFunctionWithArgs(method: string, ...args: Array): Promise { if (this._ending) { throw new Error('Farm is ended, no more calls can be done to it'); diff --git a/packages/jest-worker/src/types.js b/packages/jest-worker/src/types.js index 15647155c50a..b0a80f325c77 100644 --- a/packages/jest-worker/src/types.js +++ b/packages/jest-worker/src/types.js @@ -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; diff --git a/yarn.lock b/yarn.lock index e3a2fe9da927..2ba5ee659775 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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== @@ -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" @@ -13648,4 +13655,3 @@ yeast@0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" integrity sha1-AI4G2AlDIMNy28L47XagymyKxBk= -