UNPKG

@development-environment/linting

Version:
18 lines (14 loc) 376 B
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