mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
feat(tools): allow tsx tabs (#61936)
Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
This commit is contained in:
@@ -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}`;
|
||||
|
||||
Reference in New Issue
Block a user