Skip to content

Commit

Permalink
fix: use exactOptionalPropertyTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
DerYeger committed Aug 7, 2024
1 parent c6608e2 commit bbfd0fa
Show file tree
Hide file tree
Showing 16 changed files with 46 additions and 40 deletions.
11 changes: 11 additions & 0 deletions .changeset/two-badgers-lick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'vue-persistent-storage-manager': patch
'@yeger/vue-masonry-wall-core': patch
'@yeger/vue2-masonry-wall': patch
'@yeger/vue-masonry-wall': patch
'vite-plugin-lib': patch
'@yeger/turbo-graph-ui': patch
'@yeger/tsconfig': patch
---

use exactOptionalPropertyTypes
3 changes: 2 additions & 1 deletion docs/vue-masonry-wall-docs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"extends": "@yeger/tsconfig/vite",
"compilerOptions": {
"types": ["node", "vue"]
"types": ["node", "vue"],
"exactOptionalPropertyTypes": false
},
"exclude": ["node_modules", "coverage", "dist"]
}
2 changes: 2 additions & 0 deletions packages/tsconfig/base.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"allowJs": false,
"allowSyntheticDefaultImports": true,
"baseUrl": "${configDir}",
"declaration": false,
"esModuleInterop": true,
"exactOptionalPropertyTypes": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"importHelpers": true,
Expand Down
1 change: 1 addition & 0 deletions packages/tsconfig/cli.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "./base.json",
"compilerOptions": {
"declaration": false,
Expand Down
1 change: 1 addition & 0 deletions packages/tsconfig/lib.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "./base.json",
"compilerOptions": {
"sourceMap": true
Expand Down
1 change: 1 addition & 0 deletions packages/tsconfig/next.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "./web.json",
"compilerOptions": {
"noEmit": true,
Expand Down
1 change: 1 addition & 0 deletions packages/tsconfig/vite.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "./base.json",
"compilerOptions": {
"moduleResolution": "bundler",
Expand Down
1 change: 1 addition & 0 deletions packages/tsconfig/web.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "./base.json",
"compilerOptions": {
"sourceMap": false
Expand Down
2 changes: 1 addition & 1 deletion packages/turbo-graph-ui/components/Graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { FlowGraph } from './FlowGraph'

export interface GraphProps {
tasks: string[]
filter?: string
filter: string | undefined
}

export async function Graph({ tasks, filter }: GraphProps) {
Expand Down
2 changes: 1 addition & 1 deletion packages/turbo-graph-ui/components/GraphInputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type { GraphParameter } from '../lib/utils'
import { useGraphSettings } from '../lib/utils'

interface GraphInputProps {
defaultValue?: string
defaultValue?: string | undefined
}

interface GraphParameterInputProps extends GraphInputProps {
Expand Down
3 changes: 3 additions & 0 deletions packages/vite-plugin-lib/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "@yeger/tsconfig/lib",
"compilerOptions": {
"exactOptionalPropertyTypes": false
},
"exclude": ["node_modules", "coverage", "dist"]
}
11 changes: 0 additions & 11 deletions packages/vue-masonry-wall-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,6 @@ import type {
Watch,
} from '@yeger/vue-lib-adapter'

export interface ComponentProps<T> {
columnWidth?: number | NonEmptyArray<number>
items: T[]
gap?: number
rtl?: boolean
ssrColumns?: number
scrollContainer?: HTMLElement | null
minColumns?: number
maxColumns?: number
}

export type NonEmptyArray<T> = [T, ...T[]]

export type Column = number[]
Expand Down
22 changes: 10 additions & 12 deletions packages/vue-masonry-wall/src/masonry-wall.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts" generic="T">
import type { Column, NonEmptyArray } from '@yeger/vue-masonry-wall-core'
import { useMasonryWall } from '@yeger/vue-masonry-wall-core'
import type { Ref } from 'vue'
import type { Ref, VNode } from 'vue'
import { nextTick, onBeforeUnmount, onMounted, ref, toRefs, watch } from 'vue'
export type KeyMapper<T> = (
Expand All @@ -13,22 +13,20 @@ export type KeyMapper<T> = (
const props = withDefaults(
defineProps<{
columnWidth?: number | NonEmptyArray<number>
columnWidth?: number | NonEmptyArray<number> | undefined
items: T[]
gap?: number
rtl?: boolean
ssrColumns?: number
scrollContainer?: HTMLElement | null
minColumns?: number
maxColumns?: number
keyMapper?: KeyMapper<T>
gap?: number | undefined
rtl?: boolean | undefined
ssrColumns?: number | undefined
scrollContainer?: HTMLElement | null | undefined
minColumns?: number | undefined
maxColumns?: number | undefined
keyMapper?: KeyMapper<T> | undefined
}>(),
{
columnWidth: 400,
gap: 0,
keyMapper: undefined,
minColumns: 1,
maxColumns: undefined,
rtl: false,
scrollContainer: null,
ssrColumns: 0,
Expand All @@ -46,7 +44,7 @@ defineSlots<{
column: number
row: number
index: number
}) => any
}) => VNode
}>()
const columns = ref<Column[]>([])
Expand Down
5 changes: 1 addition & 4 deletions packages/vue-persistent-storage-manager/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ export class VuePersistentStorageManager {
/**
* Contains storage quota and usage information.
*/
public readonly storageEstimate: StorageEstimate = {
quota: undefined,
usage: undefined,
}
public readonly storageEstimate: StorageEstimate = {}

private _isPersistent = false

Expand Down
17 changes: 8 additions & 9 deletions packages/vue2-masonry-wall/src/masonry-wall.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,19 @@ export type KeyMapper<T> = (
const props = withDefaults(
defineProps<{
columnWidth?: number | NonEmptyArray<number>
columnWidth?: number | NonEmptyArray<number> | undefined
items: unknown[]
gap?: number
rtl?: boolean
ssrColumns?: number
scrollContainer?: HTMLElement | null
minColumns?: number
maxColumns?: number
keyMapper?: KeyMapper<unknown>
gap?: number | undefined
rtl?: boolean | undefined
ssrColumns?: number | undefined
scrollContainer?: HTMLElement | null | undefined
minColumns?: number | undefined
maxColumns?: number | undefined
keyMapper?: KeyMapper<unknown> | undefined
}>(),
{
columnWidth: 400,
gap: 0,
keyMapper: undefined,
minColumns: 1,
maxColumns: undefined,
rtl: false,
Expand Down
3 changes: 2 additions & 1 deletion packages/vue2-masonry-wall/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"extends": "@yeger/tsconfig/vite",
"compilerOptions": {
"types": ["node", "vue", "resize-observer-browser"]
"types": ["node", "vue", "resize-observer-browser"],
"exactOptionalPropertyTypes": false
},
"exclude": ["node_modules", "coverage", "dist"],
"vueCompilerOptions": {
Expand Down

0 comments on commit bbfd0fa

Please sign in to comment.