34 lines
991 B
JavaScript
34 lines
991 B
JavaScript
import js from "@eslint/js";
|
|
import globals from "globals";
|
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
import reactRefresh from "eslint-plugin-react-refresh";
|
|
import tseslint from "typescript-eslint";
|
|
import prettier from "eslint-plugin-prettier";
|
|
import { readFileSync } from "node:fs";
|
|
|
|
// Read Prettier configuration from .prettierrc.json
|
|
const prettierOptions = JSON.parse(readFileSync("./.prettierrc.json", "utf8"));
|
|
|
|
export default [
|
|
{ ignores: ["dist"] },
|
|
js.configs.recommended,
|
|
...tseslint.configs.recommended,
|
|
{
|
|
files: ["**/*.{ts,tsx}"],
|
|
languageOptions: {
|
|
ecmaVersion: 2020,
|
|
globals: globals.browser,
|
|
},
|
|
plugins: {
|
|
"react-hooks": reactHooks,
|
|
"react-refresh": reactRefresh,
|
|
prettier: prettier,
|
|
},
|
|
rules: {
|
|
...reactHooks.configs.recommended.rules,
|
|
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
|
|
"prettier/prettier": ["error", prettierOptions],
|
|
},
|
|
},
|
|
];
|