mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: JSHint wasn't validating ES6 files, this fixes a bunch of errors.
This commit is contained in:
parent
d5712e43cf
commit
cf3582bedb
25 changed files with 9410 additions and 57913 deletions
|
@ -99,8 +99,16 @@ module Tilt
|
|||
|
||||
# Include JS code for JSHint
|
||||
unless Rails.env.production?
|
||||
req_path = "/assets/#{scope.logical_path}.js"
|
||||
@output << "\nwindow.__jshintSrc = window.__jshintSrc || {}; window.__jshintSrc['#{req_path}'] = #{source.to_json};\n"
|
||||
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.__jshintSrc = window.__jshintSrc || {}; window.__jshintSrc['#{req_path}'] = #{data.to_json};\n"
|
||||
end
|
||||
|
||||
@output
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue