Skip to content

Commit

Permalink
Merge pull request #20032 from storybookjs/chore/always-use-ts-legacy…
Browse files Browse the repository at this point in the history
…-templates
  • Loading branch information
kasperpeulen authored Nov 30, 2022
2 parents 926c574 + d0e5eb1 commit 0591b61
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions code/lib/cli/src/detect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,19 +296,22 @@ describe('Detect', () => {

it(`should return language typescript if the dependency is >TS4.9`, () => {
expect(detectLanguage({ dependencies: { typescript: '4.9.1' } })).toBe(
SupportedLanguage.TYPESCRIPT
// TODO: switch to TYPESCRIPT once csf-tools and eslint-plugin-storybook support `satisfies` operator
SupportedLanguage.TYPESCRIPT_LEGACY
);
});

it(`should return language typescript if the dependency is =TS4.9`, () => {
expect(detectLanguage({ dependencies: { typescript: '4.9.0' } })).toBe(
SupportedLanguage.TYPESCRIPT
// TODO: switch to TYPESCRIPT once csf-tools and eslint-plugin-storybook support `satisfies` operator
SupportedLanguage.TYPESCRIPT_LEGACY
);
});

it(`should return language typescript if the dependency is =TS4.9beta`, () => {
expect(detectLanguage({ dependencies: { typescript: '^4.9.0-beta' } })).toBe(
SupportedLanguage.TYPESCRIPT
// TODO: switch to TYPESCRIPT once csf-tools and eslint-plugin-storybook support `satisfies` operator
SupportedLanguage.TYPESCRIPT_LEGACY
);
});

Expand Down
3 changes: 2 additions & 1 deletion code/lib/cli/src/detect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ export function detectLanguage(packageJson?: PackageJson) {
semver.gte(semver.coerce(version), '5.44.0')
))
) {
language = SupportedLanguage.TYPESCRIPT;
// TODO: switch to TYPESCRIPT once csf-tools and eslint-plugin-storybook support `satisfies` operator
language = SupportedLanguage.TYPESCRIPT_LEGACY;
} else if (hasDependency(packageJson, 'typescript')) {
language = SupportedLanguage.TYPESCRIPT_LEGACY;
}
Expand Down

0 comments on commit 0591b61

Please sign in to comment.