diff --git a/decls/minimatch.js b/decls/minimatch.js new file mode 100644 index 0000000..9f07ba7 --- /dev/null +++ b/decls/minimatch.js @@ -0,0 +1,20 @@ +// @flow + +declare type MinimatchOptions = { + debug?: boolean, + nobrace?: boolean, + noglobstar?: boolean, + dot?: boolean, + noext?: boolean, + nocase?: boolean, + nonull?: boolean, + matchBase?: boolean, + nocomment?: boolean, + nonegate?: boolean, + flipNegate?: boolean, +} + +declare module 'minimatch' { + declare module.exports: + (path: string, pattern: string, options?: MinimatchOptions) => boolean; +} diff --git a/lib/main.js b/lib/main.js index 9208aab..dffc115 100644 --- a/lib/main.js +++ b/lib/main.js @@ -3,11 +3,24 @@ /* @flow */ import Path from 'path'; +import { readFile } from 'fs'; +import minimatch from 'minimatch'; /* eslint-disable import/extensions, import/no-extraneous-dependencies */ import { CompositeDisposable } from 'atom'; import type { TextEditor } from 'atom'; /* eslint-enable import/extensions, import/no-extraneous-dependencies */ +async function readIgnoreList(ignorePath) { + return new Promise((resolve, reject) => { + readFile(ignorePath, 'utf8', (err, data) => { + if (err) { + reject(err); + } + resolve(data.split(/[\r\n]/)); + }); + }); +} + module.exports = { config: { executablePath: { @@ -18,17 +31,22 @@ module.exports = { lintInlineJavaScript: { type: 'boolean', default: false, - description: 'Lint JavaScript inside `