Resolve TS errors and warnings

TODO: Use StyleTree types to remove `any`s from styleTrees.
This commit is contained in:
Nate Butler
2023-06-28 17:54:36 -04:00
parent 1177980172
commit bfdd0824e2
53 changed files with 224 additions and 1010 deletions
+3 -3
View File
@@ -218,9 +218,9 @@ function buildStyleSet(
ramp: Scale,
backgroundBase: number,
foregroundBase: number,
step: number = 0.08
step = 0.08
): StyleSet {
let styleDefinitions = buildStyleDefinition(
const styleDefinitions = buildStyleDefinition(
backgroundBase,
foregroundBase,
step
@@ -255,7 +255,7 @@ function buildStyleSet(
function buildStyleDefinition(
bgBase: number,
fgBase: number,
step: number = 0.08
step = 0.08
) {
return {
background: {
+6 -6
View File
@@ -6,8 +6,8 @@ import {
} from "./themeConfig"
export function colorRamp(color: Color): Scale {
let endColor = color.desaturate(1).brighten(5)
let startColor = color.desaturate(1).darken(4)
const endColor = color.desaturate(1).brighten(5)
const startColor = color.desaturate(1).darken(4)
return chroma.scale([startColor, color, endColor]).mode("lab")
}
@@ -18,15 +18,15 @@ export function colorRamp(color: Color): Scale {
theme so that we don't modify the passed in ramps.
This combined with an error in the type definitions for chroma js means we have to cast the colors
function to any in order to get the colors back out from the original ramps.
* @param isLight
* @param colorRamps
* @returns
* @param isLight
* @param colorRamps
* @returns
*/
export function getRamps(
isLight: boolean,
colorRamps: ThemeConfigInputColors
): RampSet {
const ramps: RampSet = {} as any
const ramps: RampSet = {} as any // eslint-disable-line @typescript-eslint/no-explicit-any
const colorsKeys = Object.keys(colorRamps) as ThemeConfigInputColorsKeys[]
if (isLight) {
+1 -1
View File
@@ -56,7 +56,7 @@ export interface Syntax {
// == Types ====== /
// We allow Function here because all JS objects literals have this property
constructor: SyntaxHighlightStyle | Function
constructor: SyntaxHighlightStyle | Function // eslint-disable-line @typescript-eslint/ban-types
variant: SyntaxHighlightStyle
type: SyntaxHighlightStyle
// js: predefined_type