chore(scripts): fix lint errors

This commit is contained in:
Julien Fontanet 2022-03-02 17:48:26 +01:00
parent e7c7c2ce3e
commit e9aa88e637
8 changed files with 30 additions and 6 deletions

7
scripts/.eslintrc.js Normal file
View File

@ -0,0 +1,7 @@
'use strict'
module.exports = {
rules: {
'no-console': 'off',
},
}

View File

@ -1,5 +1,7 @@
#!/usr/bin/env node
'use strict'
require('@babel/register')
const pkg = require('../package.json')
@ -21,7 +23,7 @@ function bench(path) {
}
fn({
benchmark: benchmark,
benchmark,
})
benchmarks.forEach(function (benchmark) {

View File

@ -1,5 +1,7 @@
#!/usr/bin/env node
'use strict'
const formatFiles = files => {
run('./node_modules/.bin/prettier', ['--write'].concat(files))
}

View File

@ -1,12 +1,14 @@
#!/usr/bin/env node
'use strict'
const isEmpty = require('lodash/isEmpty')
const sortedObject = require('sorted-object')
const { dirname, relative } = require('path')
const { dirname, join, relative } = require('path')
const { getPackages, noop, readFile, symlink, writeFile, unlink } = require('./utils')
const BABEL_ESLINTRC_PATH = `${__dirname}/babel-eslintrc.js`
const NPMIGNORE_PATH = `${__dirname}/npmignore`
const BABEL_ESLINTRC_PATH = join(__dirname, 'babel-eslintrc.js')
const NPMIGNORE_PATH = join(__dirname, 'npmignore')
const deleteIfEmpty = (object, property) => {
if (isEmpty(object[property])) {
@ -25,7 +27,9 @@ const deleteProperties = (object, property, properties) => {
deleteIfEmpty(object, property)
}
const generateReadme = require('handlebars').compile(require('fs').readFileSync(`${__dirname}/README.md.tpl`, 'utf8'))
const generateReadme = require('handlebars').compile(
require('fs').readFileSync(join(__dirname, 'README.md.tpl'), 'utf8')
)
const forceRelativeSymlink = async (target, path) => {
await unlink(path).catch(noop)

View File

@ -1,5 +1,7 @@
#!/usr/bin/env node
'use strict'
const { fromEvent } = require('promise-toolbox')
const { spawn } = require('child_process')

View File

@ -1,5 +1,7 @@
#!/usr/bin/env node
'use strict'
const { delimiter } = require('path')
const { forEach, fromEvent } = require('promise-toolbox')
const { spawn } = require('child_process')

View File

@ -1,5 +1,7 @@
#!/usr/bin/env node
'use strict'
const { execFileSync, spawnSync } = require('child_process')
const run = (command, args) => spawnSync(command, args, { stdio: 'inherit' }).status

View File

@ -1,7 +1,10 @@
'use strict'
const { forEach, fromCallback } = require('promise-toolbox')
const { join } = require('path')
const fs = require('fs')
const ROOT_DIR = `${__dirname}/..`
const ROOT_DIR = join(__dirname, '..')
const _getPackages = scope => {
const inScope = scope !== undefined