@development-environment/linting
Version:
Automatically catches many issues as they happen
18 lines (14 loc) • 376 B
JavaScript
class Linter {
constructor (fileNamePattern, errorCallback) {
this.fileNamePattern = new RegExp(fileNamePattern)
this.errorCallback = errorCallback || console.error
}
check (fileName) {
if (this.fileNamePattern.test(fileName)) {
return true
}
this.errorCallback(this.fileNamePattern, fileName)
return false
}
}
module.exports = Linter