Skip to content

Commit

Permalink
Add script/lint --fix which fixes some code formatting issues via eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
rafeca committed May 13, 2019
1 parent 2df2f87 commit d7327f5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion script/lib/lint-java-script-paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@

const path = require('path')
const {spawn} = require('child_process')
const process = require('process')

const CONFIG = require('../config')

module.exports = async function () {
return new Promise((resolve, reject) => {
const eslintArgs = ['--cache', '--format', 'json']

if (process.argv.includes('--fix')) {
eslintArgs.push('--fix')
}

const eslint = spawn(
path.join('script', 'node_modules', '.bin', 'eslint'),
['--cache', '--format', 'json', '.'],
[...eslintArgs, '.'],
{ cwd: CONFIG.repositoryRootPath }
)

Expand Down

0 comments on commit d7327f5

Please sign in to comment.