From be2cb96ac5dc4910ac3171bfef4949884f6d8274 Mon Sep 17 00:00:00 2001 From: postmechanical Date: Mon, 15 Mar 2021 18:15:16 -0600 Subject: [PATCH] Add support for renamed files --- lib/eslint/plugin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/eslint/plugin.rb b/lib/eslint/plugin.rb index ddb3936..fa231eb 100644 --- a/lib/eslint/plugin.rb +++ b/lib/eslint/plugin.rb @@ -71,7 +71,7 @@ def lint_results bin = eslint_path raise 'eslint is not installed' unless bin return run_lint(bin, '.') unless filtering - ((git.modified_files - git.deleted_files) + git.added_files) + ((git.modified_files - git.deleted_files - git.renamed_files.map { |r| r[:before] }) + git.added_files + git.renamed_files.map { |r| r[:after] }) .select { |f| target_extensions.include?(File.extname(f)) } .map { |f| f.gsub("#{Dir.pwd}/", '') } .map { |f| run_lint(bin, f).first }