mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
Don't include code in files for jshint anymore, eslint is run on command
line
This commit is contained in:
parent
b0541500b4
commit
a89241f0b9
2 changed files with 1 additions and 25 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue