Skip to content

Commit cb555e1

Browse files
committed
make UserConfig nullable
1 parent 6bdba04 commit cb555e1

18 files changed

+24
-21
lines changed

packages/@tailwindcss-upgrade/src/codemods/css/migrate-at-apply.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function migrateAtApply({
99
userConfig,
1010
}: {
1111
designSystem: DesignSystem
12-
userConfig: Config
12+
userConfig: Config | null
1313
}): Plugin {
1414
function migrate(atRule: AtRule) {
1515
let utilities = atRule.params.split(/(\s+)/)

packages/@tailwindcss-upgrade/src/codemods/css/migrate-media-screen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export function migrateMediaScreen({
1010
userConfig,
1111
}: {
1212
designSystem?: DesignSystem
13-
userConfig?: Config
13+
userConfig?: Config | null
1414
} = {}): Plugin {
1515
function migrate(root: Root) {
1616
if (!designSystem || !userConfig) return

packages/@tailwindcss-upgrade/src/codemods/css/migrate-preflight.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function migratePreflight({
3535
userConfig,
3636
}: {
3737
designSystem: DesignSystem
38-
userConfig?: Config
38+
userConfig?: Config | null
3939
}): Plugin {
4040
// @ts-expect-error
4141
let defaultBorderColor = userConfig?.theme?.borderColor?.DEFAULT

packages/@tailwindcss-upgrade/src/codemods/css/migrate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { migrateVariantsDirective } from './migrate-variants-directive'
1717
export interface MigrateOptions {
1818
newPrefix: string | null
1919
designSystem: DesignSystem
20-
userConfig: Config
20+
userConfig: Config | null
2121
configFilePath: string
2222
jsConfigMigration: JSConfigMigration | null
2323
}

packages/@tailwindcss-upgrade/src/codemods/template/migrate-arbitrary-value-to-bare-value.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { printCandidate } from './candidates'
77

88
export function migrateArbitraryValueToBareValue(
99
designSystem: DesignSystem,
10-
_userConfig: Config,
10+
_userConfig: Config | null,
1111
rawCandidate: string,
1212
): string {
1313
for (let candidate of parseCandidate(rawCandidate, designSystem)) {

packages/@tailwindcss-upgrade/src/codemods/template/migrate-automatic-var-injection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { printCandidate } from './candidates'
66

77
export function migrateAutomaticVarInjection(
88
designSystem: DesignSystem,
9-
_userConfig: Config,
9+
_userConfig: Config | null,
1010
rawCandidate: string,
1111
): string {
1212
for (let readonlyCandidate of designSystem.parseCandidate(rawCandidate)) {

packages/@tailwindcss-upgrade/src/codemods/template/migrate-bg-gradient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const DIRECTIONS = ['t', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl']
66

77
export function migrateBgGradient(
88
designSystem: DesignSystem,
9-
_userConfig: Config,
9+
_userConfig: Config | null,
1010
rawCandidate: string,
1111
): string {
1212
for (let candidate of designSystem.parseCandidate(rawCandidate)) {

packages/@tailwindcss-upgrade/src/codemods/template/migrate-handle-empty-arbitrary-values.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { DesignSystem } from '../../../../tailwindcss/src/design-system'
33

44
export function migrateEmptyArbitraryValues(
55
designSystem: DesignSystem,
6-
_userConfig: Config,
6+
_userConfig: Config | null,
77
rawCandidate: string,
88
): string {
99
// We can parse the candidate, nothing to do

packages/@tailwindcss-upgrade/src/codemods/template/migrate-important.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { isSafeMigration } from './is-safe-migration'
1818
// flex! md:block!
1919
export function migrateImportant(
2020
designSystem: DesignSystem,
21-
_userConfig: Config,
21+
_userConfig: Config | null,
2222
rawCandidate: string,
2323
location?: {
2424
contents: string

packages/@tailwindcss-upgrade/src/codemods/template/migrate-legacy-arbitrary-values.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { printCandidate } from './candidates'
66

77
export function migrateLegacyArbitraryValues(
88
designSystem: DesignSystem,
9-
_userConfig: Config,
9+
_userConfig: Config | null,
1010
rawCandidate: string,
1111
): string {
1212
for (let candidate of parseCandidate(rawCandidate, designSystem)) {

0 commit comments

Comments
 (0)