Skip to content

Commit

Permalink
chore: use @hono/eslint-config (#1815)
Browse files Browse the repository at this point in the history
  • Loading branch information
yusukebe authored Dec 13, 2023
1 parent 0e11444 commit 18b6282
Show file tree
Hide file tree
Showing 4 changed files with 563 additions and 667 deletions.
65 changes: 3 additions & 62 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,62 +1,3 @@
const { defineConfig } = require('eslint-define-config')

module.exports = defineConfig({
root: true,
extends: [
'eslint:recommended',
'plugin:node/recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
ecmaVersion: 2021,
},
plugins: ['@typescript-eslint', 'import'],
globals: {
fetch: false,
Response: false,
Request: false,
addEventListener: false,
},
rules: {
quotes: ['error', 'single'],
semi: ['error', 'never'],
'no-debugger': ['error'],
'no-empty': ['warn', { allowEmptyCatch: true }],
'no-process-exit': 'off',
'no-useless-escape': 'off',
'prefer-const': [
'warn',
{
destructuring: 'all',
},
],
'@typescript-eslint/ban-types': [
'error',
{
types: {
Function: false,
'{}': false,
},
},
],
'sort-imports': 0,
'import/order': [2, { alphabetize: { order: 'asc' } }],

'node/no-missing-import': 'off',
'node/no-missing-require': 'off',
'node/no-deprecated-api': 'off',
'node/no-unpublished-import': 'off',
'node/no-unpublished-require': 'off',
'node/no-unsupported-features/es-syntax': 'off',

'@typescript-eslint/no-empty-function': ['error', { allow: ['arrowFunctions'] }],
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }],
},
ignorePatterns: ['dist'],
})
module.exports = {
extends: ['@hono/eslint-config'],
}
11 changes: 8 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"deno.enable": false,
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
}
}
}
23 changes: 7 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"test:lambda": "env NAME=Node vitest --run --config ./runtime_tests/lambda/vitest.config.ts",
"test:lambda-edge": "env NAME=Node vitest --run --config ./runtime_tests/lambda-edge/vitest.config.ts",
"test:all": "yarn test && yarn test:deno && yarn test:bun && yarn test:fastly && yarn test:lagon && yarn test:node && yarn test:wrangler && yarn test:lambda && yarn test:lambda-edge",
"lint": "eslint --ext js,ts src runtime_tests .eslintrc.cjs",
"lint:fix": "eslint --ext js,ts src runtime_tests .eslintrc.cjs --fix",
"lint": "eslint --ext js,ts src runtime_tests",
"lint:fix": "eslint --ext js,ts src runtime_tests --fix",
"format": "prettier --check 'src/**/*.{js,ts}' 'runtime_tests/**/*.{js,ts}'",
"format:fix": "prettier --write 'src/**/*.{js,ts}' 'runtime_tests/**/*.{js,ts}'",
"denoify": "rimraf deno_dist && denoify && rimraf 'deno_dist/**/*.test.{ts,tsx}'",
Expand Down Expand Up @@ -442,6 +442,7 @@
],
"devDependencies": {
"@cloudflare/workers-types": "^4.20221111.1",
"@hono/eslint-config": "^0.0.1",
"@hono/node-server": "^1.0.2",
"@types/crypto-js": "^4.1.1",
"@types/glob": "^8.0.0",
Expand All @@ -450,21 +451,12 @@
"@types/node": "^20.8.2",
"@types/node-fetch": "^2.6.2",
"@types/supertest": "^2.0.12",
"@typescript-eslint/eslint-plugin": "^5.59.2",
"@typescript-eslint/parser": "^5.59.2",
"@vitest/coverage-v8": "^0.34.3",
"arg": "^5.0.2",
"crypto-js": "^4.1.1",
"denoify": "^1.6.6",
"esbuild": "^0.15.12",
"eslint": "^8.39.0",
"eslint-config-prettier": "^8.8.0",
"eslint-define-config": "^1.20.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint": "^8.55.0",
"form-data": "^4.0.0",
"jest": "^29.6.4",
"jest-preset-fastly-js-compute": "^1.3.0",
Expand All @@ -479,13 +471,12 @@
"supertest": "^6.3.3",
"ts-jest": "^29.1.1",
"tsx": "^3.11.0",
"typescript": "^4.8.3",
"typescript": "^5.3.3",
"vitest": "^0.34.3",
"wrangler": "^2.12.0",
"zod": "^3.20.2"
},
"engines": {
"node": ">=16.0.0"
},
"dependencies": {}
}
}
}
Loading

0 comments on commit 18b6282

Please sign in to comment.