From 96469cbd35193fa10ff0498367466d3208f4a11b Mon Sep 17 00:00:00 2001 From: Guillaume Gautreau Date: Sat, 9 Dec 2017 23:59:18 +0100 Subject: [PATCH 1/8] Uses ESLint to catch errors and fixes ESLint errors #173 --- .eslintignore | 10 ++++++++++ .eslintrc.json | 10 ++++++++++ .travis.yml | 4 +++- bin/cli.js | 2 ++ package.json | 10 ++++++++-- src/Asset.js | 3 +-- src/Bundle.js | 1 - src/Bundler.js | 15 ++++++++------- src/FSCache.js | 5 ++++- src/Logger.js | 1 + src/Server.js | 2 -- src/assets/CSSAsset.js | 4 +--- src/assets/HTMLAsset.js | 2 -- src/assets/LESSAsset.js | 2 +- src/assets/RawAsset.js | 1 - src/builtins/.eslintrc.json | 9 +++++++++ src/builtins/bundle-url.js | 4 ++-- src/builtins/css-loader.js | 2 +- src/builtins/hmr-runtime.js | 2 ++ src/builtins/prelude.js | 16 ++++++++-------- src/packagers/Packager.js | 1 + src/transforms/babel.js | 1 - src/transforms/uglify.js | 2 -- src/utils/is-url.js | 2 +- src/visitors/dependencies.js | 1 - src/visitors/fs.js | 1 - src/visitors/globals.js | 1 - src/worker.js | 14 +++++--------- test/.eslintrc.json | 6 ++++++ test/fs.js | 3 +-- test/hmr.js | 12 ++++++------ test/html.js | 8 ++++---- test/integration/.eslintrc.json | 10 ++++++++++ test/integration/commonjs/index.js | 1 + test/integration/dynamic-esm/.eslintrc.json | 9 +++++++++ test/integration/es6-default-only/.eslintrc.json | 6 ++++++ test/integration/es6/.eslintrc.json | 6 ++++++ test/integration/es6/index.js | 3 ++- test/integration/fs-import/.eslintrc.json | 6 ++++++ test/server.js | 2 +- test/watcher.js | 4 ++-- 41 files changed, 138 insertions(+), 66 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc.json create mode 100644 src/builtins/.eslintrc.json create mode 100644 test/.eslintrc.json create mode 100644 test/integration/.eslintrc.json create mode 100644 test/integration/dynamic-esm/.eslintrc.json create mode 100644 test/integration/es6-default-only/.eslintrc.json create mode 100644 test/integration/es6/.eslintrc.json create mode 100644 test/integration/fs-import/.eslintrc.json diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000000..f649ae17ff6 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,10 @@ +# ESLint does not support both +# - import used as a function, and +# - the export statement +# in the same file + +/test/integration/dynamic/index.js +/test/integration/dynamic-css/index.js +/test/integration/dynamic-esm/index.js +/test/integration/dynamic-hoist/index.js +/test/integration/hmr-dynamic/index.js \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 00000000000..27545dfe037 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,10 @@ +{ + "extends": "eslint:recommended", + "parserOptions": { + "ecmaVersion": 8 + }, + "env": { + "node": true, + "es6": true + } +} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index ea0c72a217e..3c8c4aa1467 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,5 +4,7 @@ node_js: # - '6' - '8' cache: yarn -script: yarn test +script: + - yarn test + - yarn lint sudo: false diff --git a/bin/cli.js b/bin/cli.js index fe8bfb5b49d..bb37998e924 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -62,6 +62,7 @@ program }); program.on('--help', function() { + /* eslint-disable no-console */ console.log(''); console.log( ' Run `' + @@ -69,6 +70,7 @@ program.on('--help', function() { '` for more information on specific commands' ); console.log(''); + /* eslint-enable no-console */ }); // Make serve the default command diff --git a/package.json b/package.json index b2e9afc4258..d08d413fc80 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "babel-cli": "^6.26.0", "babel-preset-env": "^1.6.1", "cross-env": "^5.1.1", + "eslint": "^4.13.0", "husky": "^0.14.3", "less": "^2.7.2", "lint-staged": "^6.0.0", @@ -62,7 +63,8 @@ "format": "prettier --write './{src,bin,test}/**/*.{js,json,md}'", "build": "babel src -d lib", "prepublish": "yarn build", - "precommit": "lint-staged" + "precommit": "lint-staged", + "lint": "eslint ." }, "bin": { "parcel": "bin/cli.js" @@ -71,6 +73,10 @@ "node": ">= 6.0.0" }, "lint-staged": { - "*.{js,json,md}": ["prettier --write", "git add"] + "*.{js,json,md}": [ + "prettier --write", + "eslint --fix", + "git add" + ] } } diff --git a/src/Asset.js b/src/Asset.js index d74aa6ad71f..8ce1a8e088a 100644 --- a/src/Asset.js +++ b/src/Asset.js @@ -1,4 +1,3 @@ -const Parser = require('./Parser'); const path = require('path'); const fs = require('./utils/fs'); const objectHash = require('./utils/objectHash'); @@ -73,7 +72,7 @@ class Asset { let resolved = path .resolve(path.dirname(from), url) - .replace(/[\?#].*$/, ''); + .replace(/[?#].*$/, ''); this.addDependency( './' + path.relative(path.dirname(this.name), resolved), Object.assign({dynamic: true}, opts) diff --git a/src/Bundle.js b/src/Bundle.js index 501400780b4..3dc9166c93c 100644 --- a/src/Bundle.js +++ b/src/Bundle.js @@ -1,5 +1,4 @@ const Path = require('path'); -const fs = require('fs'); const crypto = require('crypto'); /** diff --git a/src/Bundler.js b/src/Bundler.js index e25a6d153f7..2dcaf35604f 100644 --- a/src/Bundler.js +++ b/src/Bundler.js @@ -2,7 +2,6 @@ const fs = require('./utils/fs'); const Resolver = require('./Resolver'); const Parser = require('./Parser'); const WorkerFarm = require('./WorkerFarm'); -const worker = require('./utils/promisify')(require('./worker.js')); const Path = require('path'); const Bundle = require('./Bundle'); const {FSWatcher} = require('chokidar'); @@ -262,19 +261,21 @@ class Bundler extends EventEmitter { try { return await this.resolveAsset(dep.name, asset.name); } catch (err) { - if (err.message.indexOf(`Cannot find module '${dep.name}'`) === 0) { - err.message = `Cannot resolve dependency '${dep.name}'`; + let thrown = err; + + if (thrown.message.indexOf(`Cannot find module '${dep.name}'`) === 0) { + thrown.message = `Cannot resolve dependency '${dep.name}'`; // Generate a code frame where the dependency was used if (dep.loc) { await asset.loadIfNeeded(); - err.loc = dep.loc; - err = asset.generateErrorMessage(err); + thrown.loc = dep.loc; + thrown = asset.generateErrorMessage(thrown); } - err.fileName = asset.name; + thrown.fileName = asset.name; } - throw err; + throw thrown; } } diff --git a/src/FSCache.js b/src/FSCache.js index 71db7f3d8d9..b89cdb871dc 100644 --- a/src/FSCache.js +++ b/src/FSCache.js @@ -36,6 +36,7 @@ class FSCache { await fs.writeFile(this.getCacheFile(filename), JSON.stringify(data)); this.invalidated.delete(filename); } catch (err) { + // eslint-disable-next-line no-console console.error('Error writing to cache', err); } } @@ -70,7 +71,9 @@ class FSCache { try { await fs.unlink(this.getCacheFile(filename)); this.invalidated.delete(filename); - } catch (err) {} + } catch (err) { + // Fail silently + } } } diff --git a/src/Logger.js b/src/Logger.js index 3425b27b698..a0985be4077 100644 --- a/src/Logger.js +++ b/src/Logger.js @@ -17,6 +17,7 @@ class Logger { this.lines += message.split('\n').length; } + // eslint-disable-next-line no-console console.log(message); } diff --git a/src/Server.js b/src/Server.js index 5bb97782d5a..77855079695 100644 --- a/src/Server.js +++ b/src/Server.js @@ -1,6 +1,4 @@ const http = require('http'); -const path = require('path'); -const url = require('url'); const serveStatic = require('serve-static'); function middleware(bundler) { diff --git a/src/assets/CSSAsset.js b/src/assets/CSSAsset.js index 03cc15ece6a..06c1d182805 100644 --- a/src/assets/CSSAsset.js +++ b/src/assets/CSSAsset.js @@ -1,12 +1,10 @@ const Asset = require('../Asset'); const postcss = require('postcss'); const valueParser = require('postcss-value-parser'); -const path = require('path'); -const md5 = require('../utils/md5'); const postcssTransform = require('../transforms/postcss'); const CssSyntaxError = require('postcss/lib/css-syntax-error'); -const URL_RE = /url\s*\(\"?(?![a-z]+:)/; +const URL_RE = /url\s*\("?(?![a-z]+:)/; const IMPORT_RE = /@import/; const PROTOCOL_RE = /^[a-z]+:/; diff --git a/src/assets/HTMLAsset.js b/src/assets/HTMLAsset.js index 446ba8c0fd7..e24546342f1 100644 --- a/src/assets/HTMLAsset.js +++ b/src/assets/HTMLAsset.js @@ -1,9 +1,7 @@ const Asset = require('../Asset'); -const posthtml = require('posthtml'); const parse = require('posthtml-parser'); const api = require('posthtml/lib/api'); const path = require('path'); -const md5 = require('../utils/md5'); const render = require('posthtml-render'); const posthtmlTransform = require('../transforms/posthtml'); const isURL = require('../utils/is-url'); diff --git a/src/assets/LESSAsset.js b/src/assets/LESSAsset.js index 85bcea9b0c5..d984069d12f 100644 --- a/src/assets/LESSAsset.js +++ b/src/assets/LESSAsset.js @@ -32,7 +32,7 @@ function urlPlugin(asset) { return { install: (less, pluginManager) => { let visitor = new less.visitors.Visitor({ - visitUrl: (node, args) => { + visitUrl: (node) => { node.value.value = asset.addURLDependency( node.value.value, node.currentFileInfo.filename diff --git a/src/assets/RawAsset.js b/src/assets/RawAsset.js index 170d143608f..0786f04ae66 100644 --- a/src/assets/RawAsset.js +++ b/src/assets/RawAsset.js @@ -1,5 +1,4 @@ const Asset = require('../Asset'); -const path = require('path'); class RawAsset extends Asset { // Don't load raw assets. They will be copied by the RawPackager directly. diff --git a/src/builtins/.eslintrc.json b/src/builtins/.eslintrc.json new file mode 100644 index 00000000000..96fac61d0f1 --- /dev/null +++ b/src/builtins/.eslintrc.json @@ -0,0 +1,9 @@ +{ + "extends": "../../.eslintrc.json", + "env": { + "browser": true + }, + "rules": { + "no-global-assign": [1] + } +} \ No newline at end of file diff --git a/src/builtins/bundle-url.js b/src/builtins/bundle-url.js index ff2c030d396..5815b1dd033 100644 --- a/src/builtins/bundle-url.js +++ b/src/builtins/bundle-url.js @@ -12,7 +12,7 @@ function getBundleURL() { try { throw new Error; } catch (err) { - var matches = ('' + err.stack).match(/(https?|file|ftp):\/\/[^\)\n]+/g); + var matches = ('' + err.stack).match(/(https?|file|ftp):\/\/[^)\n]+/g); if (matches) { return getBaseURL(matches[0]); } @@ -22,7 +22,7 @@ function getBundleURL() { } function getBaseURL(url) { - return ('' + url).replace(/^((?:https?|file|ftp):\/\/.+)\/[^\/]+$/, '$1') + '/'; + return ('' + url).replace(/^((?:https?|file|ftp):\/\/.+)\/[^/]+$/, '$1') + '/'; } exports.getBundleURL = getBundleURLCached; diff --git a/src/builtins/css-loader.js b/src/builtins/css-loader.js index 405fb1e033d..819700ff32d 100644 --- a/src/builtins/css-loader.js +++ b/src/builtins/css-loader.js @@ -25,6 +25,6 @@ function reloadCSS() { cssTimeout = null; }, 50); -}; +} module.exports = reloadCSS; diff --git a/src/builtins/hmr-runtime.js b/src/builtins/hmr-runtime.js index 737c034fb3e..d1f7a6f846f 100644 --- a/src/builtins/hmr-runtime.js +++ b/src/builtins/hmr-runtime.js @@ -32,10 +32,12 @@ if (!module.bundle.parent) { } if (data.type === 'error-resolved') { + // eslint-disable-next-line no-console console.log('[parcel] ✨ Error resolved'); } if (data.type === 'error') { + // eslint-disable-next-line no-console console.error(`[parcel] 🚨 ${data.error.message}\n${data.error.stack}`); } }; diff --git a/src/builtins/prelude.js b/src/builtins/prelude.js index 7301555c20c..3f53debcd20 100644 --- a/src/builtins/prelude.js +++ b/src/builtins/prelude.js @@ -34,14 +34,6 @@ require = (function (modules, cache, entry) { throw err; } - function localRequire(x) { - return newRequire(localRequire.resolve(x)); - } - - localRequire.resolve = function (x) { - return modules[name][1][x] || x; - }; - var module = cache[name] = new newRequire.Module; modules[name][0].call(module.exports, localRequire, module, module.exports); } @@ -49,6 +41,14 @@ require = (function (modules, cache, entry) { return cache[name].exports; } + function localRequire(x) { + return newRequire(localRequire.resolve(x)); + } + + localRequire.resolve = function (x) { + return modules[name][1][x] || x; + }; + function Module() { this.bundle = newRequire; this.exports = {}; diff --git a/src/packagers/Packager.js b/src/packagers/Packager.js index 114588c4f60..f15c79b1dea 100644 --- a/src/packagers/Packager.js +++ b/src/packagers/Packager.js @@ -17,6 +17,7 @@ class Packager { async start() {} + // eslint-disable-next-line no-unused-vars async addAsset(asset) { throw new Error('Must be implemented by subclasses'); } diff --git a/src/transforms/babel.js b/src/transforms/babel.js index 2621f7cc190..009614519a9 100644 --- a/src/transforms/babel.js +++ b/src/transforms/babel.js @@ -1,5 +1,4 @@ const babel = require('babel-core'); -const path = require('path'); const config = require('../utils/config'); module.exports = async function(asset) { diff --git a/src/transforms/uglify.js b/src/transforms/uglify.js index c32187aa865..fe3ba366536 100644 --- a/src/transforms/uglify.js +++ b/src/transforms/uglify.js @@ -1,7 +1,5 @@ const {AST_Node, minify} = require('uglify-js'); const {toEstree} = require('babel-to-estree'); -const types = require('babel-types'); -const walk = require('babylon-walk'); module.exports = async function(asset) { await asset.parseIfNeeded(); diff --git a/src/utils/is-url.js b/src/utils/is-url.js index f5f955c78a5..eef5ac318aa 100644 --- a/src/utils/is-url.js +++ b/src/utils/is-url.js @@ -4,7 +4,7 @@ const isURL = require('is-url'); const ANCHOR_REGEXP = /^#/; // Matches scheme (ie: tel:, mailto:, data:) -const SCHEME_REGEXP = /^[a-z]*\:/i; +const SCHEME_REGEXP = /^[a-z]*:/i; module.exports = function(url) { return isURL(url) || ANCHOR_REGEXP.test(url) || SCHEME_REGEXP.test(url); diff --git a/src/visitors/dependencies.js b/src/visitors/dependencies.js index e2ceef71fa3..e1a0609a299 100644 --- a/src/visitors/dependencies.js +++ b/src/visitors/dependencies.js @@ -1,5 +1,4 @@ const types = require('babel-types'); -const {resolve} = require('path'); const template = require('babel-template'); const requireTemplate = template('require("_bundle_loader")'); diff --git a/src/visitors/fs.js b/src/visitors/fs.js index 555e764b4f3..32f13b9bedd 100644 --- a/src/visitors/fs.js +++ b/src/visitors/fs.js @@ -20,7 +20,6 @@ module.exports = { }, CallExpression(path, asset) { - let callee = path.node.callee; if (referencesImport(path, 'fs', 'readFileSync')) { let vars = { __dirname: Path.dirname(asset.name), diff --git a/src/visitors/globals.js b/src/visitors/globals.js index 349500febce..b99c1d2199a 100644 --- a/src/visitors/globals.js +++ b/src/visitors/globals.js @@ -1,4 +1,3 @@ -const template = require('babel-template'); const Path = require('path'); const types = require('babel-types'); diff --git a/src/worker.js b/src/worker.js index fe898dde8eb..a988a2161bc 100644 --- a/src/worker.js +++ b/src/worker.js @@ -1,14 +1,8 @@ require('v8-compile-cache'); -const fs = require('./utils/fs'); const Parser = require('./Parser'); -const babel = require('./transforms/babel'); let parser; -function emit(event, ...args) { - process.send({event, args}); -} - exports.init = function(options, callback) { parser = new Parser(options || {}); callback(); @@ -25,11 +19,13 @@ exports.run = async function(path, pkg, options, callback) { hash: asset.hash }); } catch (err) { + let returned = err; + if (asset) { - err = asset.generateErrorMessage(err); + returned = asset.generateErrorMessage(returned); } - err.fileName = path; - callback(err); + returned.fileName = path; + callback(returned); } }; diff --git a/test/.eslintrc.json b/test/.eslintrc.json new file mode 100644 index 00000000000..4a6026dc95e --- /dev/null +++ b/test/.eslintrc.json @@ -0,0 +1,6 @@ +{ + "extends": "../.eslintrc.json", + "env": { + "mocha": true + } +} \ No newline at end of file diff --git a/test/fs.js b/test/fs.js index a435064c724..557271bc3ae 100644 --- a/test/fs.js +++ b/test/fs.js @@ -1,6 +1,5 @@ const assert = require('assert'); -const fs = require('fs'); -const {bundle, run, assertBundleTree} = require('./utils'); +const {bundle, run} = require('./utils'); describe('fs', function() { it('should inline a file as a string', async function() { diff --git a/test/hmr.js b/test/hmr.js index fdaf3baba5f..ba067c0013e 100644 --- a/test/hmr.js +++ b/test/hmr.js @@ -1,6 +1,6 @@ const assert = require('assert'); const fs = require('fs'); -const {bundler, run, assertBundleTree} = require('./utils'); +const {bundler, run} = require('./utils'); const rimraf = require('rimraf'); const promisify = require('../src/utils/promisify'); const ncp = promisify(require('ncp')); @@ -39,7 +39,7 @@ describe('hmr', function() { await ncp(__dirname + '/integration/commonjs', __dirname + '/input'); b = bundler(__dirname + '/input/index.js', {watch: true, hmr: true}); - let bundle = await b.bundle(); + await b.bundle(); ws = new WebSocket('ws://localhost:' + b.options.hmrPort); @@ -59,7 +59,7 @@ describe('hmr', function() { await ncp(__dirname + '/integration/commonjs', __dirname + '/input'); b = bundler(__dirname + '/input/index.js', {watch: true, hmr: true}); - let bundle = await b.bundle(); + await b.bundle(); ws = new WebSocket('ws://localhost:' + b.options.hmrPort); @@ -77,7 +77,7 @@ describe('hmr', function() { await ncp(__dirname + '/integration/commonjs', __dirname + '/input'); b = bundler(__dirname + '/input/index.js', {watch: true, hmr: true}); - let bundle = await b.bundle(); + await b.bundle(); ws = new WebSocket('ws://localhost:' + b.options.hmrPort); @@ -102,7 +102,7 @@ describe('hmr', function() { await ncp(__dirname + '/integration/commonjs', __dirname + '/input'); b = bundler(__dirname + '/input/index.js', {watch: true, hmr: true}); - let bundle = await b.bundle(); + await b.bundle(); fs.writeFileSync( __dirname + '/input/local.js', @@ -120,7 +120,7 @@ describe('hmr', function() { await ncp(__dirname + '/integration/commonjs', __dirname + '/input'); b = bundler(__dirname + '/input/index.js', {watch: true, hmr: true}); - let bundle = await b.bundle(); + await b.bundle(); ws = new WebSocket('ws://localhost:' + b.options.hmrPort); diff --git a/test/html.js b/test/html.js index c82fb842994..9a76e28497d 100644 --- a/test/html.js +++ b/test/html.js @@ -1,6 +1,6 @@ const assert = require('assert'); const fs = require('fs'); -const {bundle, run, assertBundleTree} = require('./utils'); +const {bundle, assertBundleTree} = require('./utils'); describe('html', function() { it('should support bundling HTML', async function() { @@ -106,7 +106,7 @@ describe('html', function() { }); it('should minify HTML in production mode', async function() { - let b = await bundle(__dirname + '/integration/htmlnano/index.html', { + await bundle(__dirname + '/integration/htmlnano/index.html', { production: true }); @@ -116,7 +116,7 @@ describe('html', function() { }); it('should not prepend the public path to assets with remote URLs', async function() { - let b = await bundle(__dirname + '/integration/html/index.html'); + await bundle(__dirname + '/integration/html/index.html'); let html = fs.readFileSync(__dirname + '/dist/index.html', 'utf8'); assert( @@ -125,7 +125,7 @@ describe('html', function() { }); it('should not prepend the public path to hash links', async function() { - let b = await bundle(__dirname + '/integration/html/index.html'); + await bundle(__dirname + '/integration/html/index.html'); let html = fs.readFileSync(__dirname + '/dist/index.html', 'utf8'); assert(html.includes('')); diff --git a/test/integration/.eslintrc.json b/test/integration/.eslintrc.json new file mode 100644 index 00000000000..0909050d954 --- /dev/null +++ b/test/integration/.eslintrc.json @@ -0,0 +1,10 @@ +{ + "extends": "../.eslintrc.json", + "env": { + "browser": true + }, + "globals": { + "output": true, + "import": true + } +} \ No newline at end of file diff --git a/test/integration/commonjs/index.js b/test/integration/commonjs/index.js index 76821129d1b..9a6fc97209e 100644 --- a/test/integration/commonjs/index.js +++ b/test/integration/commonjs/index.js @@ -1,4 +1,5 @@ var local = require('./local'); +// eslint-disable-next-line no-unused-vars var url = require('url'); module.exports = function () { diff --git a/test/integration/dynamic-esm/.eslintrc.json b/test/integration/dynamic-esm/.eslintrc.json new file mode 100644 index 00000000000..d6be17ce91f --- /dev/null +++ b/test/integration/dynamic-esm/.eslintrc.json @@ -0,0 +1,9 @@ +{ + "extends": "../.eslintrc.json", + "parserOptions": { + "sourceType": "module" + }, + "globals": { + "import": true + } +} \ No newline at end of file diff --git a/test/integration/es6-default-only/.eslintrc.json b/test/integration/es6-default-only/.eslintrc.json new file mode 100644 index 00000000000..f89e231fa93 --- /dev/null +++ b/test/integration/es6-default-only/.eslintrc.json @@ -0,0 +1,6 @@ +{ + "extends": "../.eslintrc.json", + "parserOptions": { + "sourceType": "module" + } +} \ No newline at end of file diff --git a/test/integration/es6/.eslintrc.json b/test/integration/es6/.eslintrc.json new file mode 100644 index 00000000000..f89e231fa93 --- /dev/null +++ b/test/integration/es6/.eslintrc.json @@ -0,0 +1,6 @@ +{ + "extends": "../.eslintrc.json", + "parserOptions": { + "sourceType": "module" + } +} \ No newline at end of file diff --git a/test/integration/es6/index.js b/test/integration/es6/index.js index f1556c1d6f3..bebd66584f3 100644 --- a/test/integration/es6/index.js +++ b/test/integration/es6/index.js @@ -1,6 +1,7 @@ import * as local from './local'; +// eslint-disable-next-line no-unused-vars import url from 'url'; export default function () { return local.a + local.b; -}; +} diff --git a/test/integration/fs-import/.eslintrc.json b/test/integration/fs-import/.eslintrc.json new file mode 100644 index 00000000000..f89e231fa93 --- /dev/null +++ b/test/integration/fs-import/.eslintrc.json @@ -0,0 +1,6 @@ +{ + "extends": "../.eslintrc.json", + "parserOptions": { + "sourceType": "module" + } +} \ No newline at end of file diff --git a/test/server.js b/test/server.js index d8a04a478b7..0b29dbccf9e 100644 --- a/test/server.js +++ b/test/server.js @@ -1,6 +1,6 @@ const assert = require('assert'); const fs = require('fs'); -const {bundler, run, assertBundleTree} = require('./utils'); +const {bundler} = require('./utils'); const http = require('http'); describe('server', function() { diff --git a/test/watcher.js b/test/watcher.js index 944feac8627..7f87c6d2a21 100644 --- a/test/watcher.js +++ b/test/watcher.js @@ -103,7 +103,7 @@ describe('watcher', function() { await ncp(__dirname + '/integration/dynamic-hoist', __dirname + '/input'); b = bundler(__dirname + '/input/index.js', {watch: true}); - let bundle = await b.bundle(); + await b.bundle(); let mtimes = fs .readdirSync(__dirname + '/dist') .map( @@ -116,7 +116,7 @@ describe('watcher', function() { 'module.exports = require("./common")' ); - bundle = await nextBundle(b); + await nextBundle(b); let newMtimes = fs .readdirSync(__dirname + '/dist') .map( From c850a1ed8678bb19414eb0e1bfce7b37b045620d Mon Sep 17 00:00:00 2001 From: Guillaume Gautreau Date: Sun, 10 Dec 2017 15:37:51 +0100 Subject: [PATCH 2/8] Changes ESLint configuration to allows usage of console --- bin/cli.js | 2 -- src/FSCache.js | 1 - src/Logger.js | 1 - src/builtins/.eslintrc.json | 4 ++-- src/builtins/hmr-runtime.js | 2 -- 5 files changed, 2 insertions(+), 8 deletions(-) diff --git a/bin/cli.js b/bin/cli.js index bb37998e924..fe8bfb5b49d 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -62,7 +62,6 @@ program }); program.on('--help', function() { - /* eslint-disable no-console */ console.log(''); console.log( ' Run `' + @@ -70,7 +69,6 @@ program.on('--help', function() { '` for more information on specific commands' ); console.log(''); - /* eslint-enable no-console */ }); // Make serve the default command diff --git a/src/FSCache.js b/src/FSCache.js index b89cdb871dc..4daa232185d 100644 --- a/src/FSCache.js +++ b/src/FSCache.js @@ -36,7 +36,6 @@ class FSCache { await fs.writeFile(this.getCacheFile(filename), JSON.stringify(data)); this.invalidated.delete(filename); } catch (err) { - // eslint-disable-next-line no-console console.error('Error writing to cache', err); } } diff --git a/src/Logger.js b/src/Logger.js index a0985be4077..3425b27b698 100644 --- a/src/Logger.js +++ b/src/Logger.js @@ -17,7 +17,6 @@ class Logger { this.lines += message.split('\n').length; } - // eslint-disable-next-line no-console console.log(message); } diff --git a/src/builtins/.eslintrc.json b/src/builtins/.eslintrc.json index 96fac61d0f1..2d8692ac2ab 100644 --- a/src/builtins/.eslintrc.json +++ b/src/builtins/.eslintrc.json @@ -1,9 +1,9 @@ { - "extends": "../../.eslintrc.json", + "extends": "../.eslintrc.json", "env": { "browser": true }, "rules": { - "no-global-assign": [1] + "no-global-assign": 1 } } \ No newline at end of file diff --git a/src/builtins/hmr-runtime.js b/src/builtins/hmr-runtime.js index d1f7a6f846f..737c034fb3e 100644 --- a/src/builtins/hmr-runtime.js +++ b/src/builtins/hmr-runtime.js @@ -32,12 +32,10 @@ if (!module.bundle.parent) { } if (data.type === 'error-resolved') { - // eslint-disable-next-line no-console console.log('[parcel] ✨ Error resolved'); } if (data.type === 'error') { - // eslint-disable-next-line no-console console.error(`[parcel] 🚨 ${data.error.message}\n${data.error.stack}`); } }; From e103804db4754dd7177cf6223d5def121ee5f538 Mon Sep 17 00:00:00 2001 From: Guillaume Gautreau Date: Sun, 10 Dec 2017 15:38:33 +0100 Subject: [PATCH 3/8] Launches npm run lint before git commit --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index d08d413fc80..7ccfa25b205 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "format": "prettier --write './{src,bin,test}/**/*.{js,json,md}'", "build": "babel src -d lib", "prepublish": "yarn build", - "precommit": "lint-staged", + "precommit": "npm run lint && lint-staged", "lint": "eslint ." }, "bin": { @@ -75,7 +75,6 @@ "lint-staged": { "*.{js,json,md}": [ "prettier --write", - "eslint --fix", "git add" ] } From c5749008cdac613adcbb2ebbdeaa4bd191b05b83 Mon Sep 17 00:00:00 2001 From: Guillaume Gautreau Date: Sun, 10 Dec 2017 15:39:03 +0100 Subject: [PATCH 4/8] Adds missing ESLint config files --- bin/.eslintrc.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 bin/.eslintrc.json diff --git a/bin/.eslintrc.json b/bin/.eslintrc.json new file mode 100644 index 00000000000..bcbb2fdd137 --- /dev/null +++ b/bin/.eslintrc.json @@ -0,0 +1,6 @@ +{ + "extends": "../.eslintrc.json", + "rules": { + "no-console": 0 + } +} \ No newline at end of file From 526afc863402f1736cd7440c38139770a3012b9a Mon Sep 17 00:00:00 2001 From: Guillaume Gautreau Date: Mon, 11 Dec 2017 11:20:29 +0100 Subject: [PATCH 5/8] Runs ESLint in AppVeyor --- appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 32194b0b517..4cae2a59ec4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,6 +16,8 @@ test_script: - yarn --version # run tests - yarn test + # run ESlint + - yarn lint cache: - "%LOCALAPPDATA%\\Yarn" From 944f3605bab1aa1362a4931ce4ede151a37a4c08 Mon Sep 17 00:00:00 2001 From: Guillaume Gautreau Date: Mon, 11 Dec 2017 22:20:16 +0100 Subject: [PATCH 6/8] Fixes a regression introduced previously, fixes new warnings --- .eslintignore | 10 +- src/.eslintrc.json | 6 + src/assets/GlobAsset.js | 2 - src/builtins/prelude.js | 17 +- test/html.js | 4 +- yarn.lock | 426 ++++++++++++++++++++++++++++++++++++++-- 6 files changed, 441 insertions(+), 24 deletions(-) create mode 100644 src/.eslintrc.json diff --git a/.eslintignore b/.eslintignore index f649ae17ff6..2084f831c85 100644 --- a/.eslintignore +++ b/.eslintignore @@ -7,4 +7,12 @@ /test/integration/dynamic-css/index.js /test/integration/dynamic-esm/index.js /test/integration/dynamic-hoist/index.js -/test/integration/hmr-dynamic/index.js \ No newline at end of file +/test/integration/hmr-dynamic/index.js + +# Generated by the build +lib +dist +/test/dist +/test/input + +coverage \ No newline at end of file diff --git a/src/.eslintrc.json b/src/.eslintrc.json new file mode 100644 index 00000000000..59c30e3b6d1 --- /dev/null +++ b/src/.eslintrc.json @@ -0,0 +1,6 @@ +{ + "extends": "../.eslintrc.json", + "rules": { + "no-console": 0 + } +} diff --git a/src/assets/GlobAsset.js b/src/assets/GlobAsset.js index 445a19fcba6..593f5f92fb9 100644 --- a/src/assets/GlobAsset.js +++ b/src/assets/GlobAsset.js @@ -1,7 +1,5 @@ const Asset = require('../Asset'); const glob = require('glob'); -const promisify = require('../utils/promisify'); -const globPromise = promisify(glob); const micromatch = require('micromatch'); const path = require('path'); diff --git a/src/builtins/prelude.js b/src/builtins/prelude.js index 3f53debcd20..305a9f0e2a0 100644 --- a/src/builtins/prelude.js +++ b/src/builtins/prelude.js @@ -33,21 +33,24 @@ require = (function (modules, cache, entry) { err.code = 'MODULE_NOT_FOUND'; throw err; } + + localRequire.resolve = resolve; var module = cache[name] = new newRequire.Module; + modules[name][0].call(module.exports, localRequire, module, module.exports); } return cache[name].exports; - } - function localRequire(x) { - return newRequire(localRequire.resolve(x)); - } + function localRequire(x){ + return newRequire(localRequire.resolve(x)); + } - localRequire.resolve = function (x) { - return modules[name][1][x] || x; - }; + function resolve(x){ + return modules[name][1][x] || x; + } + } function Module() { this.bundle = newRequire; diff --git a/test/html.js b/test/html.js index 5ad114ec352..16a6122dd32 100644 --- a/test/html.js +++ b/test/html.js @@ -74,7 +74,7 @@ describe('html', function() { let html = fs.readFileSync(__dirname + '/dist/index.html'); assert( - //.test( + //.test( html ) ); @@ -103,7 +103,7 @@ describe('html', function() { let html = fs.readFileSync(__dirname + '/dist/index.html'); assert( - /<\/head>/.test( + /<\/head>/.test( html ) ); diff --git a/yarn.lock b/yarn.lock index 86b87067267..938ee637dcc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6,6 +6,24 @@ abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" +acorn-jsx@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" + dependencies: + acorn "^3.0.4" + +acorn@^3.0.4: + version "3.3.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" + +acorn@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.2.1.tgz#317ac7821826c22c702d66189ab8359675f135d7" + +ajv-keywords@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" + ajv@^4.9.1: version "4.11.8" resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" @@ -13,7 +31,7 @@ ajv@^4.9.1: co "^4.6.0" json-stable-stringify "^1.0.1" -ajv@^5.1.0: +ajv@^5.1.0, ajv@^5.2.3, ajv@^5.3.0: version "5.5.1" resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.1.tgz#b38bb8876d9e86bee994956a04e721e88b248eb2" dependencies: @@ -42,6 +60,10 @@ ansi-escapes@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" +ansi-escapes@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.0.0.tgz#ec3e8b4e9f8064fc02c3ac9b65f1c275bda8ef92" + ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -124,6 +146,16 @@ array-find-index@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" +array-union@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + dependencies: + array-uniq "^1.0.1" + +array-uniq@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + array-unique@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" @@ -132,7 +164,7 @@ array-unique@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" -arrify@^1.0.1: +arrify@^1.0.0, arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -234,7 +266,7 @@ babel-cli@^6.26.0: optionalDependencies: chokidar "^1.6.1" -babel-code-frame@^6.26.0: +babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" dependencies: @@ -927,6 +959,16 @@ caching-transform@^1.0.0: mkdirp "^0.5.1" write-file-atomic "^1.1.4" +caller-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" + dependencies: + callsites "^0.2.0" + +callsites@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" + camelcase-keys@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" @@ -992,7 +1034,7 @@ chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0: +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.0.tgz#b5ea48efc9c1793dccc9b4767c93914d3f2d52ba" dependencies: @@ -1000,6 +1042,10 @@ chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0: escape-string-regexp "^1.0.5" supports-color "^4.0.0" +chardet@^0.4.0: + version "0.4.2" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" + chokidar@^1.6.1, chokidar@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" @@ -1026,6 +1072,10 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: inherits "^2.0.1" safe-buffer "^5.0.1" +circular-json@^0.3.1: + version "0.3.3" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" + clap@^1.0.9: version "1.2.3" resolved "https://registry.yarnpkg.com/clap/-/clap-1.2.3.tgz#4f36745b32008492557f46412d66d50cb99bce51" @@ -1048,6 +1098,12 @@ cli-cursor@^1.0.2: dependencies: restore-cursor "^1.0.1" +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + dependencies: + restore-cursor "^2.0.0" + cli-spinners@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-0.1.2.tgz#bb764d88e185fb9e1e6a2a1f19772318f605e31c" @@ -1059,6 +1115,10 @@ cli-truncate@^0.2.1: slice-ansi "0.0.4" string-width "^1.0.1" +cli-width@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" + cliui@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" @@ -1164,6 +1224,14 @@ concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" +concat-stream@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" + dependencies: + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + console-browserify@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" @@ -1386,7 +1454,7 @@ debug-log@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" -debug@*, debug@^3.1.0: +debug@*, debug@^3.0.1, debug@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" dependencies: @@ -1420,6 +1488,10 @@ deep-extend@~0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + default-require-extensions@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-1.0.0.tgz#f37ea15d3e13ffd9b437d33e1a75b5fb97874cb8" @@ -1442,6 +1514,18 @@ defined@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" +del@^2.0.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" + dependencies: + globby "^5.0.0" + is-path-cwd "^1.0.0" + is-path-in-cwd "^1.0.0" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + rimraf "^2.2.8" + delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -1487,6 +1571,12 @@ diffie-hellman@^5.0.0: miller-rabin "^4.0.0" randombytes "^2.0.0" +doctrine@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.0.2.tgz#68f96ce8efc56cc42651f1faadb4f175273b0075" + dependencies: + esutils "^2.0.2" + dom-serializer@0: version "0.1.0" resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82" @@ -1581,6 +1671,62 @@ escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1 version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" +eslint-scope@^3.7.1: + version "3.7.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint@^4.13.0: + version "4.13.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.13.0.tgz#1991aa359586af83877bde59de9d41f53e20826d" + dependencies: + ajv "^5.3.0" + babel-code-frame "^6.22.0" + chalk "^2.1.0" + concat-stream "^1.6.0" + cross-spawn "^5.1.0" + debug "^3.0.1" + doctrine "^2.0.2" + eslint-scope "^3.7.1" + espree "^3.5.2" + esquery "^1.0.0" + estraverse "^4.2.0" + esutils "^2.0.2" + file-entry-cache "^2.0.0" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.0.1" + ignore "^3.3.3" + imurmurhash "^0.1.4" + inquirer "^3.0.6" + is-resolvable "^1.0.0" + js-yaml "^3.9.1" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.4" + minimatch "^3.0.2" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + pluralize "^7.0.0" + progress "^2.0.0" + require-uncached "^1.0.3" + semver "^5.3.0" + strip-ansi "^4.0.0" + strip-json-comments "~2.0.1" + table "^4.0.1" + text-table "~0.2.0" + +espree@^3.5.2: + version "3.5.2" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.2.tgz#756ada8b979e9dcfcdb30aad8d1a9304a905e1ca" + dependencies: + acorn "^5.2.1" + acorn-jsx "^3.0.0" + esprima@^2.6.0: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" @@ -1589,6 +1735,23 @@ esprima@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" +esquery@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa" + dependencies: + estraverse "^4.0.0" + +esrecurse@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.0.tgz#fa9568d98d3823f9a41d91e902dcab9ea6e5b163" + dependencies: + estraverse "^4.1.0" + object-assign "^4.0.1" + +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" @@ -1676,6 +1839,14 @@ extend@~3.0.0, extend@~3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" +external-editor@^2.0.4: + version "2.1.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.1.0.tgz#3d026a21b7f95b5726387d4200ac160d372c3b48" + dependencies: + chardet "^0.4.0" + iconv-lite "^0.4.17" + tmp "^0.0.33" + extglob@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" @@ -1711,6 +1882,10 @@ fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + fastparse@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.1.tgz#d1e2643b38a94d7583b479060e6c4affc94071f8" @@ -1722,6 +1897,19 @@ figures@^1.7.0: escape-string-regexp "^1.0.5" object-assign "^4.1.0" +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + dependencies: + escape-string-regexp "^1.0.5" + +file-entry-cache@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" + dependencies: + flat-cache "^1.2.1" + object-assign "^4.0.1" + filename-regex@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" @@ -1770,6 +1958,15 @@ find-up@^2.1.0: dependencies: locate-path "^2.0.0" +flat-cache@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.0.tgz#d3030b32b38154f4e3b7e9c709f490f7ef97c481" + dependencies: + circular-json "^0.3.1" + del "^2.0.2" + graceful-fs "^4.1.2" + write "^0.2.1" + flatten@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782" @@ -1857,6 +2054,10 @@ function-bind@^1.0.2: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" @@ -1974,10 +2175,25 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6, glob@^7.1.2, glob@~7.1.1: once "^1.3.0" path-is-absolute "^1.0.0" +globals@^11.0.1: + version "11.1.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.1.0.tgz#632644457f5f0e3ae711807183700ebf2e4633e4" + globals@^9.18.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" +globby@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" + dependencies: + array-union "^1.0.1" + arrify "^1.0.0" + glob "^7.0.3" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + globule@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/globule/-/globule-1.2.0.tgz#1dc49c6822dd9e8a2fa00ba2a295006e8664bd09" @@ -2222,6 +2438,10 @@ husky@^0.14.3: normalize-path "^1.0.0" strip-indent "^2.0.0" +iconv-lite@^0.4.17: + version "0.4.19" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" + icss-replace-symbols@1.1.0, icss-replace-symbols@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz#06ea6f83679a7749e386cfe1fe812ae5db223ded" @@ -2230,6 +2450,10 @@ ieee754@^1.1.4: version "1.1.8" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" +ignore@^3.3.3: + version "3.3.7" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.7.tgz#612289bfb3c220e186a58118618d5be8c1bab021" + image-size@~0.5.0: version "0.5.5" resolved "https://registry.yarnpkg.com/image-size/-/image-size-0.5.5.tgz#09dfd4ab9d20e29eb1c3e80b8990378df9e3cb9c" @@ -2279,6 +2503,25 @@ ini@~1.3.0: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" +inquirer@^3.0.6: + version "3.3.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.0" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^2.0.4" + figures "^2.0.0" + lodash "^4.3.0" + mute-stream "0.0.7" + run-async "^2.2.0" + rx-lite "^4.0.8" + rx-lite-aggregates "^4.0.8" + string-width "^2.1.0" + strip-ansi "^4.0.0" + through "^2.3.6" + invariant@^2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" @@ -2444,6 +2687,22 @@ is-odd@^1.0.0: dependencies: is-number "^3.0.0" +is-path-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" + +is-path-in-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc" + dependencies: + is-path-inside "^1.0.0" + +is-path-inside@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" + dependencies: + path-is-inside "^1.0.1" + is-plain-obj@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" @@ -2474,6 +2733,12 @@ is-regexp@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" +is-resolvable@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.0.0.tgz#8df57c61ea2e3c501408d100fb013cf8d6e0cc62" + dependencies: + tryit "^1.0.1" + is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -2594,7 +2859,7 @@ js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" -js-yaml@^3.10.0, js-yaml@^3.9.0: +js-yaml@^3.10.0, js-yaml@^3.9.0, js-yaml@^3.9.1: version "3.10.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" dependencies: @@ -2632,6 +2897,10 @@ json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + json-stable-stringify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" @@ -2720,6 +2989,13 @@ leven@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + lint-staged@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-6.0.0.tgz#7ab7d345f2fe302ff196f1de6a005594ace03210" @@ -2890,7 +3166,7 @@ lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" -lodash@^4.0.0, lodash@^4.17.4, lodash@~4.17.4: +lodash@^4.0.0, lodash@^4.17.4, lodash@^4.3.0, lodash@~4.17.4: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" @@ -3128,6 +3404,10 @@ ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + nan@^2.3.0, nan@^2.3.2: version "2.8.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.8.0.tgz#ed715f3fe9de02b57a5e6252d90a96675e1f085a" @@ -3148,6 +3428,10 @@ nanomatch@^1.2.5: snapdragon "^0.8.1" to-regex "^3.0.1" +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + ncp@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3" @@ -3409,6 +3693,12 @@ onetime@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + dependencies: + mimic-fn "^1.0.0" + opn@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/opn/-/opn-5.1.0.tgz#72ce2306a17dbea58ff1041853352b4a8fc77519" @@ -3422,6 +3712,17 @@ optimist@^0.6.1: minimist "~0.0.1" wordwrap "~0.0.2" +optionator@^0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + ora@^0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/ora/-/ora-0.2.3.tgz#37527d220adcd53c39b73571d754156d5db657a4" @@ -3453,7 +3754,7 @@ os-locale@^2.0.0: lcid "^1.0.0" mem "^1.1.0" -os-tmpdir@^1.0.0, os-tmpdir@^1.0.1: +os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -3558,7 +3859,7 @@ path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" -path-is-inside@^1.0.2: +path-is-inside@^1.0.1, path-is-inside@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" @@ -3624,6 +3925,10 @@ pkg-dir@^1.0.0: dependencies: find-up "^1.0.0" +pluralize@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" + posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" @@ -3928,6 +4233,10 @@ posthtml@^0.8.7: posthtml-parser "^0.1.3" posthtml-render "^1.0.5" +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + prepend-http@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" @@ -3959,6 +4268,10 @@ process@^0.11.10: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" +progress@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" + promise@^7.1.1: version "7.3.1" resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" @@ -4070,7 +4383,7 @@ read-pkg@^1.0.0: normalize-package-data "^2.3.2" path-type "^1.0.0" -readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.2.6, readable-stream@^2.3.3: +readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.2.2, readable-stream@^2.2.6, readable-stream@^2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c" dependencies: @@ -4279,6 +4592,17 @@ require-main-filename@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" +require-uncached@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" + dependencies: + caller-path "^0.1.0" + resolve-from "^1.0.0" + +resolve-from@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" + resolve-from@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57" @@ -4304,13 +4628,20 @@ restore-cursor@^1.0.1: exit-hook "^1.0.0" onetime "^1.0.0" +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + right-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.3.3, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1: +rimraf@2, rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" dependencies: @@ -4323,6 +4654,22 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^2.0.0" inherits "^2.0.1" +run-async@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" + dependencies: + is-promise "^2.1.0" + +rx-lite-aggregates@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" + dependencies: + rx-lite "*" + +rx-lite@*, rx-lite@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" + rxjs@^5.4.2: version "5.5.5" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.5.tgz#e164f11d38eaf29f56f08c3447f74ff02dd84e97" @@ -4461,6 +4808,12 @@ slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" +slice-ansi@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" + dependencies: + is-fullwidth-code-point "^2.0.0" + slide@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" @@ -4663,7 +5016,7 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -string-width@^2.0.0: +string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" dependencies: @@ -4777,6 +5130,17 @@ symbol-observable@^0.2.2: version "0.2.4" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-0.2.4.tgz#95a83db26186d6af7e7a18dbd9760a2f86d08f40" +table@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" + dependencies: + ajv "^5.2.3" + ajv-keywords "^2.1.0" + chalk "^2.1.0" + lodash "^4.17.4" + slice-ansi "1.0.0" + string-width "^2.1.1" + tar-pack@^3.4.0: version "3.4.1" resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.4.1.tgz#e1dbc03a9b9d3ba07e896ad027317eb679a10a1f" @@ -4808,12 +5172,26 @@ test-exclude@^4.1.1: read-pkg-up "^1.0.1" require-main-filename "^1.0.1" +text-table@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + +through@^2.3.6: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + timers-browserify@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.4.tgz#96ca53f4b794a5e7c0e1bd7cc88a372298fa01e6" dependencies: setimmediate "^1.0.4" +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + dependencies: + os-tmpdir "~1.0.2" + to-arraybuffer@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" @@ -4863,6 +5241,10 @@ trim-right@^1.0.1: dependencies: glob "^6.0.4" +tryit@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" + tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" @@ -4881,6 +5263,16 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + dependencies: + prelude-ls "~1.1.2" + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + typescript@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.2.tgz#3c5b6fd7f6de0914269027f03c0946758f7673a4" @@ -5051,6 +5443,10 @@ wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + worker-farm@^1.4.1: version "1.5.2" resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.5.2.tgz#32b312e5dc3d5d45d79ef44acc2587491cd729ae" @@ -5077,6 +5473,12 @@ write-file-atomic@^1.1.4: imurmurhash "^0.1.4" slide "^1.1.5" +write@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" + dependencies: + mkdirp "^0.5.1" + ws@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.2.tgz#96c1d08b3fefda1d5c1e33700d3bfaa9be2d5608" From 9c1215ca7b1d818336742cf528ca0e940d6cd6b7 Mon Sep 17 00:00:00 2001 From: Guillaume Gautreau Date: Mon, 11 Dec 2017 22:34:30 +0100 Subject: [PATCH 7/8] Fixes new ESLint errors introduced in master --- .eslintignore | 2 ++ src/Bundler.js | 1 - src/Server.js | 2 +- src/assets/CoffeeScriptAsset.js | 1 - 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.eslintignore b/.eslintignore index 2084f831c85..3762b202a24 100644 --- a/.eslintignore +++ b/.eslintignore @@ -7,6 +7,8 @@ /test/integration/dynamic-css/index.js /test/integration/dynamic-esm/index.js /test/integration/dynamic-hoist/index.js +/test/integration/dynamic-references-raw/index.js +/test/integration/dynamic-references-raw/local.js /test/integration/hmr-dynamic/index.js # Generated by the build diff --git a/src/Bundler.js b/src/Bundler.js index da222e0f1f2..70c8b0ef370 100644 --- a/src/Bundler.js +++ b/src/Bundler.js @@ -12,7 +12,6 @@ const {EventEmitter} = require('events'); const Logger = require('./Logger'); const PackagerRegistry = require('./packagers'); const localRequire = require('./utils/localRequire'); -const customErrors = require('./utils/customErrors'); /** * The Bundler is the main entry point. It resolves and loads assets, diff --git a/src/Server.js b/src/Server.js index 672e00c2d0c..e45a13eac4d 100644 --- a/src/Server.js +++ b/src/Server.js @@ -62,7 +62,7 @@ async function serve(bundler, port) { bundler.logger.error(new Error(serverErrors(err, server.address().port))); }); - server.once('listening', connection => { + server.once('listening', () => { let addon = server.address().port !== port ? `- ${bundler.logger.chalk.red( diff --git a/src/assets/CoffeeScriptAsset.js b/src/assets/CoffeeScriptAsset.js index 15d767970dd..429b6fb7a6e 100644 --- a/src/assets/CoffeeScriptAsset.js +++ b/src/assets/CoffeeScriptAsset.js @@ -1,5 +1,4 @@ const JSAsset = require('./JSAsset'); -const config = require('../utils/config'); const localRequire = require('../utils/localRequire'); class CoffeeScriptAsset extends JSAsset { From 2e81db00cfb8d5f38867c9ac1fdb4435391e80cc Mon Sep 17 00:00:00 2001 From: Guillaume Gautreau Date: Tue, 12 Dec 2017 10:49:37 +0100 Subject: [PATCH 8/8] Specifies ecmaVersion=5 in builtins and fixes errors in index.js --- src/builtins/.eslintrc.json | 3 +++ src/builtins/index.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/builtins/.eslintrc.json b/src/builtins/.eslintrc.json index 2d8692ac2ab..3361ed605a0 100644 --- a/src/builtins/.eslintrc.json +++ b/src/builtins/.eslintrc.json @@ -1,5 +1,8 @@ { "extends": "../.eslintrc.json", + "parserOptions": { + "ecmaVersion": 5 + }, "env": { "browser": true }, diff --git a/src/builtins/index.js b/src/builtins/index.js index 8af97a8d4f1..4ec52fa3e0f 100644 --- a/src/builtins/index.js +++ b/src/builtins/index.js @@ -1,6 +1,6 @@ -const builtins = require('node-libs-browser'); +var builtins = require('node-libs-browser'); -for (let key in builtins) { +for (var key in builtins) { if (builtins[key] == null) { builtins[key] = require.resolve('./_empty.js'); }