Skip to content

Commit e906088

Browse files
committed
Update ESLint, CI
1 parent f433bfd commit e906088

File tree

12 files changed

+322
-313
lines changed

12 files changed

+322
-313
lines changed

.eslintignore

-2
This file was deleted.

.eslintrc.js

-18
This file was deleted.

.github/workflows/node.js.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99

1010
strategy:
1111
matrix:
12-
node-version: [18.x, 20.x]
12+
node-version: [20.x, 22.x]
1313

1414
steps:
1515
- uses: actions/checkout@v4

package.json

+9-6
Original file line numberDiff line numberDiff line change
@@ -121,29 +121,32 @@
121121
"publish-lib": "yarn dist && yarn publish --access public && yarn --use-yarnrc .yarnrc-github-packages publish"
122122
},
123123
"devDependencies": {
124+
"@eslint/eslintrc": "^3.2.0",
125+
"@eslint/js": "^9.20.0",
124126
"@lionweb/core": "^0.6.7",
125127
"@lionweb/utilities": "^0.6.7",
126128
"@tsconfig/recommended": "^1.0.3",
127129
"@types/chai": "^4.3.11",
128130
"@types/ecore": "^0.12.5",
129131
"@types/jest": "^29.5.10",
130132
"@types/node": "^18.19.2",
131-
"@typescript-eslint/eslint-plugin": "^6.13.2",
132-
"@typescript-eslint/parser": "^6.13.2",
133-
"antlr4ng": "^3.0.4",
133+
"@typescript-eslint/eslint-plugin": "^8.24.0",
134+
"@typescript-eslint/parser": "^8.24.0",
135+
"antlr4ng": "^3.0.14",
134136
"antlr4ng-cli": "^2.0.0",
135137
"chai": "^4.3.10",
136138
"cmd-ts": "^0.13.0",
137139
"cross-env": "^7.0.3",
138140
"ecore": "^0.12.0",
139-
"eslint": "^8.55.0",
140-
"i18next": "^23.11.5",
141+
"eslint": "^9.20.1",
142+
"i18next": "^24.2.2",
141143
"jest": "^29.7.0",
142144
"merge-options": "^2.0.0",
143145
"rimraf": "^3.0.0",
144146
"ts-jest": "^29.1.1",
145147
"ts-node": "^10.9.1",
146148
"typedoc": "^0.25.7",
147-
"typescript": "^5.3.2"
149+
"typescript": "^5.3.2",
150+
"typescript-eslint": "^8.24.0"
148151
}
149152
}

src/interop/ecore.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,6 @@ export function generateASTClasses(model: ECore.EPackage): PackageDescription {
499499
return pkg;
500500
}
501501

502-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
503502
export function loadEPackages(data: any, resource: ECore.Resource): ECore.EPackage[] {
504503
if(typeof data === "string") {
505504
data = JSON.parse(data);
@@ -565,7 +564,7 @@ class ReferencesTracker {
565564
let eClass;
566565
try {
567566
eClass = findEClass(uri, this.resource);
568-
} catch (e) {
567+
} catch {
569568
//Not an eclass
570569
}
571570
if (eClass) {
@@ -735,7 +734,6 @@ function setChild(
735734
* @param strict if true (the default), unknown attributes are an error, otherwise they're ignored.
736735
* @param referencesTracker references tracker used to read references and solve them later (after loading all nodes)
737736
*/
738-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
739737
function importJsonObject(
740738
obj: any, resource: ECore.Resource, eClass?: ECore.EClass,
741739
strict = true, referencesTracker: ReferencesTracker = new ReferencesTracker(resource)): ECore.EObject {

src/interop/lionweb.ts

-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ export class LionwebNode extends NodeAdapter {
198198
super();
199199
}
200200

201-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
202201
get(...path: string[]): LionwebNode | undefined {
203202
let result: LionwebNode | undefined = undefined;
204203
// eslint-disable-next-line @typescript-eslint/no-this-alias

src/model/model.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export function getNodeDefinition(node: Node | (abstract new (...args: any[]) =>
5555
let metadataHolder;
5656
try {
5757
metadataHolder = new (node as any)();
58-
} catch (_) {
58+
} catch {
5959
metadataHolder = node;
6060
}
6161
for(const p in definition.features) {
@@ -69,7 +69,7 @@ export function getNodeDefinition(node: Node | (abstract new (...args: any[]) =>
6969
}
7070
}
7171
definition.resolved = true;
72-
} catch (e) {
72+
} catch {
7373
//Ignore
7474
}
7575
}
@@ -116,7 +116,7 @@ export class SimpleOrigin extends Origin {
116116
}
117117
}
118118

119-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
119+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
120120
export interface Destination {}
121121

122122

src/transformation/transformation.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ export class ASTTransformer {
330330

331331
try {
332332
childNodeFactory.set(node, child);
333-
} catch (e) {
333+
} catch {
334334
throw new Error(`Could not set child ${childNodeFactory}`);
335335
}
336336
}

tests/.eslintrc.js

-9
This file was deleted.

tests/issues.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe('Issues', function() {
3333

3434
it("has capitalized messages",
3535
function () {
36-
let issue = Issue.syntactic("unexpected token: foo", IssueSeverity.ERROR, undefined, undefined, SYNTAX_ERROR);
36+
const issue = Issue.syntactic("unexpected token: foo", IssueSeverity.ERROR, undefined, undefined, SYNTAX_ERROR);
3737
expect(issue.message).to.equal("Unexpected token: foo");
3838
});
3939
});

tests/json.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ describe('JSON generator', function() {
9696
});
9797
it("Wrongly configured node",
9898
function () {
99+
// eslint-disable-next-line @typescript-eslint/no-require-imports
99100
expect(() => require("./wrong-node")).to.throw;
100101
});
101102
it("Node with resolved reference by name",

0 commit comments

Comments
 (0)