From 204e61bc0408ffdcf8a1ab416465c8e9828dd8d1 Mon Sep 17 00:00:00 2001 From: Iyanu-Tomiwa Date: Wed, 15 Mar 2017 12:47:51 +0100 Subject: [PATCH 1/4] Add conditional calling of this.cacheable() to prevent breaking --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index cee9ca4..c07b00e 100644 --- a/index.js +++ b/index.js @@ -89,7 +89,7 @@ function format(config, value, name, level, inProp) { } module.exports = function(content) { - this.cacheable(); + this.cacheable && this.cacheable(); config = defaults( loaderUtils.getLoaderConfig(this, 'jsCssLoader'), From 5060afe0623edb57a92b89fe7e3c412e60b907c9 Mon Sep 17 00:00:00 2001 From: Iyanu-Tomiwa Date: Thu, 16 Mar 2017 14:39:05 +0100 Subject: [PATCH 2/4] Upgrade eslint config to fix breaking circle ci test --- package.json | 2 +- yarn.lock | 99 ++++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 85 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 1fe0f3e..14bf349 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "react-dom": "^15.4.2" }, "devDependencies": { - "eslint": "^2.10.2", + "eslint": "^3.17.1", "eslint-config-metalab": "^4.0.1", "eslint-import-resolver-babel-module": "^2.0.1", "eslint-plugin-filenames": "^0.2.0", diff --git a/yarn.lock b/yarn.lock index 830e31b..b607fda 100644 --- a/yarn.lock +++ b/yarn.lock @@ -63,7 +63,7 @@ asap@~2.0.3: version "2.0.5" resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.5.tgz#522765b50c3510490e52d7dcfe085ef9ba96958f" -babel-code-frame@^6.22.0: +babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" dependencies: @@ -242,20 +242,13 @@ del@^2.0.2: pinkie-promise "^2.0.0" rimraf "^2.2.8" -doctrine@1.3.x: +doctrine@1.3.x, doctrine@^1.2.2: version "1.3.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.3.0.tgz#13e75682b55518424276f7c173783456ef913d26" dependencies: esutils "^2.0.2" isarray "^1.0.0" -doctrine@^1.2.2: - version "1.5.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" - dependencies: - esutils "^2.0.2" - isarray "^1.0.0" - emojis-list@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" @@ -391,7 +384,7 @@ eslint-plugin-react@^5.1.1: doctrine "^1.2.2" jsx-ast-utils "^1.2.1" -eslint@^2.10.2, eslint@^2.7.0: +eslint@^2.7.0: version "2.13.1" resolved "https://registry.yarnpkg.com/eslint/-/eslint-2.13.1.tgz#e4cc8fa0f009fb829aaae23855a29360be1f6c11" dependencies: @@ -429,7 +422,46 @@ eslint@^2.10.2, eslint@^2.7.0: text-table "~0.2.0" user-home "^2.0.0" -espree@^3.1.6: +eslint@^3.17.1: + version "3.17.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.17.1.tgz#b80ae12d9c406d858406fccda627afce33ea10ea" + dependencies: + babel-code-frame "^6.16.0" + chalk "^1.1.3" + concat-stream "^1.4.6" + debug "^2.1.1" + doctrine "^1.2.2" + escope "^3.6.0" + espree "^3.4.0" + estraverse "^4.2.0" + esutils "^2.0.2" + file-entry-cache "^2.0.0" + glob "^7.0.3" + globals "^9.14.0" + ignore "^3.2.0" + imurmurhash "^0.1.4" + inquirer "^0.12.0" + is-my-json-valid "^2.10.0" + is-resolvable "^1.0.0" + js-yaml "^3.5.1" + json-stable-stringify "^1.0.0" + levn "^0.3.0" + lodash "^4.0.0" + mkdirp "^0.5.0" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.1" + pluralize "^1.2.1" + progress "^1.1.8" + require-uncached "^1.0.2" + shelljs "^0.7.5" + strip-bom "^3.0.0" + strip-json-comments "~2.0.1" + table "^3.7.8" + text-table "~0.2.0" + user-home "^2.0.0" + +espree@^3.1.6, espree@^3.4.0: version "3.4.0" resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.0.tgz#41656fa5628e042878025ef467e78f125cb86e1d" dependencies: @@ -500,6 +532,13 @@ file-entry-cache@^1.1.1: flat-cache "^1.2.1" object-assign "^4.0.1" +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" + find-babel-config@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/find-babel-config/-/find-babel-config-1.0.1.tgz#179fa7b36bf3e94b487410855df448b6f853b9ec" @@ -541,7 +580,7 @@ generate-object-property@^1.1.0: dependencies: is-property "^1.0.0" -glob@^7.0.3, glob@^7.0.5: +glob@^7.0.0, glob@^7.0.3, glob@^7.0.5: version "7.1.1" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" dependencies: @@ -552,7 +591,7 @@ glob@^7.0.3, glob@^7.0.5: once "^1.3.0" path-is-absolute "^1.0.0" -globals@^9.0.0, globals@^9.2.0: +globals@^9.0.0, globals@^9.14.0, globals@^9.2.0: version "9.16.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.16.0.tgz#63e903658171ec2d9f51b1d31de5e2b8dc01fb80" @@ -587,7 +626,7 @@ iconv-lite@~0.4.13: version "0.4.15" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.15.tgz#fe265a218ac6a57cfe854927e9d04c19825eddeb" -ignore@^3.1.2: +ignore@^3.1.2, ignore@^3.2.0: version "3.2.4" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.4.tgz#4055e03596729a8fabe45a43c100ad5ed815c4e8" @@ -624,6 +663,10 @@ inquirer@^0.12.0: strip-ansi "^3.0.0" through "^2.3.6" +interpret@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.1.tgz#d579fb7f693b858004947af39fa0db49f795602c" + invariant@^2.2.0: version "2.2.2" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" @@ -799,6 +842,10 @@ mute-stream@0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0" +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + node-fetch@^1.0.1: version "1.6.3" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.6.3.tgz#dc234edd6489982d58e8f0db4f695029abcd8c04" @@ -824,7 +871,7 @@ onetime@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" -optionator@^0.8.1: +optionator@^0.8.1, optionator@^0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" dependencies: @@ -937,6 +984,12 @@ readline2@^1.0.1: is-fullwidth-code-point "^1.0.0" mute-stream "0.0.5" +rechoir@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + dependencies: + resolve "^1.1.6" + regenerator-runtime@^0.10.0: version "0.10.3" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.3.tgz#8c4367a904b51ea62a908ac310bf99ff90a82a3e" @@ -989,6 +1042,14 @@ shelljs@^0.6.0: version "0.6.1" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.6.1.tgz#ec6211bed1920442088fe0f70b2837232ed2c8a8" +shelljs@^0.7.5: + version "0.7.7" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.7.tgz#b2f5c77ef97148f4b4f6e22682e10bba8667cff1" + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" @@ -1022,10 +1083,18 @@ strip-ansi@^3.0.0: dependencies: ansi-regex "^2.0.0" +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + strip-json-comments@~1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91" +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" From 2b3719f5b932cd60d341617179e025c5449ee0a5 Mon Sep 17 00:00:00 2001 From: Iyanu-Tomiwa Date: Thu, 16 Mar 2017 14:47:56 +0100 Subject: [PATCH 3/4] Upgrade more eslint config to solve peer dependencies --- package.json | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 14bf349..bf153b8 100644 --- a/package.json +++ b/package.json @@ -17,11 +17,12 @@ }, "devDependencies": { "eslint": "^3.17.1", - "eslint-config-metalab": "^4.0.1", - "eslint-import-resolver-babel-module": "^2.0.1", - "eslint-plugin-filenames": "^0.2.0", - "eslint-plugin-import": "^1.15.0", - "eslint-plugin-lodash-fp": "^1.2.0", - "eslint-plugin-react": "^5.1.1" + "eslint-config-metalab": "^6.0.1", + "eslint-import-resolver-babel-module": "^3.0.0", + "eslint-plugin-babel": "^4.1.1", + "eslint-plugin-filenames": "^1.1.0", + "eslint-plugin-import": "^2.2.0", + "eslint-plugin-lodash-fp": "^2.1.3", + "eslint-plugin-react": "^6.10.0" } } From c25bee0d8013ef949d5f2d59447e82b1fc5b0e14 Mon Sep 17 00:00:00 2001 From: Iyanu-Tomiwa Date: Thu, 16 Mar 2017 14:56:11 +0100 Subject: [PATCH 4/4] Add metalabs babel preset Add the babel/object-curly-spacing required by eslint --- .babelrc | 11 +++++++++++ .eslintrc | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .babelrc diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..7769b1f --- /dev/null +++ b/.babelrc @@ -0,0 +1,11 @@ +{ + "presets": [ + "metalab", + "metalab/compatibility" + ], + "env": { + "development": { + "sourceMaps": true + } + } +} \ No newline at end of file diff --git a/.eslintrc b/.eslintrc index 7d7f7e7..0472420 100644 --- a/.eslintrc +++ b/.eslintrc @@ -12,6 +12,7 @@ "import/no-commonjs": 0, "no-undef": 0, "no-unused-vars": 0, - "space-before-function-paren": 0 + "space-before-function-paren": 0, + "babel/object-curly-spacing": 0 } }