Skip to content

Commit

Permalink
Merge pull request #10 from update/eslint-config
Browse files Browse the repository at this point in the history
Use stricter rules in ESLint config
  • Loading branch information
taesungh authored Nov 22, 2024
2 parents baa33c6 + 86ff8e7 commit b3172f7
Show file tree
Hide file tree
Showing 17 changed files with 2,574 additions and 62 deletions.
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"useTabs": true,
"semi": true,
"singleQuote": false,
"printWidth": 88
"printWidth": 100
}
31 changes: 30 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,53 @@
import js from "@eslint/js";
import globals from "globals";
import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";

export default tseslint.config(
{ ignores: ["dist"] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
extends: [
js.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
...react.configs.flat.recommended.languageOptions,
project: ["./tsconfig.node.json", "./tsconfig.app.json"],
tsconfigRootDir: import.meta.dirname,
},
},
settings: { react: { version: "detect" } },
plugins: {
react,
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...react.configs.recommended.rules,
...react.configs["jsx-runtime"].rules,
...reactHooks.configs.recommended.rules,
"@typescript-eslint/dot-notation": ["error", { allowIndexSignaturePropertyAccess: true }],
"@typescript-eslint/no-confusing-void-expression": ["error", { ignoreArrowShorthand: true }],
"@typescript-eslint/restrict-template-expressions": [
"error",
{
allow: [
{
name: ["FeatureChange"],
from: "file",
path: "src/pheatures/FeatureChange.ts",
},
],
},
],
"@typescript-eslint/unbound-method": ["error", { ignoreStatic: true }],
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
},
}
Expand Down
Loading

0 comments on commit b3172f7

Please sign in to comment.