Skip to content

Commit d8005c4

Browse files
committedMar 29, 2023
Load plugins when running linting commands.
Close #705.
1 parent 8587639 commit d8005c4

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed
 

‎CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ Prefix your message with one of the following:
1111
- [Security] in case of vulnerabilities.
1212
-->
1313

14+
## Unreleased
15+
16+
- [Fixed] Load plugins when running `i18n lint:*` commands.
17+
1418
## v4.2.2 - Dec 30, 2022
1519

1620
- [Changed] Do not re-export files whose contents haven't changed.

‎lib/i18n-js/cli/lint_scripts_command.rb

+2
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ class LintScriptsCommand < Command
8080
end
8181

8282
config = load_config_file(config_file)
83+
I18nJS.load_plugins!
84+
I18nJS.initialize_plugins!(config: config)
8385
Schema.validate!(config)
8486

8587
load_require_file!(require_file) if require_file

‎lib/i18n-js/cli/lint_translations_command.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ class LintTranslationsCommand < Command
6868
end
6969

7070
config = load_config_file(config_file)
71+
I18nJS.load_plugins!
72+
I18nJS.initialize_plugins!(config: config)
7173
Schema.validate!(config)
7274

7375
load_require_file!(require_file) if require_file
@@ -82,7 +84,7 @@ class LintTranslationsCommand < Command
8284
.map {|key| key.gsub(/^.*?\./, "") }
8385
end
8486

85-
default_locale_keys = mapping.delete(default_locale)
87+
default_locale_keys = mapping.delete(default_locale) || mapping
8688

8789
if ignored_keys.any?
8890
ui.stdout_print "=> Check #{options[:config_file].inspect} for " \

0 commit comments

Comments
 (0)
Please sign in to comment.