65788705c3
Ignore .agents skill bundles from eslint (template files not part of the build), enable eslint --cache and tsc --incremental so warm re-runs skip unchanged files.
82 lines
2.3 KiB
JavaScript
82 lines
2.3 KiB
JavaScript
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";
|
|
import htmlEslint from "@html-eslint/eslint-plugin";
|
|
import htmlParser from "@html-eslint/parser";
|
|
import customRules from "./eslint-rules/index.js";
|
|
|
|
export default tseslint.config(
|
|
{ ignores: ["dist", "android", "ios", ".agents"] },
|
|
{
|
|
extends: [js.configs.recommended, ...tseslint.configs.recommended],
|
|
files: ["**/*.{ts,tsx}"],
|
|
languageOptions: {
|
|
ecmaVersion: 2020,
|
|
globals: globals.browser,
|
|
},
|
|
linterOptions: {
|
|
reportUnusedDisableDirectives: "error", // Reports unused disable directives as errors
|
|
},
|
|
plugins: {
|
|
"react-hooks": reactHooks,
|
|
"react-refresh": reactRefresh,
|
|
"custom": customRules,
|
|
},
|
|
rules: {
|
|
...reactHooks.configs.recommended.rules,
|
|
"react-refresh/only-export-components": [
|
|
"warn",
|
|
{ allowConstantExport: true },
|
|
],
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"error",
|
|
{
|
|
"argsIgnorePattern": "^_",
|
|
"varsIgnorePattern": "^_",
|
|
"ignoreRestSiblings": true,
|
|
},
|
|
],
|
|
"custom/no-placeholder-comments": "error",
|
|
"no-restricted-syntax": [
|
|
"error",
|
|
{
|
|
"selector": "CallExpression[callee.object.type='MetaProperty'][callee.property.name='glob']",
|
|
"message": "import.meta.glob is Vite-only and breaks other bundlers. Inline the assets or use standard imports instead.",
|
|
},
|
|
],
|
|
"no-warning-comments": [
|
|
"error",
|
|
{ terms: ["fixme"] },
|
|
],
|
|
},
|
|
},
|
|
{
|
|
files: ["**/*.html"],
|
|
plugins: {
|
|
"@html-eslint": htmlEslint,
|
|
"custom": customRules,
|
|
},
|
|
languageOptions: {
|
|
parser: htmlParser,
|
|
},
|
|
rules: {
|
|
"@html-eslint/require-title": "error",
|
|
"@html-eslint/require-meta-charset": "error",
|
|
"@html-eslint/require-meta-description": "error",
|
|
"@html-eslint/require-meta-viewport": "error",
|
|
"@html-eslint/require-open-graph-protocol": [
|
|
"error",
|
|
[
|
|
"og:type",
|
|
"og:title",
|
|
"og:description",
|
|
],
|
|
],
|
|
"custom/no-inline-script": "error",
|
|
"custom/require-webmanifest": "error",
|
|
},
|
|
}
|
|
);
|