this repo has no description

add lint action, undo changes caused by no-unused-labels

adryd dada9c4b 0ddeb427

Changed files
+51 -10
.github
workflows
packages
core
src
extension
util
+4 -1
.eslintrc.json
··· 41 41 // this being enabled is a hinderance 42 42 "@typescript-eslint/no-explicit-any": "off", 43 43 44 - "@typescript-eslint/no-var-requires": "off" 44 + "@typescript-eslint/no-var-requires": "off", 45 + 46 + // https://canary.discord.com/channels/1154257010532032512/1154275441788583996/1181760413231230976 47 + "no-unused-labels": "off" 45 48 }, 46 49 "settings": { 47 50 "react": {
+35
.github/workflows/lint.yml
··· 1 + name: Lint commits 2 + 3 + on: [push, pull_request] 4 + 5 + permissions: 6 + contents: read 7 + pages: write 8 + id-token: write 9 + 10 + jobs: 11 + lint: 12 + name: Lint commits 13 + runs-on: ubuntu-latest 14 + steps: 15 + - uses: actions/checkout@v3 16 + 17 + - uses: pnpm/action-setup@v2 18 + with: 19 + version: 8 20 + run_install: false 21 + - uses: actions/setup-node@v3 22 + with: 23 + node-version: 18 24 + cache: pnpm 25 + 26 + - name: Install dependencies 27 + run: pnpm install --frozen-lockfile 28 + - name: Save Code Linting Report JSON 29 + run: npm run lint:report 30 + continue-on-error: true 31 + - name: Annotate Code Linting Results 32 + # see https://github.com/ataylorme/eslint-annotate-action 33 + uses: ataylorme/eslint-annotate-action@v2 34 + with: 35 + report-json: "eslint_report.json"
+4 -1
package.json
··· 12 12 }, 13 13 "scripts": { 14 14 "build": "node build.mjs", 15 - "dev": "node build.mjs --watch" 15 + "dev": "node build.mjs --watch", 16 + "lint": "eslint packages", 17 + "lint:fix": "eslint packages", 18 + "lint:report": "eslint --output-file eslint_report.json --format json packages" 16 19 }, 17 20 "devDependencies": { 18 21 "@typescript-eslint/eslint-plugin": "^6.13.2",
+3 -3
packages/core/src/extension/loader.ts
··· 12 12 const logger = new Logger("core/extension/loader"); 13 13 14 14 async function loadExt(ext: DetectedExtension) { 15 - { 15 + webPreload: { 16 16 if (ext.scripts.web != null) { 17 17 const source = 18 18 ext.scripts.web + "\n//# sourceURL=file:///" + ext.scripts.webPath; ··· 55 55 } 56 56 } 57 57 58 - { 58 + nodePreload: { 59 59 if (ext.scripts.nodePath != null) { 60 60 try { 61 61 const module = require(ext.scripts.nodePath); ··· 66 66 } 67 67 } 68 68 69 - { 69 + injector: { 70 70 if (ext.scripts.hostPath != null) { 71 71 try { 72 72 require(ext.scripts.hostPath);
+2 -2
packages/core/src/util/data.ts
··· 7 7 const path = requireImport("path"); 8 8 9 9 let appData = ""; 10 - { 10 + injector: { 11 11 appData = app.getPath("appData"); 12 12 } 13 13 14 - { 14 + nodePreload: { 15 15 appData = ipcRenderer.sendSync(constants.ipcGetAppData); 16 16 } 17 17
+3 -3
packages/core/src/util/event.ts
··· 37 37 } 38 38 39 39 export function createEventEmitter(): MoonlightEventEmitter { 40 - { 40 + webPreload: { 41 41 const eventEmitter = new EventTarget(); 42 42 const listeners = new Map<MoonlightEventCallback, (e: Event) => void>(); 43 43 ··· 67 67 }; 68 68 } 69 69 70 - { 70 + nodePreload: { 71 71 return nodeMethod(); 72 72 } 73 73 74 - { 74 + injector: { 75 75 return nodeMethod(); 76 76 } 77 77