supersam/eslint.config.js

49 lines
1016 B
JavaScript

import js from "@eslint/js";
import globals from "globals";
import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
export default [
{
ignores: ["dist/**", "node_modules/**", ".worktrees/**"],
},
js.configs.recommended,
{
files: ["**/*.{js,jsx}"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
globals: {
...globals.browser,
},
},
plugins: {
react,
"react-hooks": reactHooks,
},
rules: {
"no-unused-vars": [
"error",
{
varsIgnorePattern: "^React$",
},
],
"react/react-in-jsx-scope": "off",
"react/jsx-uses-vars": "error",
"react/prop-types": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
},
settings: {
react: {
version: "detect",
},
},
},
];