Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: ESLintの設定を修正・Flat Configに移行 #84

Merged
merged 6 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions packages/kcms/.eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/kcms/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const compat = new FlatCompat();
export default [
{
// 対象ファイル
files: ['src/**/**.ts'],
files: ['src/**/*.ts'],
},
{
// 除外ファイル
Expand Down
2 changes: 1 addition & 1 deletion packages/kcms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"start": "node ./build/main.js",
"dev": "tsx ./src/main.ts",
"build": "esbuild ./src/main.ts --bundle --sourcemap --platform=node --target=node16 --format=esm --packages=external --outfile=build/main.js",
"lint": "eslint --cache 'src/**/**.ts'",
"lint": "eslint --cache \"src/**/*.ts\"",
"format": "prettier . --write",
"test": "vitest run",
"coverage": "vitest run --coverage",
Expand Down
18 changes: 0 additions & 18 deletions packages/kcmsf/.eslintrc.cjs

This file was deleted.

3 changes: 2 additions & 1 deletion packages/kcmsf/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ dist-ssr
*.sln
*.sw?

/coverage
/coverage
.eslintcache
47 changes: 47 additions & 0 deletions packages/kcmsf/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { FlatCompat } from "@eslint/eslintrc";
import js from "@eslint/js";
import typeScriptESLint from "@typescript-eslint/eslint-plugin";
import typeScriptESLintParser from "@typescript-eslint/parser";
import eslintConfigPrettier from "eslint-config-prettier";
import reactRefresh from "eslint-plugin-react-refresh";
import vitest from "eslint-plugin-vitest";
import globals from "globals";

const compat = new FlatCompat();

export default [
{
files: ["src/**/*.{ts,tsx}"],
},
{
ignores: ["dist/**", "node_modules/**"],
},
js.configs.recommended,
eslintConfigPrettier,
...compat.extends("plugin:@typescript-eslint/recommended"),
...compat.extends("plugin:react-hooks/recommended"),
{
languageOptions: {
parser: typeScriptESLintParser,
globals: {
...globals.browser,
},
},
},
{
plugins: {
"@typescript-eslint": typeScriptESLint,
"react-refresh": reactRefresh,
vitest,
},
},
{
rules: {
...vitest.configs.recommended.rules,
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
},
];
3 changes: 2 additions & 1 deletion packages/kcmsf/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives",
"lint": "eslint --cache \"src/**/*.{ts,tsx}\" --report-unused-disable-directives",
"preview": "vite preview",
"format": "prettier --write .",
"test": "vitest --watch --ui --coverage.enabled=true",
Expand Down Expand Up @@ -40,6 +40,7 @@
"eslint": "^8.53.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.4",
"globals": "^15.8.0",
"jsdom": "^24.0.0",
"postcss": "^8.4.32",
"postcss-preset-mantine": "^1.11.1",
Expand Down
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.