56 lines
1.8 KiB
JavaScript
56 lines
1.8 KiB
JavaScript
import eslintPluginJs from "@eslint/js";
|
|
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
|
|
import pluginReactRefresh from "eslint-plugin-react-refresh";
|
|
import pluginReact from "eslint-plugin-react";
|
|
import tseslint from "typescript-eslint";
|
|
import globals from "globals";
|
|
|
|
/** @type {import('eslint').Linter.FlatConfig[]} */
|
|
export default [
|
|
eslintPluginJs.configs.recommended,
|
|
...tseslint.configs.recommended,
|
|
...tseslint.configs.stylistic,
|
|
eslintPluginPrettierRecommended,
|
|
{
|
|
files: ["./server/**/*.{js,jsx,mjs,cjs,ts,tsx}", "./shared/**/*.{js,jsx,mjs,cjs,ts,tsx}"],
|
|
ignores: ["node_modules/", "dist/", "build/", "coverage/", "public/", "**/eslint.config.js"],
|
|
languageOptions: {
|
|
parserOptions: {
|
|
project: ["tsconfig.json", "./client/tsconfig.json"],
|
|
tsconfigRootDir: "./",
|
|
},
|
|
},
|
|
},
|
|
{
|
|
files: ["./client/**/*.{js,jsx,mjs,cjs,ts,tsx}"],
|
|
plugins: {
|
|
react: pluginReact,
|
|
"react-refresh": pluginReactRefresh,
|
|
},
|
|
ignores: [
|
|
"client/**/node_modules/",
|
|
"client/**/dist/**",
|
|
"client/**/build/**",
|
|
"client/**/coverage/**",
|
|
"client/**/public/**",
|
|
"client/*.{js,ts}",
|
|
],
|
|
languageOptions: {
|
|
parserOptions: {
|
|
ecmaFeatures: {
|
|
jsx: true,
|
|
},
|
|
project: ["./client/tsconfig.json"],
|
|
tsconfigRootDir: "./client",
|
|
},
|
|
globals: {
|
|
...globals.browser,
|
|
},
|
|
},
|
|
rules: {
|
|
"reactPlugin/jsx-uses-react": "error",
|
|
"reactPlugin/jsx-uses-vars": "error",
|
|
},
|
|
},
|
|
];
|