Skip to content

Commit

Permalink
feat(types): Jsx
Browse files Browse the repository at this point in the history
Signed-off-by: Lexus Drumgold <[email protected]>
  • Loading branch information
unicornware committed Nov 27, 2022
1 parent 1382bdd commit 04d1fdb
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 45 deletions.
1 change: 1 addition & 0 deletions .dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ gpgsign
graphqlrc
hmarr
iife
jsxdev
keyid
larsgw
lcov
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@
"vite": "3.2.4",
"vite-tsconfig-paths": "3.6.0",
"vitest": "0.25.3",
"vitest-github-actions-reporter": "0.9.0",
"yaml-eslint-parser": "1.1.0"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
* @module tsconfig-types
*/

export {}
export * from './types'
28 changes: 28 additions & 0 deletions src/types/__tests__/jsx.spec-d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* @file Unit Tests - Jsx
* @module tsconfig-types/types/tests/Jsx
*/

import type TestSubject from '../jsx'

describe('unit:types/Jsx', () => {
it('should allow "preserve"', () => {
assertType<TestSubject>('preserve')
})

it('should allow "react-jsx"', () => {
assertType<TestSubject>('react-jsx')
})

it('should allow "react-jsxdev"', () => {
assertType<TestSubject>('react-jsxdev')
})

it('should allow "react-native"', () => {
assertType<TestSubject>('react-native')
})

it('should allow "react"', () => {
assertType<TestSubject>('react')
})
})
6 changes: 6 additions & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* @file Entry Point - Type Definitions
* @module tsconfig-types/types
*/

export type { default as Jsx } from './jsx'
13 changes: 13 additions & 0 deletions src/types/jsx.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* @file Type Definitions - Jsx
* @module tsconfig-types/types/Jsx
*/

/**
* Controls how JSX constructs are emitted in JavaScript files.
*
* @see https://www.typescriptlang.org/tsconfig#jsx
*/
type Jsx = 'preserve' | 'react-jsx' | 'react-jsxdev' | 'react-native' | 'react'

export type { Jsx as default }
7 changes: 2 additions & 5 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { NodeEnv } from '@flex-development/tutils'
import ci from 'is-ci'
import path from 'node:path'
import tsconfigpaths from 'vite-tsconfig-paths'
import GithubActionsReporter from 'vitest-github-actions-reporter'
import {
defineConfig,
type UserConfig,
Expand Down Expand Up @@ -53,14 +52,12 @@ const config: UserConfigExport = defineConfig((): UserConfig => {
include: ['**/__tests__/*.spec.ts', '**/__tests__/*.spec-d.ts'],
isolate: true,
mockReset: true,
outputFile: {
json: './__tests__/report.json'
},
outputFile: { json: './__tests__/report.json' },
passWithNoTests: true,
reporters: [
'json',
'verbose',
ci ? new GithubActionsReporter() : './__tests__/reporters/notifier.ts'
!ci ? './__tests__/reporters/notifier.ts' : ''
],
/**
* Stores snapshots next to `file`'s directory.
Expand Down
38 changes: 0 additions & 38 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,6 @@ __metadata:
version: 7
cacheKey: 9

"@actions/core@npm:^1.10.0":
version: 1.10.0
resolution: "@actions/core@npm:1.10.0"
dependencies:
"@actions/http-client": "npm:^2.0.1"
uuid: "npm:^8.3.2"
checksum: 61bceec8b8f233da0b678f011e2ce6f1e46de7493d0c9eafbcbff45c46451fb714bd84be9bcc71b0813eab4bca5bc41063ba787eefccea3ed59c1c69e9841f7a
languageName: node
linkType: hard

"@actions/http-client@npm:^2.0.1":
version: 2.0.1
resolution: "@actions/http-client@npm:2.0.1"
dependencies:
tunnel: "npm:^0.0.6"
checksum: 855409b15276e888e656d9970f3662c11c0db95b5e018dbdc1be24f33144f8536b87d22ce6ec2c2d099442d27cee3b1c9d38f9d1366abe48607062beb2d2f168
languageName: node
linkType: hard

"@ardatan/sync-fetch@larsgw/sync-fetch#head=worker_threads":
version: 0.3.1
resolution: "@ardatan/sync-fetch@https://github.com/larsgw/sync-fetch.git#commit=3fb71aeed5ff6655421064c4e4b234f524896cd2"
Expand Down Expand Up @@ -927,7 +908,6 @@ __metadata:
vite: "npm:3.2.4"
vite-tsconfig-paths: "npm:3.6.0"
vitest: "npm:0.25.3"
vitest-github-actions-reporter: "npm:0.9.0"
yaml-eslint-parser: "npm:1.1.0"
peerDependencies:
"@flex-development/tutils": ">=6.0.0-alpha.2"
Expand Down Expand Up @@ -7930,13 +7910,6 @@ __metadata:
languageName: node
linkType: hard

"tunnel@npm:^0.0.6":
version: 0.0.6
resolution: "tunnel@npm:0.0.6"
checksum: 4b6009e1ed9c1857d58462867cd731f4af255c0406fc982dd0a17735c5c991293bc57a8c0957c5f51dfc3778baa280e399d3e05f1ca4aaf7442349c529b7c89d
languageName: node
linkType: hard

"type-check@npm:^0.4.0, type-check@npm:~0.4.0":
version: 0.4.0
resolution: "type-check@npm:0.4.0"
Expand Down Expand Up @@ -8277,17 +8250,6 @@ __metadata:
languageName: node
linkType: hard

"vitest-github-actions-reporter@npm:0.9.0":
version: 0.9.0
resolution: "vitest-github-actions-reporter@npm:0.9.0"
dependencies:
"@actions/core": "npm:^1.10.0"
peerDependencies:
vitest: ">=0.16.0"
checksum: 02606397a535c898526fa3e282c5c48878ffffa953a702386cd1c7f486e38b2c6f39db1df85aadeb5617969074bb2b2179049584f07922a5cf347a89029dfd7c
languageName: node
linkType: hard

"vitest@npm:0.25.3":
version: 0.25.3
resolution: "vitest@npm:0.25.3"
Expand Down

0 comments on commit 04d1fdb

Please sign in to comment.