+ %w(.js .es6 .js.es6).include?(File.extname(path)) && !eslintignore_matches?(path)
+ end
+
+ def eslintignore_matches?(path)
+ @_repo_path ||= @patches.first.repo.path
+ @_eslintignore_path ||= File.join(@_repo_path, '.eslintignore')
+ @_eslintignore_exists ||= File.exist?(@_eslintignore_path)
+
+ return false unless @_eslintignore_exists
+
+ @_eslintignored_files ||=
+ Dir.chdir @_repo_path do # change to the repo path where `.eslintignore` was found
+ eslintignore_content = File.readlines(@_eslintignore_path).map(&:chomp)
+ ignored_files = Globby.select(eslintignore_content)
+
+ # prefix each found file with `repo_path`, because `path` is absolute, too
+ ignored_files.map { |file| File.join(@_repo_path, file).to_s }
+ end
+
+ @_eslintignored_files.include?(path.to_s)