From a89241f0b92bf8fbf1f2255201004613e0f1153c Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 13 Aug 2015 15:19:27 -0400 Subject: [PATCH] Don't include code in files for jshint anymore, eslint is run on command line --- lib/discourse_iife.rb | 12 +----------- .../tilt/es6_module_transpiler_template.rb | 14 -------------- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/lib/discourse_iife.rb b/lib/discourse_iife.rb index 5c25fc63200..d966539bab7 100644 --- a/lib/discourse_iife.rb +++ b/lib/discourse_iife.rb @@ -24,17 +24,7 @@ class DiscourseIIFE < Sprockets::Processor return data if path =~ /\.hbrs/ return data if path =~ /\.hbs/ - res = "(function () {\n\nvar $ = window.jQuery;\n// IIFE Wrapped Content Begins:\n\n#{data}\n\n// IIFE Wrapped Content Ends\n\n })(this);" - - # Include JS code for JSHint - unless Rails.env.production? - req_path = path.sub(Rails.root.to_s, '') - .sub("/app/assets/javascripts", "") - .sub("/test/javascripts", "") - res << "\nwindow.__eslintSrc = window.__eslintSrc || {}; window.__eslintSrc['/assets#{req_path}'] = #{data.to_json};\n" - end - - res + "(function () {\n\nvar $ = window.jQuery;\n// IIFE Wrapped Content Begins:\n\n#{data}\n\n// IIFE Wrapped Content Ends\n\n })(this);" end end diff --git a/lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb b/lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb index 2a320ebf59e..30f575f4235 100644 --- a/lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb +++ b/lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb @@ -116,20 +116,6 @@ module Tilt end end - # Include JS code for JSHint - unless Rails.env.production? - if scope.pathname.to_s =~ /js\.es6/ - extension = "js.es6" - elsif scope.pathname.to_s =~ /\.es6/ - extension = "es6" - else - extension = "js" - end - req_path = "/assets/#{scope.logical_path}.#{extension}" - - @output << "\nwindow.__eslintSrc = window.__eslintSrc || {}; window.__eslintSrc['#{req_path}'] = #{data.to_json};\n" - end - @output end