feat: updated @hono/eslint-config package (#1031)
* chore(eslint-config): update dependencies and improve configuration * chore(eslint-config): replace @typescript-eslint packages with typescript-eslint * chore: completed changes suggested by @BarryThePenguin * chore: updated the repo eslint config * chore: updated the lockfile * feat: added ci and minor changes * chore: updated the eslint version in package.json * chore: updated the lockfile * add changeset * `@ryoppippi/unplugin-typia` as devDependencies --------- Co-authored-by: Yusuke Wada <yusuke@kamawada.com>pull/1078/head
parent
8d663e4f9b
commit
0d6c13b1a3
|
@ -0,0 +1,9 @@
|
||||||
|
---
|
||||||
|
'@hono/eslint-config': minor
|
||||||
|
---
|
||||||
|
|
||||||
|
feat: updated `@hono/eslint-config` package
|
||||||
|
|
||||||
|
- upgrading eslint plugins
|
||||||
|
- removing @eslint/eslintrc and the legacy FlatCompat
|
||||||
|
- cleanup migration to typescript-eslint
|
|
@ -0,0 +1,17 @@
|
||||||
|
name: ci-lint
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
branches: ['*']
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
eslint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20.x
|
||||||
|
- run: yarn install
|
||||||
|
- run: yarn lint
|
|
@ -1,8 +1,6 @@
|
||||||
|
import { defineConfig, globalIgnores } from 'eslint/config'
|
||||||
import baseConfig from './packages/eslint-config/index.js'
|
import baseConfig from './packages/eslint-config/index.js'
|
||||||
|
|
||||||
export default [
|
export default defineConfig(globalIgnores(['.yarn', '**/dist']), {
|
||||||
...baseConfig,
|
extends: baseConfig,
|
||||||
{
|
})
|
||||||
ignores: ['**/dist/*'],
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
|
@ -1,32 +1,18 @@
|
||||||
import path from 'node:path'
|
|
||||||
import { fileURLToPath } from 'node:url'
|
|
||||||
import { FlatCompat } from '@eslint/eslintrc'
|
|
||||||
import js from '@eslint/js'
|
import js from '@eslint/js'
|
||||||
import typescriptEslint from '@typescript-eslint/eslint-plugin'
|
import prettier from 'eslint-config-prettier/flat'
|
||||||
import tsParser from '@typescript-eslint/parser'
|
|
||||||
import importX from 'eslint-plugin-import-x'
|
import importX from 'eslint-plugin-import-x'
|
||||||
|
import nodePlugin from 'eslint-plugin-n'
|
||||||
const __filename = fileURLToPath(import.meta.url)
|
import tseslint from 'typescript-eslint'
|
||||||
const __dirname = path.dirname(__filename)
|
|
||||||
const compat = new FlatCompat({
|
|
||||||
baseDirectory: __dirname,
|
|
||||||
recommendedConfig: js.configs.recommended,
|
|
||||||
allConfig: js.configs.all,
|
|
||||||
})
|
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
...compat.extends(
|
js.configs.recommended,
|
||||||
'eslint:recommended',
|
nodePlugin.configs["flat/recommended"],
|
||||||
'plugin:n/recommended',
|
tseslint.configs.recommended,
|
||||||
'plugin:@typescript-eslint/recommended',
|
|
||||||
'prettier'
|
|
||||||
),
|
|
||||||
{
|
{
|
||||||
plugins: {
|
plugins: {
|
||||||
'@typescript-eslint': typescriptEslint,
|
'@typescript-eslint': tseslint.plugin,
|
||||||
'import-x': importX,
|
'import-x': importX,
|
||||||
},
|
},
|
||||||
|
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
globals: {
|
globals: {
|
||||||
fetch: false,
|
fetch: false,
|
||||||
|
@ -35,7 +21,6 @@ export default [
|
||||||
addEventListener: false,
|
addEventListener: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
parser: tsParser,
|
|
||||||
ecmaVersion: 2021,
|
ecmaVersion: 2021,
|
||||||
sourceType: 'module',
|
sourceType: 'module',
|
||||||
},
|
},
|
||||||
|
@ -67,7 +52,14 @@ export default [
|
||||||
'import-x/order': [
|
'import-x/order': [
|
||||||
'error',
|
'error',
|
||||||
{
|
{
|
||||||
groups: ['external', 'builtin', 'internal', 'parent', 'sibling', 'index'],
|
groups: [
|
||||||
|
'external',
|
||||||
|
'builtin',
|
||||||
|
'internal',
|
||||||
|
'parent',
|
||||||
|
'sibling',
|
||||||
|
'index',
|
||||||
|
],
|
||||||
alphabetize: {
|
alphabetize: {
|
||||||
order: 'asc',
|
order: 'asc',
|
||||||
caseInsensitive: true,
|
caseInsensitive: true,
|
||||||
|
@ -107,4 +99,5 @@ export default [
|
||||||
'@typescript-eslint/no-var-requires': 'off',
|
'@typescript-eslint/no-var-requires': 'off',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
prettier,
|
||||||
]
|
]
|
||||||
|
|
|
@ -24,17 +24,14 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint/eslintrc": "^3.1.0",
|
"@eslint/eslintrc": "^3.1.0",
|
||||||
"@eslint/js": "^9.10.0",
|
"@eslint/js": "^9.10.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.7.0",
|
"eslint-config-prettier": "^10.1.1",
|
||||||
"@typescript-eslint/parser": "^8.7.0",
|
"eslint-import-resolver-typescript": "^4.2.2",
|
||||||
"eslint-config-prettier": "^9.1.0",
|
|
||||||
"eslint-define-config": "^2.1.0",
|
|
||||||
"eslint-import-resolver-typescript": "^3.6.3",
|
|
||||||
"eslint-plugin-import-x": "^4.1.1",
|
"eslint-plugin-import-x": "^4.1.1",
|
||||||
"eslint-plugin-n": "^17.10.2"
|
"eslint-plugin-n": "^17.10.2",
|
||||||
|
"typescript-eslint": "^8.27.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/eslint": "^8",
|
"eslint": "^9.23.0",
|
||||||
"eslint": "^9.10.0",
|
|
||||||
"typescript": "^5.3.3"
|
"typescript": "^5.3.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ const queryPaginationSchema = type({
|
||||||
})
|
})
|
||||||
|
|
||||||
const querySortSchema = type({
|
const querySortSchema = type({
|
||||||
// eslint-disable-next-line quotes
|
|
||||||
order: "'asc'|'desc'",
|
order: "'asc'|'desc'",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,7 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@arethetypeswrong/cli": "^0.17.4",
|
"@arethetypeswrong/cli": "^0.17.4",
|
||||||
|
"@ryoppippi/unplugin-typia": "^2.1.4",
|
||||||
"hono": "^3.11.7",
|
"hono": "^3.11.7",
|
||||||
"publint": "^0.3.9",
|
"publint": "^0.3.9",
|
||||||
"tsup": "^8.4.0",
|
"tsup": "^8.4.0",
|
||||||
|
|
Loading…
Reference in New Issue