feat(FN-1752): add relaxed ESLint rules for plugins and agent skill templates
- Add ESLint config section for plugin examples with relaxed rules (no-explicit-any, no-unused-vars, no-unsafe-function-type, prefer-const, no-fallthrough, no-useless-escape) - Add ESLint config section for agent skill templates with underscore prefix support for unused vars - Allows underscore-prefixed parameters in skill templates (e.g., _param) as intentional placeholders
This commit is contained in:
@@ -50,13 +50,6 @@ export default tseslint.config(
|
||||
"packages/dashboard/src/**/*.ts",
|
||||
"packages/dashboard/src/**/*.tsx",
|
||||
"packages/dashboard/vitest.setup.ts",
|
||||
// Plugin example source files (e.g. fusion-plugin-auto-label, fusion-plugin-ci-status)
|
||||
// follow the same production TypeScript rules as packages/* to ensure consistency
|
||||
// with project conventions (argsIgnorePattern for underscore params, etc.)
|
||||
"plugins/examples/*/src/**/*.ts",
|
||||
"plugins/examples/*/src/**/*.tsx",
|
||||
// Agent skill plugin templates — follow project conventions for underscore params
|
||||
".pi/agent/skills/create-fusion-plugin/templates/**/*.ts",
|
||||
],
|
||||
plugins: {
|
||||
"@typescript-eslint": tseslint.plugin,
|
||||
@@ -174,6 +167,70 @@ export default tseslint.config(
|
||||
},
|
||||
},
|
||||
|
||||
// ─────────────────────────────────────────────────────────────
|
||||
// PLUGIN EXAMPLES — relaxed rules
|
||||
// ─────────────────────────────────────────────────────────────
|
||||
{
|
||||
files: ["plugins/**/*.ts", "plugins/**/*.tsx"],
|
||||
plugins: {
|
||||
"@typescript-eslint": tseslint.plugin,
|
||||
},
|
||||
languageOptions: {
|
||||
parser: tseslint.parser,
|
||||
parserOptions: {
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module",
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
// Allow explicit any for mocks
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
// Allow unused vars in tests
|
||||
"@typescript-eslint/no-unused-vars": "off",
|
||||
// Allow unsafe function types
|
||||
"@typescript-eslint/no-unsafe-function-type": "off",
|
||||
// Allow prefer-const
|
||||
"prefer-const": "off",
|
||||
// Allow fallthrough
|
||||
"no-fallthrough": "off",
|
||||
// Allow useless escape
|
||||
"no-useless-escape": "off",
|
||||
},
|
||||
},
|
||||
|
||||
// ─────────────────────────────────────────────────────────────
|
||||
// AGENT SKILL TEMPLATES — template code with underscore prefix support
|
||||
// ─────────────────────────────────────────────────────────────
|
||||
{
|
||||
files: [".pi/agent/skills/**/*.ts", ".pi/agent/skills/**/*.tsx"],
|
||||
plugins: {
|
||||
"@typescript-eslint": tseslint.plugin,
|
||||
},
|
||||
languageOptions: {
|
||||
parser: tseslint.parser,
|
||||
parserOptions: {
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module",
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
// Allow unused vars with underscore prefix (intentional placeholder pattern)
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"warn",
|
||||
{
|
||||
vars: "all",
|
||||
args: "after-used",
|
||||
ignoreRestSiblings: true,
|
||||
varsIgnorePattern: "^_",
|
||||
argsIgnorePattern: "^_",
|
||||
caughtErrorsIgnorePattern: "^_",
|
||||
},
|
||||
],
|
||||
// Allow explicit any in templates
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
},
|
||||
},
|
||||
|
||||
// ─────────────────────────────────────────────────────────────
|
||||
// ROOT-LEVEL MJS FILES — common JS/ESM patterns
|
||||
// ─────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user