feat(tools): allow tsx tabs (#61936)

Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
This commit is contained in:
Anna
2025-09-12 14:16:37 -04:00
committed by GitHub
parent 28411a2cec
commit ee05b0d5da
8 changed files with 26 additions and 5 deletions
@@ -195,7 +195,7 @@ describe('add-seed plugin', () => {
expect.assertions(1);
expect(() => plugin(cCodeAST, file)).toThrow(
"On line 30 'c' is not a supported language.\n" +
' Please use one of js, css, html, jsx or py'
' Please use one of js, css, html, jsx, ts, tsx or py'
);
});
@@ -8,7 +8,7 @@ const keyToSection = {
head: 'before-user-code',
tail: 'after-user-code'
};
const supportedLanguages = ['js', 'css', 'html', 'jsx', 'py', 'ts'];
const supportedLanguages = ['js', 'css', 'html', 'jsx', 'py', 'ts', 'tsx'];
const longToShortLanguages = {
javascript: 'js',
typescript: 'ts',
@@ -54,7 +54,7 @@ function codeToData(node, seeds, seedKey, validate) {
throw Error(`On line ${
position.start(node).line
} '${shortLang}' is not a supported language.
Please use one of js, css, html, jsx or py
Please use one of js, css, html, jsx, ts, tsx or py
`);
const fileId = `index${shortLang}`;