1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-26 10:45:23 -04:00
jarv.is/eslint.config.mjs

55 lines
1.5 KiB
JavaScript

/* eslint-disable import/no-anonymous-default-export */
import { FlatCompat } from "@eslint/eslintrc";
import js from "@eslint/js";
import * as eslintPluginMdx from "eslint-plugin-mdx";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
import eslintCustomConfig from "@jakejarvis/eslint-config";
/** @type {import("@eslint/eslintrc").FlatCompat} */
const compat = new FlatCompat({
baseDirectory: import.meta.dirname,
recommendedConfig: js.configs.recommended,
});
/** @type {import("eslint").Linter.Config[]} */
export default [
{ ignores: ["README.md", ".next", ".vercel", "node_modules"] },
...compat.config({
plugins: ["react-compiler", "css-modules"],
extends: ["eslint:recommended", "next/core-web-vitals", "next/typescript", "plugin:css-modules/recommended"],
}),
...eslintCustomConfig,
eslintPluginPrettierRecommended,
{
rules: {
"prettier/prettier": [
"error",
{},
{
usePrettierrc: true,
},
],
},
},
{
files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
rules: {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "warn",
"react-compiler/react-compiler": "error",
},
},
{
...eslintPluginMdx.flat,
processor: eslintPluginMdx.createRemarkProcessor({
lintCodeBlocks: false,
}),
rules: {
"mdx/remark": "warn",
"mdx/code-blocks": "off",
"react/jsx-no-undef": "off", // components are injected automatically from mdx-components.ts
},
},
];