Issues (3)

src/library/mkdir.js (1 issue)

1
import fs from 'fs'
2
3
const mkdirSync = function mkdirSync(path) {
0 ignored issues
show
Comprehensibility Naming Best Practice introduced by
The variable mkdirSync already seems to be declared on line 3. Consider using another variable name or omitting the var keyword.

This check looks for variables that are declared in multiple lines. There may be several reasons for this.

In the simplest case the variable name was reused by mistake. This may lead to very hard to locate bugs.

If you want to reuse a variable for another purpose, consider declaring it at or near the top of your function and just assigning to it subsequently so it is always declared.

Loading history...
4
  try {
5
    fs.mkdirSync(path)
6
  } catch (e) {
7
    if (e.code !== 'EEXIST') {
8
      throw e
9
    }
10
  }
11
}
12
13
export default mkdirSync