Skip to content

Commit

Permalink
Add IGNORE_LINES patterns for .js and es6
Browse files Browse the repository at this point in the history
Fixes #322
  • Loading branch information
glebm committed Mar 31, 2019
1 parent ae2af0f commit 792c194
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/i18n/tasks/scanners/pattern_scanner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ class PatternScanner < FileScanner

TRANSLATE_CALL_RE = /(?<=^|[^\w'\-.]|[^\w'\-]I18n\.|I18n\.)t(?:ranslate)?/
IGNORE_LINES = {
'opal' => /^\s*#(?!\si18n-tasks-use)/,
'haml' => /^\s*-\s*#(?!\si18n-tasks-use)/,
'slim' => %r{^\s*(?:-#|/)(?!\si18n-tasks-use)},
'coffee' => /^\s*#(?!\si18n-tasks-use)/,
'erb' => /^\s*<%\s*#(?!\si18n-tasks-use)/
'erb' => /^\s*<%\s*#(?!\si18n-tasks-use)/,
'es6' => %r{^\s*//(?!\si18n-tasks-use)},
'haml' => /^\s*-\s*#(?!\si18n-tasks-use)/,
'js' => %r{^\s*//(?!\si18n-tasks-use)},
'opal' => /^\s*#(?!\si18n-tasks-use)/,
'slim' => %r{^\s*(?:-#|/)(?!\si18n-tasks-use)}
}.freeze

def initialize(**args)
Expand Down

0 comments on commit 792c194

Please sign in to comment.