diff --git a/eslint.config.mjs b/eslint.config.mjs index dd5b764..22373c7 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,16 +1,17 @@ import { + comments, defineConfig, + imports, javascript, - comments, - typescript, jsonc, - unicorn, + react, regexp, + toml, + typescript, + unicorn, vue, - react, // svelte, - yaml, - toml + yaml } from '@kazupon/eslint-config' export default defineConfig( @@ -40,7 +41,17 @@ export default defineConfig( // TODO: // sometimes, Resolving `parserOptions.project` is not working in `.svelte` files. // extraFileExtensions: ['.vue', '.svelte'] - extraFileExtensions: ['.vue'] + extraFileExtensions: ['.vue'], + rules: { + '@typescript-eslint/consistent-type-imports': ['error', { disallowTypeAnnotations: false }] + } + }), + imports({ + typescript: true, + rules: { + 'import-x/first': 'error', + 'import-x/extensions': ['error', 'always', { ignorePackages: true }] + } }), jsonc({ json: true, diff --git a/package.json b/package.json index 68135af..517afaa 100644 --- a/package.json +++ b/package.json @@ -50,11 +50,13 @@ "watch:unplugin": "pnpm run --filter=./packages/unplugin-svelte watch" }, "devDependencies": { - "@kazupon/eslint-config": "^0.15.0", + "@kazupon/eslint-config": "^0.17.0", "@kazupon/prettier-config": "^0.1.1", "@types/node": "^20.14.10", "bumpp": "^9.5.2", "eslint": "^9.9.0", + "eslint-import-resolver-typescript": "^3.6.3", + "eslint-plugin-import-x": "^4.1.1", "eslint-plugin-jsonc": "^2.16.0", "eslint-plugin-react": "^7.35.0", "eslint-plugin-react-hooks": "^4.6.2", @@ -63,6 +65,7 @@ "eslint-plugin-svelte": "^2.43.0", "eslint-plugin-toml": "^0.11.1", "eslint-plugin-unicorn": "^54.0.0", + "eslint-plugin-unused-imports": "^4.1.3", "eslint-plugin-vue": "^9.27.0", "eslint-plugin-yml": "^1.14.0", "gh-changelogen": "^0.2.8", diff --git a/packages/jsx-compiler/src/compile.test.ts b/packages/jsx-compiler/src/compile.test.ts index 94fa56f..2f607b4 100644 --- a/packages/jsx-compiler/src/compile.test.ts +++ b/packages/jsx-compiler/src/compile.test.ts @@ -1,6 +1,6 @@ -import { describe, test, expect } from 'vitest' import { parse } from '@babel/parser' -import { compile } from './compile' +import { describe, expect, test } from 'vitest' +import { compile } from './compile.ts' const jsxCode = ` (