mkstack/eslint.config.js

55 lines
1.5 KiB
JavaScript
Raw Normal View History

2025-04-16 21:43:54 -05:00
import js from "@eslint/js";
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";
2025-05-30 22:58:43 +02:00
import htmlEslint from "@html-eslint/eslint-plugin";
import htmlParser from "@html-eslint/parser";
import customRules from "./eslint-rules/index.js";
2025-04-16 21:43:54 -05:00
export default tseslint.config(
{ ignores: ["dist"] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
"custom": customRules,
2025-04-16 21:43:54 -05:00
},
rules: {
...reactHooks.configs.recommended.rules,
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
"@typescript-eslint/no-unused-vars": "off",
"custom/no-placeholder-comments": "error",
2025-05-30 23:46:15 +02:00
"no-warning-comments": [
"error",
{ terms: ["fixme"] },
],
2025-04-16 21:43:54 -05:00
},
2025-05-30 22:58:43 +02:00
},
{
files: ["**/*.html"],
plugins: {
"@html-eslint": htmlEslint,
2025-05-30 23:02:12 +02:00
"custom": customRules,
2025-05-30 22:58:43 +02:00
},
languageOptions: {
parser: htmlParser,
},
rules: {
"@html-eslint/require-title": "error",
"@html-eslint/require-meta-charset": "error",
"@html-eslint/require-meta-viewport": "error",
2025-05-30 23:02:12 +02:00
"custom/require-webmanifest": "error",
2025-05-30 22:58:43 +02:00
},
2025-04-16 21:43:54 -05:00
}
);