Skip to content

Commit

Permalink
Merge pull request #453 from thematters/feat/comment-style
Browse files Browse the repository at this point in the history
Revise comment editor formats
  • Loading branch information
robertu7 authored Mar 11, 2024
2 parents 864db23 + fed703c commit b2f46b0
Show file tree
Hide file tree
Showing 34 changed files with 6,315 additions and 5,176 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"rules": {
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"react-hooks/exhaustive-deps": "off"
"react-hooks/exhaustive-deps": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/strict-boolean-expressions": "off"
}
}
5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm test && npm run lint
npm run lint && npm test
14 changes: 7 additions & 7 deletions benchmark/md2html.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import { suite, add, cycle, complete, save } from 'benny'
import { add, complete, cycle, save, suite } from 'benny'
import fs from 'fs'
import path from 'path'
import naturalCompare from 'natural-compare-lite'
import path from 'path'

import { md2html } from '../src'

const markdownDir = path.resolve('./examples/markdown')

const mds: { [key: string]: any } = {}
const mds: Record<string, any> = {}
const adds: any[] = []

const filenames = fs
.readdirSync(markdownDir, { encoding: 'utf-8' })
.sort(naturalCompare)

for (let filename of filenames) {
for (const filename of filenames) {
const md = fs.readFileSync(path.resolve(markdownDir, filename), 'utf-8')
mds[filename] = md
adds.push(
add(`~${filename.split('.')[0]} characters`, async () => {
md2html(mds[filename])
})
}),
)
}

Expand All @@ -31,9 +31,9 @@ suite(
complete(() => {
const used = process.memoryUsage().heapUsed / 1024 / 1024
console.log(
`\nThe script uses approximately ${Math.round(used * 100) / 100} MB`
`\nThe script uses approximately ${Math.round(used * 100) / 100} MB`,
)
}),
save({ file: 'md2html' }),
save({ file: 'md2html', format: 'chart.html' })
save({ file: 'md2html', format: 'chart.html' }),
)
Loading

0 comments on commit b2f46b0

Please sign in to comment.