Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eslint: enable no-return-await #2707

Merged
merged 1 commit into from Mar 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintrc.json
Expand Up @@ -13,5 +13,8 @@
"globals": {
"parcelRequire": true,
"define": true
},
"rules": {
"no-return-await": "error"
}
}
2 changes: 1 addition & 1 deletion packages/core/parcel-bundler/src/Resolver.js
Expand Up @@ -159,7 +159,7 @@ class Resolver {
// First try as a file, then as a directory.
return (
(await this.loadAsFile(filename, extensions, pkg)) ||
(await this.loadDirectory(filename, extensions, pkg))
(await this.loadDirectory(filename, extensions, pkg)) // eslint-disable-line no-return-await
);
}

Expand Down
Expand Up @@ -53,7 +53,7 @@ async function getBabelRc(asset, isSource) {
}

// Otherwise, return the .babelrc if babelify was found
return babelify ? await findBabelRc(asset) : null;
return babelify ? findBabelRc(asset) : null;
}

// If this asset is not in node_modules, always use the .babelrc
Expand Down
6 changes: 2 additions & 4 deletions packages/core/parcel-bundler/src/utils/loadPlugins.js
Expand Up @@ -3,13 +3,11 @@ const localRequire = require('./localRequire');
module.exports = async function loadPlugins(plugins, relative) {
if (Array.isArray(plugins)) {
return Promise.all(
plugins.map(async p => loadPlugin(p, relative)).filter(Boolean)
plugins.map(p => loadPlugin(p, relative)).filter(Boolean)
);
} else if (typeof plugins === 'object') {
let mapPlugins = await Promise.all(
Object.keys(plugins).map(
async p => await loadPlugin(p, relative, plugins[p])
)
Object.keys(plugins).map(p => loadPlugin(p, relative, plugins[p]))
);
return mapPlugins.filter(Boolean);
} else {
Expand Down