Commit 8f324602 authored by Stan Hu's avatar Stan Hu

Fix inline JavaScript HAML linter not working

In https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/28570, we
moved the `haml_lint` directory out of an auto-load path to avoid a
startup failure in production
(https://gitlab.com/gitlab-org/gitlab-foss/-/issues/62125). However,
`inline_javascript.rb` used `require_dependency`, which is meant for
auto-loading and should not be mixed with `require`. As a result, the
linter registry was being reset twice: once for the `require_dependency`
call and once for the `require` call. This effectively dropped the
inline JavaScript linter.

Closes https://gitlab.com/gitlab-org/gitlab/-/issues/342479

Changelog: fixed
parent ed4ed51a
# frozen_string_literal: true
unless Rails.env.production?
require_dependency 'haml_lint/haml_visitor'
require_dependency 'haml_lint/linter'
require_dependency 'haml_lint/linter_registry'
require 'haml_lint/haml_visitor'
require 'haml_lint/linter'
require 'haml_lint/linter_registry'
module HamlLint
class Linter::InlineJavaScript < Linter
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment