refactor: replace 'let' with 'const' for better variable scoping and immutability

This commit is contained in:
Tunglies
2025-09-18 23:07:18 +08:00
Unverified
parent 9d96ac0f6a
commit 324628dd3d
17 changed files with 154 additions and 121 deletions

View File

@@ -1,15 +1,23 @@
import js from "@eslint/js";
import pluginReact from "eslint-plugin-react";
import pluginReactHooks from "eslint-plugin-react-hooks";
import { defineConfig } from "eslint/config";
import globals from "globals";
import tseslint from "typescript-eslint";
import pluginReact from "eslint-plugin-react";
import { defineConfig } from "eslint/config";
export default defineConfig([
{
files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
plugins: { js },
plugins: {
js,
"react-hooks": pluginReactHooks,
},
extends: ["js/recommended"],
languageOptions: { globals: globals.browser },
rules: {
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error",
},
},
tseslint.configs.recommended,
pluginReact.configs.flat["jsx-runtime"],