public excludes()

in jshint-server/src/server.ts [320:345]


	public excludes(fsPath: string, root: string): boolean {
		if (fsPath) {

			if (this.excludeCache.hasOwnProperty(fsPath)) {
				return this.excludeCache[fsPath];
			}

			let shouldBeExcluded = false;

			if (this.configPath && fs.existsSync(this.configPath)) {
				shouldBeExcluded = this.match(processIgnoreFile(this.configPath, [], { cache: false }), fsPath, root);
			} else {
				let ignoreFile = locateFile(fsPath, JSHINTIGNORE);
				if (ignoreFile) {
					shouldBeExcluded = this.match(processIgnoreFile(ignoreFile, [], { cache: false }), fsPath, this.folderOf(ignoreFile));
				} else {
					shouldBeExcluded = this.match(this.defaultExcludePatterns, fsPath, root);
				}
			}

			this.excludeCache[fsPath] = shouldBeExcluded;
			return shouldBeExcluded;
		}

		return true;
	}