diff --git a/.eslintrc.js b/.eslintrc.js index f2157dbb..7112db46 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,3 +1,7 @@ +// Selectively include rules from airbnb https://github.com/transloadit/node-sdk/issues/90 +// eslint-disable-next-line import/no-extraneous-dependencies +const airbnbRulesImports = require('eslint-config-airbnb-base/rules/imports').rules + module.exports = { extends: 'standard', env : { @@ -6,8 +10,10 @@ module.exports = { node: true, }, rules: { - 'no-multi-spaces': 0, - 'comma-dangle' : [ + // See https://github.com/transloadit/node-sdk/issues/93 + 'import/no-extraneous-dependencies': airbnbRulesImports['import/no-extraneous-dependencies'], + 'no-multi-spaces' : 0, + 'comma-dangle' : [ 'error', 'always-multiline', ], diff --git a/examples/retry.js b/examples/retry.js index 4283b1e5..95f71cfa 100644 --- a/examples/retry.js +++ b/examples/retry.js @@ -1,8 +1,11 @@ +// yarn add p-retry +// // Run this file as: // // env TRANSLOADIT_KEY=xxx TRANSLOADIT_SECRET=yyy node retry.js // +// eslint-disable-next-line import/no-extraneous-dependencies const pRetry = require('p-retry') // You'll likely just want to `require('transloadit')`, but we're requiring the local diff --git a/package.json b/package.json index 23b286a3..bc8088a9 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "@types/jest": "^26.0.19", "badge-maker": "^3.3.0", "eslint": "^7.18.0", + "eslint-config-airbnb-base": "^14.2.1", "eslint-config-standard": "^16.0.2", "eslint-plugin-import": "^2.22.1", "eslint-plugin-node": "^11.1.0", diff --git a/yarn.lock b/yarn.lock index 258248fa..162f12d3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1330,6 +1330,11 @@ configstore@^5.0.1: write-file-atomic "^3.0.0" xdg-basedir "^4.0.0" +confusing-browser-globals@^1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.10.tgz#30d1e7f3d1b882b25ec4933d1d1adac353d20a59" + integrity sha512-gNld/3lySHwuhaVluJUKLePYirM3QNCKzVxqAdhJII9/WXKVX5PURzMVJspS1jTslSqjeuG4KMVTSouit5YPHA== + contains-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" @@ -1695,6 +1700,15 @@ escodegen@^1.14.1: optionalDependencies: source-map "~0.6.1" +eslint-config-airbnb-base@^14.2.1: + version "14.2.1" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.1.tgz#8a2eb38455dc5a312550193b319cdaeef042cd1e" + integrity sha512-GOrQyDtVEc1Xy20U7vsB2yAoB4nBlfH5HZJeatRXHleO+OS5Ot+MWij4Dpltw4/DyIkqUfqz1epfhVR5XWWQPA== + dependencies: + confusing-browser-globals "^1.0.10" + object.assign "^4.1.2" + object.entries "^1.1.2" + eslint-config-standard@^16.0.2: version "16.0.2" resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-16.0.2.tgz#71e91727ac7a203782d0a5ca4d1c462d14e234f6" @@ -3853,6 +3867,16 @@ object.assign@^4.1.2: has-symbols "^1.0.1" object-keys "^1.1.1" +object.entries@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.3.tgz#c601c7f168b62374541a07ddbd3e2d5e4f7711a6" + integrity sha512-ym7h7OZebNS96hn5IJeyUmaWhaSM4SVtAPPfNLQEI2MYWCO2egsITb9nab2+i/Pwibx+R0mtn+ltKJXRSeTMGg== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.1" + has "^1.0.3" + object.pick@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747"