Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Numeric Separator Support for TypeScript (#11308)
* Add Numeric Separator Support for TypeScript * Check for number in render
- Loading branch information
Showing
7 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
test/integration/typescript-numeric-sep-exclusive/pages/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default () => `hello ${1_000}` |
22 changes: 22 additions & 0 deletions
22
test/integration/typescript-numeric-sep-exclusive/test/index.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* eslint-env jest */ | ||
/* global jasmine */ | ||
import { nextBuild } from 'next-test-utils' | ||
import { join } from 'path' | ||
|
||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 2 | ||
|
||
const appDir = join(__dirname, '../') | ||
|
||
describe('TypeScript Exclusivity of Numeric Separator', () => { | ||
it('should fail to build for a JavaScript file', async () => { | ||
const { code, stderr } = await nextBuild(appDir, [], { | ||
stderr: true, | ||
}) | ||
|
||
expect(code).toBe(1) | ||
|
||
expect(stderr).toContain('Failed to compile.') | ||
expect(stderr).toContain('SyntaxError:') | ||
expect(stderr).toContain('Identifier directly after number') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters