From 12d210e8d1041834c592e3375fed94a4ed5b344a Mon Sep 17 00:00:00 2001 From: Taimoor Khan Date: Tue, 5 Dec 2023 22:40:52 +0500 Subject: [PATCH] :recycle: upgraded --- scripts/.svgrrc-color.js | 1 + scripts/svgr-template.js | 4 ++-- src/styled-app.tsx | 10 ++-------- src/styled.ts | 5 ++--- tsconfig.build.json | 2 +- tsconfig.json | 2 +- 6 files changed, 9 insertions(+), 15 deletions(-) diff --git a/scripts/.svgrrc-color.js b/scripts/.svgrrc-color.js index 1d52520f..d2d1f1dc 100644 --- a/scripts/.svgrrc-color.js +++ b/scripts/.svgrrc-color.js @@ -1,6 +1,7 @@ module.exports = { icon: true, svgoConfig: { + typescript: true, plugins: [ { name: 'removeViewBox', diff --git a/scripts/svgr-template.js b/scripts/svgr-template.js index 7febef9f..79e63fba 100644 --- a/scripts/svgr-template.js +++ b/scripts/svgr-template.js @@ -9,7 +9,7 @@ const ${variables.componentName} = (${variables.props}) => ( ); ${variables.exports}; -` -} +`; +}; module.exports = template; diff --git a/src/styled-app.tsx b/src/styled-app.tsx index 6257cafe..55ca6edf 100644 --- a/src/styled-app.tsx +++ b/src/styled-app.tsx @@ -1,12 +1,11 @@ -import { ITheme } from '@react-pakistan/util-functions'; import * as React from 'react'; -import styled, { ThemeProvider, ThemedStyledProps } from 'styled-components'; +import styled, { ThemeProvider } from 'styled-components'; import { MiscColor1 } from './misc-color'; import { logoTheme } from './theme'; export const StyledApp = styled.div` display: inline-block; - font-family: ${({ theme } : ThemedStyledProps<{}, ITheme>) : string => theme.typography.fontFamily}; + font-family: ${({ theme }) : string => theme.typography.fontFamily}; width: 100%; *, *::before, @@ -21,8 +20,3 @@ export const StyledStory = ({ children } : { children : React.ReactNode }) => ( ); - -// Due to our `typedef` rule, this type is needed as a helper. -// Actually, by using helpers exported above, styled-components-props -// can be calculated automatically by tsc already. -export type WithTheme

= ThemedStyledProps; diff --git a/src/styled.ts b/src/styled.ts index fca43abc..ec12d5b6 100644 --- a/src/styled.ts +++ b/src/styled.ts @@ -1,6 +1,5 @@ -import { ITheme } from '@react-pakistan/util-functions'; import { SVGProps } from 'react'; -import styled, { ThemedStyledProps } from 'styled-components'; +import styled from 'styled-components'; export const LogoWrapper = styled.div` display: flex; @@ -8,7 +7,7 @@ export const LogoWrapper = styled.div` `; export const LogoTextWrapper = styled.div` - color: ${({ theme } : ThemedStyledProps<{}, ITheme>) : string => theme.colors.white}; + color: ${({ theme }) : string => theme.colors.white}; font-size: 0.75em; margin-top: 0.75em; `; diff --git a/tsconfig.build.json b/tsconfig.build.json index f23e2331..25d43955 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -3,7 +3,7 @@ "outDir": "./lib", "target": "es5", "module": "commonjs", - "noImplicitAny": true, + "noImplicitAny": false, "strictNullChecks": true, "noUnusedLocals": true, "skipLibCheck": true, diff --git a/tsconfig.json b/tsconfig.json index cfa97a9f..e1ad3395 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "noImplicitAny": false, + "noImplicitAny": true, "strictNullChecks": false, "skipLibCheck": true, "noUnusedLocals": true,