Skip to content

Commit

Permalink
Do not ignore no-explicit-any globally
Browse files Browse the repository at this point in the history
  • Loading branch information
catuhana committed Jul 19, 2024
1 parent 739ab8e commit e6fe3a1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 0 additions & 3 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
"singleQuote": true
},
"lint": {
"rules": {
"exclude": ["no-explicit-any"]
},
"exclude": ["npm/"]
}
}
8 changes: 6 additions & 2 deletions src/extend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ import type { ExtendOptions } from './types.ts';
/**
* Extend theme to UnoCSS by using `extendTheme` function.
*/
export const _extendTheme = (
export const _extendTheme = <Theme extends object = object>(
options: ExtendOptions = {},
): (theme: any) => void => {
): (theme: Theme) => void => {
const { prefix = 'ctp', defaultFlavour } = options;

//* We don't know what `theme` could be, since it's provided to us
//* by UnoCSS. I think we could type-safe the parts we have
//* (`ThemeObject` type), but I'm not sure how to do that.
// deno-lint-ignore no-explicit-any
const extendTheme = (theme: any): void => {
theme['colors'] ??= {};

Expand Down
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// TODO: Don't allow `no-explicit-any` after implementing `Theme` type.

import { _extendTheme } from './extend.ts';

import type { Preset } from '@unocss/core';
Expand Down

0 comments on commit e6fe3a1

Please sign in to comment.