mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-27 14:54:05 -06:00
refactor(prettier): fixed linting
This commit is contained in:
parent
c06c15d351
commit
c7e59c6451
@ -70,7 +70,10 @@ async function buildQuartz(argv: Argv, mut: Mutex, clientRefresh: () => void) {
|
||||
console.log(`Cleaned output directory \`${output}\` in ${perf.timeSince("clean")}`)
|
||||
|
||||
perf.addEvent("glob")
|
||||
const allFiles = await glob("**/*.*", argv.directory, [...cfg.configuration.ignorePatterns, ...loadIgnorePatterns(),])
|
||||
const allFiles = await glob("**/*.*", argv.directory, [
|
||||
...cfg.configuration.ignorePatterns,
|
||||
...loadIgnorePatterns(),
|
||||
])
|
||||
const fps = allFiles.filter((fp) => fp.endsWith(".md")).sort()
|
||||
console.log(
|
||||
`Found ${fps.length} input files from \`${argv.directory}\` in ${perf.timeSince("glob")}`,
|
||||
|
||||
@ -1,18 +1,17 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as fs from "fs"
|
||||
import * as path from "path"
|
||||
|
||||
function loadIgnorePatterns(): string[] {
|
||||
const gitignorePath = path.join(process.cwd(), '.gitignore');
|
||||
const gitignorePath = path.join(process.cwd(), ".gitignore")
|
||||
if (!fs.existsSync(gitignorePath)) {
|
||||
return [];
|
||||
return []
|
||||
}
|
||||
|
||||
const gitignoreContent = fs.readFileSync(gitignorePath, 'utf-8');
|
||||
const gitignoreContent = fs.readFileSync(gitignorePath, "utf-8")
|
||||
return gitignoreContent
|
||||
.split('\n')
|
||||
.split("\n")
|
||||
.map((line) => line.trim())
|
||||
.filter((line) => line !== '' && !line.startsWith('#'));
|
||||
.filter((line) => line !== "" && !line.startsWith("#"))
|
||||
}
|
||||
|
||||
export default loadIgnorePatterns;
|
||||
|
||||
export default loadIgnorePatterns
|
||||
|
||||
Loading…
Reference in New Issue
Block a user