remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
remix-project/lint-fix-targets.js

23 lines
718 B

const { spawnSync, execSync } = require('child_process')
const fs = require('fs')
const { exit } = require('process')
execSync('yarn nx graph --file=./projects.json')
const file = fs.readFileSync('projects.json')
const projects = JSON.parse(file)
console.log(Object.keys(projects.graph.nodes))
for(let node of Object.keys(projects.graph.nodes)){
if(projects.graph.nodes[node].data.targets.lint){
console.log(projects.graph.nodes[node].data.name)
const result = spawnSync('yarn', ['lint', projects.graph.nodes[node].data.name], '--fix')
if(result.status == 0){
console.log('success')
}else{
console.log(result.stdout.toString())
console.log(result.stderr.toString())
}
}
}