Skip to content

Commit

Permalink
chore: update lint rules (#183)
Browse files Browse the repository at this point in the history
* chore: update lint rules

* format
  • Loading branch information
yusukebe authored Jun 4, 2024
1 parent e6e4da8 commit 9139576
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 28 deletions.
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"hono": ">=4.*"
},
"devDependencies": {
"@hono/eslint-config": "^0.0.4",
"@hono/eslint-config": "^0.0.6",
"@mdx-js/rollup": "^3.0.0",
"@playwright/test": "^1.42.0",
"@types/babel__generator": "^7",
Expand Down
4 changes: 2 additions & 2 deletions src/client/client.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { render } from 'hono/jsx/dom'
import { jsx as jsxFn } from 'hono/jsx/dom/jsx-runtime'
import {
COMPONENT_NAME,
COMPONENT_EXPORT,
COMPONENT_NAME,
DATA_HONO_TEMPLATE,
DATA_SERIALIZED_PROPS,
} from '../constants.js'
import type {
CreateElement,
CreateChildren,
CreateElement,
Hydrate,
HydrateComponent,
TriggerHydration,
Expand Down
2 changes: 1 addition & 1 deletion src/client/runtime.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Suspense, use } from 'hono/jsx/dom'
import { COMPONENT_NAME, DATA_HONO_TEMPLATE, DATA_SERIALIZED_PROPS } from '../constants.js'
import type { CreateElement, CreateChildren, HydrateComponent } from '../types.js'
import type { CreateChildren, CreateElement, HydrateComponent } from '../types.js'

type ImportComponent = (name: string) => Promise<Function | undefined>
export const buildCreateChildrenFn = (
Expand Down
2 changes: 1 addition & 1 deletion src/server/server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { Hono } from 'hono'
import type { Env, NotFoundHandler, ErrorHandler, MiddlewareHandler } from 'hono'
import type { Env, ErrorHandler, MiddlewareHandler, NotFoundHandler } from 'hono'
import { createMiddleware } from 'hono/factory'
import type { H } from 'hono/types'
import { IMPORTING_ISLANDS_ID } from '../constants.js'
Expand Down
3 changes: 2 additions & 1 deletion src/vite/inject-importing-islands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import _generate from '@babel/generator'
import { parse } from '@babel/parser'
// @ts-expect-error `precinct` is not typed
import precinct from 'precinct'
import { normalizePath, type Plugin } from 'vite'
import { normalizePath } from 'vite'
import type { Plugin } from 'vite'
import { IMPORTING_ISLANDS_ID } from '../constants.js'
import { matchIslandComponentId } from './utils/path.js'

Expand Down
2 changes: 1 addition & 1 deletion src/vite/island-components.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from 'fs'
import os from 'os'
import path from 'path'
import { transformJsxTags, islandComponents } from './island-components.js'
import { islandComponents, transformJsxTags } from './island-components.js'

describe('transformJsxTags', () => {
it('Should add component-wrapper and component-name attribute', () => {
Expand Down
28 changes: 14 additions & 14 deletions src/vite/island-components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,32 @@ import _traverse from '@babel/traverse'
// @ts-ignore
const traverse = (_traverse.default as typeof _traverse) ?? _traverse
import {
blockStatement,
conditionalExpression,
exportDefaultDeclaration,
exportNamedDeclaration,
exportSpecifier,
functionExpression,
identifier,
importDeclaration,
importSpecifier,
jsxAttribute,
jsxClosingElement,
jsxElement,
jsxExpressionContainer,
jsxIdentifier,
jsxOpeningElement,
stringLiteral,
variableDeclarator,
variableDeclaration,
functionExpression,
blockStatement,
returnStatement,
jsxSpreadAttribute,
jsxExpressionContainer,
exportDefaultDeclaration,
conditionalExpression,
memberExpression,
importDeclaration,
importSpecifier,
exportNamedDeclaration,
exportSpecifier,
returnStatement,
stringLiteral,
variableDeclaration,
variableDeclarator,
} from '@babel/types'
import { parse as parseJsonc } from 'jsonc-parser'
// eslint-disable-next-line node/no-extraneous-import
import type { Plugin } from 'vite'
import { matchIslandComponentId, isComponentName } from './utils/path.js'
import { isComponentName, matchIslandComponentId } from './utils/path.js'

function addSSRCheck(funcName: string, componentName: string, componentExport?: string) {
const isSSR = memberExpression(
Expand Down
2 changes: 1 addition & 1 deletion test-e2e/e2e.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test, expect } from '@playwright/test'
import { expect, test } from '@playwright/test'

test('test counter', async ({ page }) => {
await page.goto('/interaction')
Expand Down
2 changes: 1 addition & 1 deletion test-integration/apps.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { poweredBy } from 'hono/powered-by'
import { describe, it, expect, vi } from 'vitest'
import { describe, expect, it, vi } from 'vitest'
import { createApp } from '../src/server'

describe('Basic', () => {
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
# bun ./bun.lockb --hash: EEA022DC5A02E807-9535a4759596cd0b-CADC0EADF1F622AE-e0c0fb8a64d8bcd6
# bun ./bun.lockb --hash: 0B0BA37058D3CD5C-3670130fe0734764-A920B39892F98B96-7d88c4e0bbc96280


"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.23.5", "@babel/code-frame@^7.24.2":
Expand Down Expand Up @@ -414,10 +414,10 @@
resolved "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz"
integrity sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==

"@hono/eslint-config@^0.0.4":
version "0.0.4"
resolved "https://registry.npmjs.org/@hono/eslint-config/-/eslint-config-0.0.4.tgz"
integrity sha512-CaL3LBdI2tw7Luo4vGDhhrdntA02Nsts6P0FjAz3U5piy3UhWzgEvEN+L9M0fsG7Mm1cgd+kM3hF8CRJOH0aGA==
"@hono/eslint-config@^0.0.6":
version "0.0.6"
resolved "https://registry.npmjs.org/@hono/eslint-config/-/eslint-config-0.0.6.tgz"
integrity sha512-svFH026Vp5UHREJZzG6wx0SVHpX3O6yxeHjSYLXB4tXEzDEM2zK17tZ1XRFZRtx9NQH2yUGBEciwxdbx0LF7Jg==
dependencies:
"@typescript-eslint/eslint-plugin" "^6.14.0"
"@typescript-eslint/parser" "^6.14.0"
Expand Down

0 comments on commit 9139576

Please sign in to comment.