mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-28 22:32:42 +00:00
refactor: lint scripts and benchmarks
This commit is contained in:
parent
efb1d85f89
commit
7c7701d622
@ -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>
|
||||
|
@ -1,3 +1,3 @@
|
||||
<template>
|
||||
<h1>My component!</h1>
|
||||
</template>
|
||||
<h1>My component!</h1>
|
||||
</template>
|
||||
|
@ -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",
|
||||
|
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user