Skip to content

Commit

Permalink
fix: auto fix lint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Jun 24, 2019
1 parent b610f74 commit 085cef6
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/lib/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ export function create (name: string) {
mkdirp.sync(savePath)

createDecisions(name, savePath)
let toc = generate('toc', {output: false})
let toc = generate('toc', { output: false })
fs.writeFileSync(savePath + 'README.md', toc)
}
4 changes: 2 additions & 2 deletions src/lib/logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ let path = Config.getSavePath()

let getAllFilesName = function (): string[] {
let outputArray = ['']
let files = walkSync.entries(path, { globs: ['**/*.md']})
files.forEach( function (file) {
let files = walkSync.entries(path, { globs: ['**/*.md'] })
files.forEach(function (file) {
let fileName = file.relativePath

let index = Utils.getIndexByString(fileName)
Expand Down
2 changes: 1 addition & 1 deletion src/lib/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function buildTocBodyFun (index, decision, file, bodyString): string[] {
}

export function search (keywords) {
findInFiles.find({'term': keywords, 'flags': 'ig'}, savePath, '.md$')
findInFiles.find({ 'term': keywords, 'flags': 'ig' }, savePath, '.md$')
.then(results => {
let files: object[] = []
for (let result in results) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let i18n = Utils.getI18n()

let getAllFilesName = function (): string[] {
let outputArray = ['']
let files = walkSync.entries(path, {globs: ['**/*.md']})
let files = walkSync.entries(path, { globs: ['**/*.md'] })
files.forEach(function (file) {
let fileName = file.relativePath

Expand Down
6 changes: 3 additions & 3 deletions src/lib/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ function generateNewFileName (newIndex: number, title: string | any) {
}

function updateNameByTitle (): void {
let files = walkSync.entries(savePath, {globs: ['**/*.md'], ignore: ['README.md']})
let files = walkSync.entries(savePath, { globs: ['**/*.md'], ignore: ['README.md'] })

files.forEach( function (file) {
files.forEach(function (file) {
let fileName = file.relativePath
let fileData = fs.readFileSync(savePath + fileName, 'utf8')
let firstLine = fileData.split('\n')[0]
Expand All @@ -43,7 +43,7 @@ function updateNameByTitle (): void {
}

function updateToc (): void {
let toc = generate('toc', {output: false})
let toc = generate('toc', { output: false })
fs.writeFileSync(savePath + 'README.md', toc)
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function getMaxIndex (files: {relativePath: string}[]) {

function getLatestIndex (): number {
let path = Config.getSavePath()
let files = walkSync.entries(path, {globs: ['**/*.md']})
let files = walkSync.entries(path, { globs: ['**/*.md'] })

if (!(files && files.length > 0)) {
return 0
Expand Down
2 changes: 1 addition & 1 deletion src/tests/search.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let adrOptions = JSON.stringify({
test('ADR: list', t => {
let findSpy = sinon.stub(findInFiles, 'find').returns({
then: cb => {
cb({'docs/adr/001-filename.md': {}})
cb({ 'docs/adr/001-filename.md': {} })
}
})
let ADRGetSavePathSpy = sinon.stub(Config, 'getSavePath').returns('./')
Expand Down

0 comments on commit 085cef6

Please sign in to comment.