mirror of
https://github.com/Heretek-Games/drop-emulation.git
synced 2026-11-07 10:05:59 -10:00
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:
1 parent
cbfdae9537
commit
35833a7af3
4 files changed
+1346
-4
No files matched your search
@@ -30,3 +30,5 @@ jobs:
|
||||
|
||||
- name: Test
|
||||
run: npm test
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
@@ -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: "^_" },
|
||||
],
|
||||
},
|
||||
},
|
||||
);
|
||||
Generated
+1302
-1
File diff suppressed because it is too large.
Load diff
+7
-3
@@ -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"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user