77 lines
2.0 KiB
JavaScript
77 lines
2.0 KiB
JavaScript
// eslint.config.js
|
|
import globals from "globals";
|
|
import pluginReact from "eslint-plugin-react";
|
|
import pluginReactHooks from "eslint-plugin-react-hooks";
|
|
import tseslint from "@typescript-eslint/eslint-plugin";
|
|
import parser from "@typescript-eslint/parser";
|
|
|
|
export default [
|
|
// Basic ESLint config
|
|
{
|
|
languageOptions: {
|
|
parser: parser,
|
|
parserOptions: {
|
|
ecmaFeatures: {
|
|
jsx: true,
|
|
},
|
|
ecmaVersion: "latest",
|
|
sourceType: "module",
|
|
},
|
|
globals: {
|
|
...globals.browser,
|
|
...globals.node,
|
|
},
|
|
},
|
|
plugins: {
|
|
react: pluginReact,
|
|
"react-hooks": pluginReactHooks,
|
|
"@typescript-eslint": tseslint,
|
|
},
|
|
rules: {
|
|
// Add or override specific rules here if necessary.
|
|
// For example, to disable the rule that requires React import in JSX files (new JSX transform):
|
|
"react/react-in-jsx-scope": "off",
|
|
},
|
|
ignores: [
|
|
"dist/",
|
|
"node_modules/",
|
|
".git/",
|
|
"coverage/",
|
|
"vite.config.ts",
|
|
"tsconfig.json",
|
|
"tsconfig.app.json",
|
|
"tsconfig.node.json",
|
|
"spacetime.json",
|
|
"spacetime.local.json",
|
|
"package.json",
|
|
"pnpm-lock.yaml",
|
|
".windsurfrules",
|
|
"AGENTS.md",
|
|
"CHANGELOG.md",
|
|
"CLAUDE.md",
|
|
"index.html",
|
|
"LICENSE",
|
|
"README.md",
|
|
".github/",
|
|
".cursor/",
|
|
"spacetimedb/",
|
|
],
|
|
},
|
|
// React plugin specific config, ensuring it applies to relevant files
|
|
{
|
|
files: ["**/*.{js,jsx,ts,tsx}"], // Apply these rules to relevant files
|
|
plugins: {
|
|
react: pluginReact,
|
|
"react-hooks": pluginReactHooks,
|
|
"@typescript-eslint": tseslint,
|
|
},
|
|
rules: {
|
|
// Extend recommended rules from plugins
|
|
...pluginReact.configs.recommended.rules,
|
|
...pluginReactHooks.configs.recommended.rules,
|
|
...tseslint.configs.recommended.rules,
|
|
"react/react-in-jsx-scope": "off", // For new JSX transform
|
|
},
|
|
},
|
|
];
|