Exclude generated i18n files from eslint checks
authorTom Hughes <tom@compton.nu>
Sat, 6 Apr 2019 16:13:12 +0000 (17:13 +0100)
committerTom Hughes <tom@compton.nu>
Sat, 6 Apr 2019 16:16:59 +0000 (17:16 +0100)
config/initializers/eslint.rb [new file with mode: 0644]

diff --git a/config/initializers/eslint.rb b/config/initializers/eslint.rb
new file mode 100644 (file)
index 0000000..9d805ea
--- /dev/null
@@ -0,0 +1,13 @@
+if defined?(ESLintRails::Runner)
+  module OpenStreetMap
+    module ESLintRails
+      module ExcludeI18n
+        def assets
+          super.reject { |a| a.to_s =~ %r{/i18n/} }
+        end
+      end
+    end
+  end
+
+  ESLintRails::Runner.prepend(OpenStreetMap::ESLintRails::ExcludeI18n)
+end