Skip to content

Commit

Permalink
Update analyzeJsFile function to just userPlugins rather than passi…
Browse files Browse the repository at this point in the history
…ng in config
  • Loading branch information
Mikek2252 committed Aug 26, 2022
1 parent ef05baf commit aa6272e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Expand Up @@ -200,7 +200,7 @@ async function analyzeFile(cwd, file, options) {
let extension = path.extname(file).toLowerCase();

if (['.js', ...options.userExtensions].includes(extension)) {
return analyzeJsFile(content, options);
return analyzeJsFile(content, options.userPlugins);
} else if (extension === '.hbs') {
return analyzeHbsFile(content, options);
} else if (extension === '.emblem') {
Expand All @@ -211,13 +211,13 @@ async function analyzeFile(cwd, file, options) {
}
}

async function analyzeJsFile(content, config) {
async function analyzeJsFile(content, userPlugins) {
let translationKeys = new Set();

// parse the JS file
let ast = BabelParser.parse(content, {
sourceType: 'module',
plugins: ['decorators-legacy', 'dynamicImport', 'classProperties', ...config.userPlugins],
plugins: ['decorators-legacy', 'dynamicImport', 'classProperties', ...userPlugins],
});

// find translation keys in the syntax tree
Expand Down

0 comments on commit aa6272e

Please sign in to comment.