2022-09-01 22:15:54 +00:00
|
|
|
#!/usr/bin/env node
|
2023-03-15 16:00:52 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
*/
|
|
|
|
|
2022-09-01 22:15:54 +00:00
|
|
|
/* eslint-env node */
|
|
|
|
|
|
|
|
// print to console all files that include LinkTo elements using the {{on modifier}}
|
|
|
|
module.exports = (env) => {
|
|
|
|
let fileAlerted;
|
|
|
|
return {
|
|
|
|
ElementNode(node) {
|
|
|
|
if (node.tag === 'LinkTo') {
|
|
|
|
if (!fileAlerted) {
|
|
|
|
const usesModifier = node.modifiers.find((modifier) => modifier.path.original === 'on');
|
|
|
|
if (usesModifier) {
|
|
|
|
console.log(env.filePath); // eslint-disable-line
|
|
|
|
fileAlerted = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|