mirror of
https://github.com/honojs/hono.git
synced 2024-11-21 18:18:57 +01:00
chore(eslint): enable @typescript-eslint/unbound-method
(#2622)
* chore(eslint): enable `@typescript-eslint/unbound-method` * denoify
This commit is contained in:
parent
cb2416042c
commit
0fafd7aa8b
1
.eslintignore
Normal file
1
.eslintignore
Normal file
@ -0,0 +1 @@
|
||||
.eslintrc.cjs
|
@ -1,3 +1,9 @@
|
||||
module.exports = {
|
||||
extends: ['@hono/eslint-config'],
|
||||
rules: {
|
||||
'@typescript-eslint/unbound-method': 'error',
|
||||
},
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json', './runtime_tests/tsconfig.json'],
|
||||
},
|
||||
}
|
||||
|
@ -101,6 +101,7 @@ export const createCssContext = ({ id }: { id: Readonly<string> }) => {
|
||||
;(className as HtmlEscapedString).callbacks = [addClassNameToContext]
|
||||
const promise = Promise.resolve(className)
|
||||
Object.assign(promise, cssClassName)
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
promise.toString = cssJsxDomObject.toString
|
||||
return promise
|
||||
}
|
||||
|
@ -133,6 +133,7 @@ export const createCssContext = ({ id }: { id: Readonly<string> }) => {
|
||||
const [cssObject, Style] = createCssJsxDomObjects({ id })
|
||||
|
||||
const newCssClassNameObject = (cssClassName: CssClassName): string => {
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
cssClassName.toString = cssObject.toString
|
||||
return cssClassName as unknown as string
|
||||
}
|
||||
|
7
runtime_tests/tsconfig.json
Normal file
7
runtime_tests/tsconfig.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"include": [
|
||||
"**/*.ts",
|
||||
"**/*.tsx"
|
||||
]
|
||||
}
|
@ -101,6 +101,7 @@ export const createCssContext = ({ id }: { id: Readonly<string> }) => {
|
||||
;(className as HtmlEscapedString).callbacks = [addClassNameToContext]
|
||||
const promise = Promise.resolve(className)
|
||||
Object.assign(promise, cssClassName)
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
promise.toString = cssJsxDomObject.toString
|
||||
return promise
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/unbound-method */
|
||||
import { beforeEach, describe, expect, it } from 'vitest'
|
||||
import { Hono } from '../../hono'
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
|
@ -133,6 +133,7 @@ export const createCssContext = ({ id }: { id: Readonly<string> }) => {
|
||||
const [cssObject, Style] = createCssJsxDomObjects({ id })
|
||||
|
||||
const newCssClassNameObject = (cssClassName: CssClassName): string => {
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
cssClassName.toString = cssObject.toString
|
||||
return cssClassName as unknown as string
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user