How to use the xo.getFormatter function in xo

To help you get started, we’ve selected a few xo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github clippedjs / clipped / plugins / eslint / clipped.config.js View on Github external
api.hook('lint').add('xo', async api => {
          const xo = require('xo')

          const report = await xo.lintFiles([], {
            ...api.config.eslint.toConfig(),
            extensions,
            fix
          })
          if (fix) {
            xo.outputFixes(report)
          }
          const formatter = xo.getFormatter(format)

          if (report.errorCount || report.warningCount) {
            api.print(formatter(report.results))
          } else {
            api.print(
              report.results.some(f => f.output)
                ? '🎉  All lint errors auto-fixed'
                : '🎉  No lint errors found'
            )
          }
        })
      }
github xojs / gulp-xo / index.js View on Github external
module.exports[fn] = (formatter, writable) => (
		eslint[fn](formatter ? xo.getFormatter(formatter) : formatterPretty, writable)
	);
}

xo

JavaScript/TypeScript linter (ESLint wrapper) with great defaults

MIT
Latest version published 3 months ago

Package Health Score

77 / 100
Full package analysis