diff --git a/package-lock.json b/package-lock.json index 59665fa..0ec5c18 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,7 +41,7 @@ "sass": "^1.57.1", "storybook": "^7.6.14", "style-dictionary": "^3.7.2", - "typescript": "^4.9.4", + "typescript": "^5.3.3", "webpack": "^5.75.0" }, "peerDependencies": { @@ -15984,16 +15984,16 @@ "dev": true }, "node_modules/typescript": { - "version": "4.9.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", - "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/ufo": { @@ -28591,9 +28591,9 @@ "dev": true }, "typescript": { - "version": "4.9.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", - "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", "dev": true }, "ufo": { diff --git a/package.json b/package.json index ec1642b..0e433cc 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "sass": "^1.57.1", "storybook": "^7.6.14", "style-dictionary": "^3.7.2", - "typescript": "^4.9.4", + "typescript": "^5.3.3", "webpack": "^5.75.0" }, "peerDependencies": { diff --git a/src/TokenEditor.tsx b/src/TokenEditor.tsx index ef777f2..d199c94 100644 --- a/src/TokenEditor.tsx +++ b/src/TokenEditor.tsx @@ -69,22 +69,21 @@ const reducer = (state: TokenEditorState, action: ReducerAction): TokenEditorSta }; const toStyleDictValues = (values: ValueMap): StyleDictValueMap => { - let styleDictValues = {} satisfies StyleDictValueMap; + let styleDictValues: StyleDictValueMap = {}; values.forEach((value, tokenPathBits) => { if (value === '') return; - let parent = styleDictValues; - // deep assign for each bit in tokenPathBits + let parent = styleDictValues; for (const bit of tokenPathBits) { if (!parent[bit]) { parent[bit] = {}; } - parent = parent[bit]; + // a lie for the last iteration, but we correct it later + parent = parent[bit] as StyleDictValueMap; } - - (parent as StyleDictValue).value = value; + (parent as unknown as StyleDictValue).value = value; }); return styleDictValues; diff --git a/src/TokenFilter.tsx b/src/TokenFilter.tsx index 564e1c4..e48ad16 100644 --- a/src/TokenFilter.tsx +++ b/src/TokenFilter.tsx @@ -102,7 +102,7 @@ export const applyFilters = ( ): DesignTokenContainer => { if (!filterEnabled) return container; - const filteredContainer = {}; + const filteredContainer: TopLevelContainer = {}; Object.entries(container).forEach(([key, nested]) => { if (key === '$extensions') { filteredContainer[key] = nested; diff --git a/tsconfig.json b/tsconfig.json index 1c425ed..6d419e7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,7 +14,6 @@ "noImplicitThis": true, "noImplicitAny": true, "strictNullChecks": true, - "suppressImplicitAnyIndexErrors": true, "allowSyntheticDefaultImports": true }, "include": ["src"],