ci: add a shared ESLint flat-config lint gate

Add eslint.config.mjs (eslint:recommended + typescript-eslint recommended,
type-unaware) with a `lint` script and a CI step. Rules that need a baseline
cleanup pass (no-explicit-any, ban-ts-comment, no-useless-assignment,
preserve-caught-error) are warnings; core rules and unused vars are errors.

Refs Heretek-Games/drop#69 (audit finding F-23).
This commit is contained in:
BillyOutlast committed 2026-09-14 19:59:21 -04:00
1 parent cbfdae9537
commit 35833a7af3
4 files changed
+1346 -4

No files matched your search

+2
View File
@@ -30,3 +30,5 @@ jobs:
- name: Test
run: npm test
- name: Lint
run: npm run lint
+35
View File
@@ -0,0 +1,35 @@
// @ts-check
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
// Shared lint gate for the Heretek Games Drop plugins. Intentionally not
// type-aware (fast, no tsconfig program). Rules that would require a
// pre-existing cleanup pass are warnings so the gate lands green; core rules
// and unused vars remain errors.
export default tseslint.config(
{
ignores: [
"**/dist/**",
"**/node_modules/**",
"plugin-bundle/**",
"dist-packages/**",
],
},
eslint.configs.recommended,
...tseslint.configs.recommended,
{
rules: {
// TypeScript already reports undeclared identifiers; no-undef only adds
// false positives for runtime globals (fetch, process, ...).
"no-undef": "off",
"no-useless-assignment": "warn",
"preserve-caught-error": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
},
},
);
+1302 -1
View File
File diff suppressed because it is too large. Load diff
+7 -3
View File
@@ -8,7 +8,8 @@
"build": "rm -rf dist && tsc",
"test": "node --test dist/test/*.js",
"typecheck": "tsc --noEmit",
"sign": "drop-plugin sign ."
"sign": "drop-plugin sign .",
"lint": "eslint ."
},
"dependencies": {
"@droposs/plugin-sdk": "^0.4.0"
@@ -16,7 +17,10 @@
"devDependencies": {
"@droposs/plugin-cli": "^0.4.0",
"typescript": "^5.7.0",
"@types/node": "^22.0.0"
"@types/node": "^22.0.0",
"@eslint/js": "^10.0.1",
"eslint": "^10.9.1",
"typescript-eslint": "^8.68.0"
},
"license": "MIT"
}
}