Skip to content

Commit

Permalink
Replace minimatch with ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
sonicdoe committed Sep 16, 2017
1 parent 05f787f commit f7481f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
13 changes: 5 additions & 8 deletions lib/utils/style-settings.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* global atom */
var minimatch = require('minimatch')
var ignore = require('ignore')
var pkgConfig = require('pkg-config')
var fs = require('fs')

Expand Down Expand Up @@ -70,15 +70,12 @@ function checkStyleSettings (filePath, textEditor) {

// If ignore glob patterns are present
if (styleSettings.ignore && relativeFilePath) {
var ignoreGlobPatterns = []
ignoreGlobPatterns = ignoreGlobPatterns.concat(styleSettings.ignore)

ignoreGlobPatterns = ignoreGlobPatterns.some(function (pattern) {
return minimatch(relativeFilePath, pattern)
})
const ignores = ignore()
.add(styleSettings.ignore)
.ignores(relativeFilePath)

// If a glob pattern was matched, do not lint the file
if (ignoreGlobPatterns) {
if (ignores) {
settings.style = 'no-style'
return settings
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"eslint-rule-documentation": "^1.0.9",
"esprima": "^3.1.1",
"happiness": "^10.0.2",
"ignore": "^3.3.5",
"loophole": "^1.1.0",
"minimatch": "^3.0.4",
"pkg-config": "^1.1.0",
"q": "^1.4.1",
"semistandard": "^11.0.0",
Expand Down

0 comments on commit f7481f5

Please sign in to comment.