I use this code to load .eslintrc:
const eslintrcs = {};
async function getLintOptions(path) {
    if (!eslintrcs[path]) {
        let eslintrc;
        try {
            eslintrc = await readFile('./.eslintrc');
            eslintrc = await readFile(`${path}/.eslintrc}`);
        } catch (err) {
            eslintrc = eslintrc || {};
        }
        eslintrcs[path] = JSON.parse(eslintrc);
        console.log(eslintrcs[path]);
    }
    return eslintrcs[path];
}
So I'm linting my files like this:
        files.forEach(async (filePath) => {
            try {
                let code;
                if (!options.skipLint) {
                    logFileProgress('Linting', filePath);
                    code = await readFile(filePath);
                    const messages = linter.verify(code, await getLintOptions(path));
The problem here is that as the code is asynchronous, so it stops after first await is found and keeps with sync code and the result is this one:
info: 2016-10-05 18:47 - Linting: src/server/_config.js
info: 2016-10-05 18:47 - Linting: src/server/admin/router.js
info: 2016-10-05 18:47 - Linting: src/server/server.js
...
{ parser: 'babel-eslint',
  extends: 'airbnb',
  rules: { indent: [ 2, 4, [Object] ] } }
{ parser: 'babel-eslint',
  extends: 'airbnb',
  rules: { indent: [ 2, 4, [Object] ] } }
{ parser: 'babel-eslint',
  extends: 'airbnb',
  rules: { indent: [ 2, 4, [Object] ] } }
Is there a way to stop an async function until it gets the result?
I've even tried to move the getLintOptions outside forEach loop:
        const eslintrc = await getLintOptions(path);
        files.forEach(async (filePath) => {
            try {
                let code;
                if (!options.skipLint) {
                    logFileProgress('Linting', filePath);
                    code = await readFile(filePath);
                    const messages = linter.verify(code, eslintrc);
 
    