Skip to content

Commit 6fa45bb

Browse files
committed
updated again for lint v10 format!
1 parent eb89d37 commit 6fa45bb

2 files changed

Lines changed: 34 additions & 13 deletions

File tree

.github/workflows/lint.yaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,19 @@
11
name: JavaScript Analysis
2-
32
on: [push, pull_request]
4-
53
jobs:
64
lint:
75
runs-on: ubuntu-latest
86
steps:
97
- name: Checkout code
108
uses: actions/checkout@v4
11-
129
- name: Set up Node.js
1310
uses: actions/setup-node@v4
1411
with:
1512
node-version: '20'
16-
1713
- name: Install dependencies
1814
run: |
1915
npm init -y
20-
# Added @eslint/js to the install list
21-
npm install eslint eslint-plugin-html @eslint/js --save-dev
22-
# This ensures Node treats .js files as ESM modules
16+
npm install eslint eslint-plugin-html --save-dev
2317
npm pkg set type="module"
24-
2518
- name: Run Analysis
2619
run: npx eslint "**/*.html"

eslint.config.js

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,48 @@
1-
import globals from "globals";
2-
31
export default [
42
{
53
files: ["**/*.html", "**/*.js"],
64
languageOptions: {
75
ecmaVersion: 2022,
86
sourceType: "script",
97
globals: {
10-
...globals.browser,
8+
// Browser environment
9+
window: "readonly",
10+
document: "readonly",
11+
navigator: "readonly",
12+
localStorage: "readonly",
13+
sessionStorage: "readonly",
14+
console: "readonly",
15+
alert: "readonly",
16+
confirm: "readonly",
17+
prompt: "readonly",
18+
setTimeout: "readonly",
19+
clearTimeout: "readonly",
20+
setInterval: "readonly",
21+
clearInterval: "readonly",
22+
performance: "readonly",
23+
URL: "readonly",
24+
Blob: "readonly",
25+
File: "readonly",
26+
FileReader: "readonly",
27+
FormData: "readonly",
28+
Event: "readonly",
29+
CustomEvent: "readonly",
30+
HTMLElement: "readonly",
31+
ArrayBuffer: "readonly",
32+
DataView: "readonly",
33+
Uint8Array: "readonly",
34+
BigInt: "readonly",
35+
fetch: "readonly",
36+
AbortController: "readonly",
37+
TextEncoder: "readonly",
38+
TextDecoder: "readonly",
1139
},
1240
},
1341
rules: {
14-
// Functions called from HTML onclick attributes appear unused to ESLint
42+
// Functions called from HTML onclick/onchange attributes appear unused to ESLint
1543
"no-unused-vars": ["warn", {
1644
varsIgnorePattern: "^(toggleConnection|disconnect|toggleSection|saveCurrentProfile|exportProfile|importProfile|loadSaved|delSaved|openProfile|closeProfile|openAbout|closeAbout|sendQuery|setFC|togglePolling|clearLog|addProfileEntry|copyFirstToAll|reRender|clearActiveProfile|updateOffsetUI|updateWirePreview)$"
1745
}],
1846
},
1947
},
20-
];
48+
];

0 commit comments

Comments
 (0)