Skip to content

Commit

Permalink
Lint Preact components
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrus01337 committed Jul 26, 2024
1 parent 8ef9dcf commit dad94e0
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
Binary file modified bun.lockb
Binary file not shown.
37 changes: 37 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import globals from "globals";

import javascript from "@eslint/js";
import prettier from "eslint-config-prettier";
import astro from "eslint-plugin-astro";
import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import typescript from "typescript-eslint";

export default typescript.config(
Expand All @@ -9,6 +13,39 @@ export default typescript.config(
...typescript.configs.recommended,
...typescript.configs.stylistic,
...astro.configs.recommended,
{
...react.configs.flat.recommended,
...react.configs.flat["jsx-runtime"],

files: ["**/*.{jsx,tsx}"],
languageOptions: {
...react.configs.flat.recommended.languageOptions,
...react.configs.flat["jsx-runtime"].languageOptions,

globals: {
...globals.browser,
...globals.serviceworker,
},
},
rules: {
...react.configs.flat.recommended.rules,
...react.configs.flat["jsx-runtime"].rules,

"react/display-name": "off",
"react/no-unknown-property": "error",
},
settings: {
react: {
version: "detect",
},
},
},
{
plugins: {
"react-hooks": reactHooks,
},
rules: reactHooks.configs.recommended.rules,
},
{
ignores: [".astro/", "dist/", "node_modules/"],
},
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@
"cssnano": "^7.0.3",
"daisyui": "^4.12.8",
"eslint": "^9.5.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-astro": "^1.2.3",
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-react-hooks": "^4.6.2",
"husky": "^9.0.11",
"lint-staged": "^15.2.7",
"theme-change": "^2.5.0",
Expand Down

0 comments on commit dad94e0

Please sign in to comment.