chore(scripts): fix lint errors
This commit is contained in:
parent
e7c7c2ce3e
commit
e9aa88e637
7
scripts/.eslintrc.js
Normal file
7
scripts/.eslintrc.js
Normal file
@ -0,0 +1,7 @@
|
||||
'use strict'
|
||||
|
||||
module.exports = {
|
||||
rules: {
|
||||
'no-console': 'off',
|
||||
},
|
||||
}
|
@ -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) {
|
||||
|
@ -1,5 +1,7 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
'use strict'
|
||||
|
||||
const formatFiles = files => {
|
||||
run('./node_modules/.bin/prettier', ['--write'].concat(files))
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -1,5 +1,7 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
'use strict'
|
||||
|
||||
const { fromEvent } = require('promise-toolbox')
|
||||
const { spawn } = require('child_process')
|
||||
|
||||
|
@ -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')
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user