|
import globals from "globals"; |
|
import pluginJs from "@eslint/js"; |
|
import tseslint from "typescript-eslint"; |
|
import pluginReact from "eslint-plugin-react"; |
|
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; |
|
import path from "node:path"; |
|
|
|
/** @type {import('eslint').Linter.Config[]} */ |
|
export default [ |
|
{ignores: ["build", "node_modules", "public", "resources/js/components/ui"]}, |
|
{ files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"] }, |
|
{ languageOptions: { |
|
globals: globals.browser, |
|
ecmaVersion: 2022, |
|
sourceType: "module", |
|
parser:"@typescript-eslint/parser", |
|
parserOptions:{ |
|
ecmaFeatures: { |
|
jsx: true, |
|
}, |
|
tsconfigRootDir: path.resolve(), |
|
project: ["tsconfig.json"], |
|
} |
|
} |
|
}, |
|
eslintPluginPrettierRecommended, |
|
pluginJs.configs.recommended, |
|
...tseslint.configs.recommended, |
|
pluginReact.configs.flat.recommended, |
|
{ |
|
settings: { |
|
react: { |
|
version: "detect", // Automatically detect the React version |
|
}, |
|
}, |
|
rules: { |
|
"react/react-in-jsx-scope": "off", // React 17+ doesn't require import React |
|
"react/prop-types": "off", // Disable prop-types if using TypeScript |
|
// Prettier integration |
|
"prettier/prettier": "error", |
|
// TypeScript rules |
|
"@typescript-eslint/no-unused-vars": "warn", // Unused variables in TS |
|
"@typescript-eslint/explicit-module-boundary-types": "off", |
|
}, |
|
}, |
|
]; |