import { CLIEngine } from 'eslint';

export default (fix) => {
  const cli = new CLIEngine({
    baseConfig: {
      extends: ['stanza', 'prettier'],
    },
    useEslintrc: false,
    extensions: ['.js', '.jsx'],
    fix,
  });

  const report = cli.executeOnFiles(['src/']);
  const formatter = cli.getFormatter('codeframe');

  console.log(formatter(report.results));

  if (fix) {
    CLIEngine.outputFixes(report);
  } else if (report.errorCount) {
    process.exit(1); // exit with error
  }
};

@@ -90,72 +90,8 @@
 e(%7B%0A
-    baseConfig: %7B%0A      extends: %5B'stanza', 'prettier'%5D,%0A    %7D,%0A
     
@@ -107,12 +107,11 @@
 rc: 
-fals
+tru
 e,%0A 

use eslint rc from project