refactor: lint scripts and benchmarks

This commit is contained in:
Clark Du 2018-08-10 15:18:54 +01:00
parent efb1d85f89
commit 7c7701d622
4 changed files with 15 additions and 19 deletions

View File

@ -1,5 +1,5 @@
<template>
<ul>
<li v-for="n in 10000" :key="n">This is row {{ n + 1 }}</li>
</ul>
</template>
<ul>
<li v-for="n in 10000" :key="n">This is row {{ n + 1 }}</li>
</ul>
</template>

View File

@ -1,3 +1,3 @@
<template>
<h1>My component!</h1>
</template>
<h1>My component!</h1>
</template>

View File

@ -55,7 +55,7 @@
"build:make-start": "node scripts/make-start",
"clean": "rimraf dist",
"coverage": "codecov",
"lint": "eslint --ext .js,.mjs,.vue bin/** lib test examples",
"lint": "eslint --ext .js,.mjs,.vue bin/** scripts/** lib test examples benchmarks",
"postinstall": "opencollective postinstall || exit 0",
"prebuild": "yarn clean",
"security": "nsp check || true",

View File

@ -39,8 +39,8 @@ while (match) {
requires = requires.filter(r => excludes.indexOf(r) === -1)
// Resolve version constrains
let dependencies = {}
requires.forEach(r => {
const dependencies = {}
requires.forEach((r) => {
if (!packageJSON.dependencies[r]) {
// eslint-disable-next-line no-console
console.warn('Cannot resolve dependency version for ' + r)
@ -50,10 +50,8 @@ requires.forEach(r => {
})
// Drop fields
let drops = ['devDependencies', 'scripts', 'nyc', 'types']
drops.forEach(k => {
delete packageJSON[k]
})
const drops = ['devDependencies', 'scripts', 'nyc', 'types']
drops.forEach(k => delete packageJSON[k])
// Update dependencies
packageJSON.dependencies = dependencies
@ -73,12 +71,12 @@ writeFileSync(
// Copy required files
const excludeFiles = ['README.md', '.gitignore']
packageJSON.files.forEach(file => {
packageJSON.files.forEach((file) => {
if (excludeFiles.indexOf(file) !== -1) {
return
}
let src = resolve(rootDir, file)
let dst = resolve(startDir, file)
const src = resolve(rootDir, file)
const dst = resolve(startDir, file)
// console.log(relative(rootDir, src), '~>', relative(rootDir, dst))
removeSync(dst)
copySync(src, dst)
@ -93,9 +91,7 @@ const extraFiles = [
'dist/nuxt.js',
'dist/nuxt.js.map'
]
extraFiles.forEach(file => {
removeSync(resolve(startDir, file))
})
extraFiles.forEach(file => removeSync(resolve(startDir, file)))
// Patch bin/nuxt-start
const binStart = resolve(startDir, 'bin/nuxt-start')