diff --git a/src/lib/types.ts b/src/lib/types.ts index 23cf4d5c..13083dd1 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -43,7 +43,7 @@ export interface Config { * A class group ID is the key of a class group in classGroups object. * @example { 'font-size': ['leading'] } */ - conflictingClassGroupModifiers?: Record + conflictingClassGroupModifiers: Record } export type ThemeObject = Record diff --git a/tests/create-tailwind-merge.test.ts b/tests/create-tailwind-merge.test.ts index 594ec061..1c34716e 100644 --- a/tests/create-tailwind-merge.test.ts +++ b/tests/create-tailwind-merge.test.ts @@ -14,6 +14,7 @@ test('createTailwindMerge works with single config function', () => { fooKey: ['otherKey'], otherKey: ['fooKey', 'fooKey2'], }, + conflictingClassGroupModifiers: {}, })) expect(tailwindMerge('')).toBe('') @@ -54,6 +55,7 @@ test('createTailwindMerge works with multiple config functions', () => { fooKey: ['otherKey'], otherKey: ['fooKey', 'fooKey2'], }, + conflictingClassGroupModifiers: {}, }), (config) => ({ ...config, diff --git a/tests/merge-configs.test.ts b/tests/merge-configs.test.ts index b544a7b2..5430db07 100644 --- a/tests/merge-configs.test.ts +++ b/tests/merge-configs.test.ts @@ -14,6 +14,9 @@ test('mergeConfigs has correct behavior', () => { bla: [{ bli: ['blub', 'blublub'] }], }, conflictingClassGroups: {}, + conflictingClassGroupModifiers: { + hello: ['world'], + }, }, { classGroups: { @@ -25,6 +28,9 @@ test('mergeConfigs has correct behavior', () => { fooKey: ['otherKey'], otherKey: ['fooKey', 'fooKey2'], }, + conflictingClassGroupModifiers: { + hello: ['world2'], + }, }, ), ).toEqual({ @@ -43,5 +49,8 @@ test('mergeConfigs has correct behavior', () => { fooKey: ['otherKey'], otherKey: ['fooKey', 'fooKey2'], }, + conflictingClassGroupModifiers: { + hello: ['world', 'world2'], + }, }) }) diff --git a/tests/public-api.test.ts b/tests/public-api.test.ts index 49253129..c9a8eaa9 100644 --- a/tests/public-api.test.ts +++ b/tests/public-api.test.ts @@ -88,6 +88,7 @@ test('createTailwindMerge() has correct inputs and outputs', () => { theme: {}, classGroups: {}, conflictingClassGroups: {}, + conflictingClassGroupModifiers: {}, })), ).toStrictEqual(expect.any(Function)) @@ -104,6 +105,7 @@ test('createTailwindMerge() has correct inputs and outputs', () => { fooKey: ['otherKey'], otherKey: ['fooKey', 'fooKey2'], }, + conflictingClassGroupModifiers: {}, })) expect(tailwindMerge).toStrictEqual(expect.any(Function)) @@ -165,6 +167,7 @@ test('mergeConfigs has correct inputs and outputs', () => { bla: [{ bli: ['blub', 'blublub'] }], }, conflictingClassGroups: {}, + conflictingClassGroupModifiers: {}, }, {}, ),