Skip to content

Commit 700dfbe

Browse files
committed
Move Config construction outside of transform() function
1 parent 02745c5 commit 700dfbe

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

transforms/angle-brackets/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,7 @@ const shouldSkipFile = (fileInfo, config) => {
246246
* @param options
247247
* @returns {undefined}
248248
*/
249-
function transform(fileInfo, api, options) {
250-
const config = new Config(options);
251-
249+
function transform(fileInfo, api, config) {
252250
if (shouldSkipFile(fileInfo, config)) {
253251
return fileInfo.source;
254252
}
@@ -522,7 +520,9 @@ function transform(fileInfo, api, options) {
522520

523521
module.exports = function(file, api) {
524522
try {
525-
return transform(file, api, getOptions());
523+
let options = getOptions();
524+
let config = new Config(options);
525+
return transform(file, api, config);
526526
} catch (e) {
527527
throw new Error(
528528
`Transformation errored on file ${file.path}. Reason ${e}. Please report this in https://github.com/ember-codemods/ember-angle-brackets-codemod/issues\n\nStack trace:\n${e.stack}`

0 commit comments

Comments
 (0)