Skip to content

Commit 3bebf85

Browse files
suchitadoshi1987tylerturdenpants
authored andcommitted
Add skipAttributesThatMatchRegex to config (#234)
1 parent b07e9e8 commit 3bebf85

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

transforms/angle-brackets/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ function getOptions() {
1717
options.helpers = config.helpers;
1818
}
1919

20+
if (config.skipAttributesThatMatchRegex) {
21+
options.skipAttributesThatMatchRegex = config.skipAttributesThatMatchRegex;
22+
}
23+
2024
if (config.skipFilesThatMatchRegex) {
2125
options.skipFilesThatMatchRegex = new RegExp(config.skipFilesThatMatchRegex);
2226
}

transforms/angle-brackets/transform.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ test('skip-attributes', () => {
960960
skipAttributesThatMatchRegex: ['/data-/gim', '/aria-/gim'],
961961
};
962962

963-
expect(runTest('ignore-attributes.hbs', input, options)).toMatchInlineSnapshot(`
963+
expect(runTest('skip-attributes.hbs', input, options)).toMatchInlineSnapshot(`
964964
"
965965
<SomeComponent data-test-foo={{true}} aria-label=\\"bar\\" @foo={{true}} />
966966
"
@@ -976,7 +976,7 @@ test('skip-attributes with invalid regex', () => {
976976
skipAttributesThatMatchRegex: [null],
977977
};
978978

979-
expect(runTest('ignore-attributes.hbs', input, options)).toMatchInlineSnapshot(`
979+
expect(runTest('skip-attributes-invalid-regex.hbs', input, options)).toMatchInlineSnapshot(`
980980
"
981981
<SomeComponent @data-test-foo={{true}} @aria-label=\\"bar\\" @foo={{true}} />
982982
"

0 commit comments

Comments
 (0)