diff --git a/.babelrc.js b/.babelrc.js index bfb12e62cf81..0caaf19bf06e 100644 --- a/.babelrc.js +++ b/.babelrc.js @@ -5,15 +5,15 @@ const envOpts = { loose: true, }; -switch(env) { +switch (env) { case "development": envOpts.debug = true; - // fall-through + // fall-through case "test": case "cov": envOpts.targets = { - node: "current" - }; + node: "current", + }; } const config = { diff --git a/.eslintignore b/.eslintignore index bbfa4a378cb7..39e51ed1b442 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,6 @@ /lib +/build +package.json packages/babel-runtime !packages/babel-runtime/scripts !packages/babel-runtime/core-js.js @@ -18,5 +20,4 @@ packages/babel-preset-env-standalone/babel-preset-env.js packages/babel-preset-env-standalone/babel-preset-env.min.js packages/babel-standalone/babel.js packages/babel-standalone/babel.min.js -packages/babylon/build packages/babylon/test/expressions diff --git a/.eslintrc.json b/.eslintrc.json index 990708104eba..a26533ebde85 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,9 +1,7 @@ { "root": true, "extends": "babel", - "plugins": [ - "prettier" - ], + "plugins": ["prettier"], "rules": { "curly": ["error", "multi-line"], "prettier/prettier": "error", @@ -14,10 +12,7 @@ }, "overrides": [ { - "files": [ - "packages/*/src/**/*.js", - "codemods/*/src/**/*.js" - ], + "files": ["packages/*/src/**/*.js", "codemods/*/src/**/*.js"], "rules": { "no-undefined-identifier": "error", "no-deprecated-clone": "error" diff --git a/.prettierrc b/.prettierrc index f7d1c5e0d570..371aad410ab4 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,14 @@ { + "arrowParens": "avoid", "trailingComma": "es5", + "useTabs": false, + "semi": true, + "singleQuote": false, + "bracketSpacing": true, + "jsxBracketSameLine": false, + "tabWidth": 2, + "parser": "babylon", + "printWidth": 80, "overrides": [{ "files": [ "**/codemods/*/src/**/*.js", diff --git a/Makefile b/Makefile index 306391272ba1..edfc097cebdf 100644 --- a/Makefile +++ b/Makefile @@ -53,10 +53,12 @@ flow: ./node_modules/.bin/flow check --strip-root lint: - ./node_modules/.bin/eslint scripts $(SOURCES) *.js --format=codeframe --rulesdir="./scripts/eslint_rules" + ./node_modules/.bin/eslint scripts $(SOURCES) '*.js' '**/.*.js' --format=codeframe --rulesdir="./scripts/eslint_rules" fix: - ./node_modules/.bin/eslint scripts $(SOURCES) *.js --format=codeframe --fix --rulesdir="./scripts/eslint_rules" + # The config is hardcoded because otherwise prettier searches for it and also picks up some broken package.json files from tests + ./node_modules/.bin/prettier --config .prettierrc --write --ignore-path .eslintignore '**/*.json' + ./node_modules/.bin/eslint scripts $(SOURCES) '*.js' '**/.*.js' --format=codeframe --fix --rulesdir="./scripts/eslint_rules" clean: test-clean rm -rf packages/babel-polyfill/browser* diff --git a/lerna.json b/lerna.json index ebd0f70d3cf6..457e7a1ac25a 100644 --- a/lerna.json +++ b/lerna.json @@ -16,19 +16,10 @@ "cacheDir": ".changelog", "commands": { "publish": { - "ignore": [ - "*.md", - "test/**", - "codemods/**" - ] + "ignore": ["*.md", "test/**", "codemods/**"] } }, - "packages": [ - "packages/*", - "codemods/*" - ], + "packages": ["packages/*", "codemods/*"], "npmClient": "yarn", - "npmClientArgs": [ - "--no-lockfile" - ] + "npmClientArgs": ["--no-lockfile"] } diff --git a/package.json b/package.json index e60cbd1c1a7d..4d400ea8c36e 100644 --- a/package.json +++ b/package.json @@ -25,11 +25,11 @@ "browserify": "^13.1.1", "bundle-collapser": "^1.2.1", "chai": "^4.1.0", - "chalk": "^2.0.0", + "chalk": "^2.3.2", "charcodes": "^0.1.0", "derequire": "^2.0.2", "enhanced-resolve": "^3.0.0", - "eslint": "^4.5.0", + "eslint": "^4.18.2", "eslint-config-babel": "^7.0.2", "eslint-plugin-flowtype": "^2.20.0", "eslint-plugin-prettier": "^2.5.0", @@ -52,7 +52,7 @@ "lodash": "^4.2.0", "merge-stream": "^1.0.1", "output-file-sync": "^2.0.0", - "prettier": "1.10.2", + "prettier": "1.11.1", "pump": "^1.0.2", "rimraf": "^2.4.3", "rollup-plugin-babel": "^4.0.0-beta.0", diff --git a/test/warning.js b/test/warning.js deleted file mode 100644 index 072f4a8f07c2..000000000000 --- a/test/warning.js +++ /dev/null @@ -1,2 +0,0 @@ -console.error("Don't run `mocha` directly. Use `make test`. See CONTRIBUTING.md for usage instructions."); -process.exit(0); diff --git a/yarn.lock b/yarn.lock index 0a6226578e28..904acd83d95a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -780,7 +780,7 @@ acorn@^4.0.3: version "4.0.13" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" -acorn@^5.0.0, acorn@^5.0.3, acorn@^5.2.1, acorn@^5.3.0, acorn@^5.4.0, acorn@^5.4.1: +acorn@^5.0.0, acorn@^5.0.3, acorn@^5.2.1, acorn@^5.3.0, acorn@^5.4.1, acorn@^5.5.0: version "5.5.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.5.0.tgz#1abb587fbf051f94e3de20e6b26ef910b1828298" @@ -788,7 +788,11 @@ add-stream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/add-stream/-/add-stream-1.0.0.tgz#6a7990437ca736d5e1288db92bd3266d5f5cb2aa" -ajv-keywords@^3.0.0, ajv-keywords@^3.1.0: +ajv-keywords@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" + +ajv-keywords@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.1.0.tgz#ac2b27939c543e95d2c06e7f7f5c27be4aa543be" @@ -799,7 +803,7 @@ ajv@^4.9.1: co "^4.6.0" json-stable-stringify "^1.0.1" -ajv@^5.1.0, ajv@^5.3.0: +ajv@^5.1.0, ajv@^5.2.3, ajv@^5.3.0: version "5.5.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" dependencies: @@ -808,9 +812,9 @@ ajv@^5.1.0, ajv@^5.3.0: fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.3.0" -ajv@^6.0.1, ajv@^6.1.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.2.0.tgz#afac295bbaa0152449e522742e4547c1ae9328d2" +ajv@^6.1.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.2.1.tgz#28a6abc493a2abe0fb4c8507acaedb43fa550671" dependencies: fast-deep-equal "^1.0.0" fast-json-stable-stringify "^2.0.0" @@ -872,9 +876,9 @@ ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" -ansi-styles@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88" +ansi-styles@^3.2.0, ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" dependencies: color-convert "^1.9.0" @@ -1667,8 +1671,8 @@ camelcase@^4.1.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" caniuse-lite@^1.0.30000809: - version "1.0.30000810" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000810.tgz#47585fffce0e9f3593a6feea4673b945424351d9" + version "1.0.30000812" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000812.tgz#d173b686b49bc941fa18ff2e7e533048e20ed92c" caseless@~0.12.0: version "0.12.0" @@ -1702,13 +1706,13 @@ 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.0, chalk@^2.0.1, chalk@^2.1.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.1.tgz#523fe2678aec7b04e8041909292fe8b17059b796" +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.2.tgz#250dc96b07491bfd601e648d66ddf5f60c7a5c65" dependencies: - ansi-styles "^3.2.0" + ansi-styles "^3.2.1" escape-string-regexp "^1.0.5" - supports-color "^5.2.0" + supports-color "^5.3.0" charcodes@^0.1.0: version "0.1.0" @@ -1983,8 +1987,8 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" concat-stream@^1.4.10, concat-stream@^1.4.6, concat-stream@^1.5.0, concat-stream@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" + version "1.6.1" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.1.tgz#261b8f518301f1d834e36342b9fea095d2620a26" dependencies: inherits "^2.0.3" readable-stream "^2.2.2" @@ -2030,11 +2034,11 @@ conventional-changelog-atom@^0.2.4: q "^1.5.1" conventional-changelog-cli@^1.3.1: - version "1.3.15" - resolved "https://registry.yarnpkg.com/conventional-changelog-cli/-/conventional-changelog-cli-1.3.15.tgz#cd7f0e64473f1cecee902ee5ee00548ea91bcc9e" + version "1.3.16" + resolved "https://registry.yarnpkg.com/conventional-changelog-cli/-/conventional-changelog-cli-1.3.16.tgz#69acdcc4b68b4d123c5945868dffe394960cea9d" dependencies: add-stream "^1.0.0" - conventional-changelog "^1.1.17" + conventional-changelog "^1.1.18" lodash "^4.2.1" meow "^4.0.0" tempfile "^1.1.1" @@ -2069,9 +2073,9 @@ conventional-changelog-ember@^0.3.6: dependencies: q "^1.5.1" -conventional-changelog-eslint@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/conventional-changelog-eslint/-/conventional-changelog-eslint-1.0.4.tgz#333456d1884d96f3a49cc0984a745095e9d56288" +conventional-changelog-eslint@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/conventional-changelog-eslint/-/conventional-changelog-eslint-1.0.5.tgz#8bae05ebbf574e6506caf7b37dc51ca21b74d220" dependencies: q "^1.5.1" @@ -2119,16 +2123,16 @@ conventional-changelog-writer@^3.0.4: split "^1.0.0" through2 "^2.0.0" -conventional-changelog@^1.1.17: - version "1.1.17" - resolved "https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-1.1.17.tgz#9019503d51328d8b33b0be6d425ab7f065918332" +conventional-changelog@^1.1.18: + version "1.1.18" + resolved "https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-1.1.18.tgz#ffe28798e4ddef5f6e2f74398e8248bcb233360b" dependencies: conventional-changelog-angular "^1.6.6" conventional-changelog-atom "^0.2.4" conventional-changelog-codemirror "^0.3.4" conventional-changelog-core "^2.0.5" conventional-changelog-ember "^0.3.6" - conventional-changelog-eslint "^1.0.4" + conventional-changelog-eslint "^1.0.5" conventional-changelog-express "^0.3.4" conventional-changelog-jquery "^0.1.0" conventional-changelog-jscs "^0.1.0" @@ -2488,8 +2492,8 @@ detective@^4.0.0: defined "^1.0.0" diff@^3.2.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.4.0.tgz#b1d85507daf3964828de54b37d0d73ba67dda56c" + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" diffie-hellman@^5.0.0: version "5.0.2" @@ -2778,9 +2782,9 @@ eslint-visitor-keys@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" -eslint@^4.5.0: - version "4.18.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.18.1.tgz#b9138440cb1e98b2f44a0d578c6ecf8eae6150b0" +eslint@^4.18.2: + version "4.18.2" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.18.2.tgz#0f81267ad1012e7d2051e186a9004cc2267b8d45" dependencies: ajv "^5.3.0" babel-code-frame "^6.22.0" @@ -2817,14 +2821,14 @@ eslint@^4.5.0: semver "^5.3.0" strip-ansi "^4.0.0" strip-json-comments "~2.0.1" - table "^4.0.1" + table "4.0.2" text-table "~0.2.0" espree@^3.5.2: - version "3.5.3" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.3.tgz#931e0af64e7fbbed26b050a29daad1fc64799fa6" + version "3.5.4" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" dependencies: - acorn "^5.4.0" + acorn "^5.5.0" acorn-jsx "^3.0.0" esprima@^3.1.3, esprima@~3.1.0: @@ -3832,8 +3836,8 @@ html-loader@^0.4.5: object-assign "^4.1.0" html-minifier@^3.0.1: - version "3.5.9" - resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.9.tgz#74424014b872598d4bb0e20ac420926ec61024b6" + version "3.5.10" + resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.10.tgz#8522c772c388db81aa5c26f62033302d906ea1c7" dependencies: camel-case "3.0.x" clean-css "4.1.x" @@ -4660,8 +4664,8 @@ js-tokens@^3.0.0, js-tokens@^3.0.2: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" js-yaml@^3.7.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" + version "3.11.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.11.0.tgz#597c1a8bd57152f26d622ce4117851a51f5ebaef" dependencies: argparse "^1.0.7" esprima "^4.0.0" @@ -5455,8 +5459,8 @@ module-deps@^4.0.8: xtend "^4.0.0" moment@^2.6.0: - version "2.20.1" - resolved "https://registry.yarnpkg.com/moment/-/moment-2.20.1.tgz#d6eb1a46cbcc14a2b2f9434112c1ff8907f313fd" + version "2.21.0" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.21.0.tgz#2a114b51d2a6ec9e6d83cf803f838a878d8a023a" ms@2.0.0: version "2.0.0" @@ -6100,9 +6104,9 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -prettier@1.10.2: - version "1.10.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.10.2.tgz#1af8356d1842276a99a5b5529c82dd9e9ad3cc93" +prettier@1.11.1: + version "1.11.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.11.1.tgz#61e43fc4cd44e68f2b0dfc2c38cd4bb0fccdcc75" pretty-format@^21.2.1: version "21.2.1" @@ -6312,8 +6316,8 @@ read-pkg@^3.0.0: string_decoder "~0.10.x" readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3: - version "2.3.4" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.4.tgz#c946c3f47fa7d8eabc0b6150f4a12f69a4574071" + version "2.3.5" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.5.tgz#b4f85003a938cbb6ecbce2a124fb1012bd1a838d" dependencies: core-util-is "~1.0.0" inherits "~2.0.3" @@ -7165,9 +7169,9 @@ supports-color@^4.2.1: dependencies: has-flag "^2.0.0" -supports-color@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.2.0.tgz#b0d5333b1184dd3666cbe5aa0b45c5ac7ac17a4a" +supports-color@^5.2.0, supports-color@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.3.0.tgz#5b24ac15db80fa927cf5227a4a33fd3c4c7676c0" dependencies: has-flag "^3.0.0" @@ -7189,12 +7193,12 @@ syntax-error@^1.1.1: dependencies: acorn-node "^1.2.0" -table@^4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/table/-/table-4.0.3.tgz#00b5e2b602f1794b9acaf9ca908a76386a7813bc" +table@4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" dependencies: - ajv "^6.0.1" - ajv-keywords "^3.0.0" + ajv "^5.2.3" + ajv-keywords "^2.1.0" chalk "^2.1.0" lodash "^4.17.4" slice-ansi "1.0.0" @@ -7421,8 +7425,8 @@ typedarray@^0.0.6, typedarray@~0.0.5: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" uglify-js@3.3.x, uglify-js@^3.0.5: - version "3.3.12" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.3.12.tgz#efd87c16a1f4c674a8a5ede571001ef634dcc883" + version "3.3.13" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.3.13.tgz#8a1a89eeb16e2d6a66b0db2b04cb871af3c669cf" dependencies: commander "~2.14.1" source-map "~0.6.1"