Skip to content

Commit

Permalink
Refactor code-style
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Aug 20, 2021
1 parent 4076c28 commit 496e2fb
Show file tree
Hide file tree
Showing 3 changed files with 233 additions and 235 deletions.
12 changes: 6 additions & 6 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function toVFile(options) {
* @returns {VFile}
*/
export function readSync(description, options) {
var file = toVFile(description)
const file = toVFile(description)
file.value = fs.readFileSync(path.resolve(file.cwd, file.path), options)
return file
}
Expand All @@ -64,7 +64,7 @@ export function readSync(description, options) {
* @returns {VFile}
*/
export function writeSync(description, options) {
var file = toVFile(description)
const file = toVFile(description)
fs.writeFileSync(path.resolve(file.cwd, file.path), file.value || '', options)
return file
}
Expand All @@ -86,7 +86,7 @@ export const read =
* @param {Callback} [callback]
*/
function (description, options, callback) {
var file = toVFile(description)
const file = toVFile(description)

if (!callback && typeof options === 'function') {
callback = options
Expand All @@ -112,7 +112,7 @@ export const read =
*/
function executor(resolve, reject) {
/** @type {string} */
var fp
let fp

try {
fp = path.resolve(file.cwd, file.path)
Expand Down Expand Up @@ -155,7 +155,7 @@ export const write =
* @param {Callback} [callback]
*/
function (description, options, callback) {
var file = toVFile(description)
const file = toVFile(description)

// Weird, right? Otherwise `fs` doesn’t accept it.
if (!callback && typeof options === 'function') {
Expand All @@ -182,7 +182,7 @@ export const write =
*/
function executor(resolve, reject) {
/** @type {string} */
var fp
let fp

try {
fp = path.resolve(file.cwd, file.path)
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
"@types/tape": "^4.0.0",
"c8": "^7.0.0",
"prettier": "^2.0.0",
"remark-cli": "^9.0.0",
"remark-preset-wooorm": "^8.0.0",
"remark-cli": "^10.0.0",
"remark-preset-wooorm": "^9.0.0",
"rimraf": "^3.0.0",
"tape": "^5.0.0",
"type-coverage": "^2.0.0",
"typescript": "^4.0.0",
"xo": "^0.39.0"
"xo": "^0.44.0"
},
"scripts": {
"prepack": "npm run build && npm run format",
Expand All @@ -69,8 +69,7 @@
"xo": {
"prettier": true,
"rules": {
"no-var": "off",
"prefer-arrow-callback": "off"
"unicorn/prefer-node-protocol": "off"
}
},
"remarkConfig": {
Expand Down
Loading

0 comments on commit 496e2fb

Please sign in to comment.