Skip to content

Commit 978a9cd

Browse files
authored
GLSP-1634: Switch to eslint 9.x (#126)
Part of eclipse-glsp/glsp/issues/1634
1 parent 92e476e commit 978a9cd

22 files changed

Lines changed: 727 additions & 1072 deletions

.eslintignore

Lines changed: 0 additions & 11 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,9 @@ report.xml
1818
wf-glsp-server-node.js
1919
wf-glsp-server-node.js.map
2020
wf-glsp-server-webworker.js
21-
wf-glsp-server-webworker.js.map
21+
wf-glsp-server-webworker.js.map
22+
23+
.claude/settings.local.json
24+
CLAUDE.local.md
25+
.claude/plans/
26+
.reviews/

AGENTS.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Repository Guidelines
2+
3+
## Project Structure & Module Organization
4+
5+
This repository is a Yarn workspace monorepo for the GLSP Node server stack.
6+
7+
- `packages/server`: core framework (`src/common`, `src/node`, `src/browser`).
8+
- `packages/graph`: TypeScript GModel types and utilities.
9+
- `packages/layout-elk`: ELK-based layout integration.
10+
- `examples/workflow-server` and `examples/workflow-server-bundled`: runnable example server and bundling setup.
11+
- Root config files (`tsconfig.json`, `eslint.config.mjs`, `.mocharc`, `.nycrc`) define shared standards across packages.
12+
13+
## Build, Test, and Development Commands
14+
15+
Run from repository root unless noted.
16+
17+
- `yarn`: install dependencies and trigger prepare build.
18+
- `yarn build`: compile TypeScript and bundle the workflow example.
19+
- `yarn lint`: run ESLint across the repo.
20+
- `yarn test`: run package tests via Lerna (`--no-bail`).
21+
- `yarn test:coverage`: run coverage per package (nyc).
22+
- `yarn format` / `yarn format:check`: apply/check Prettier formatting.
23+
- `yarn check:all`: full CI-style validation (lint, test, format, header checks).
24+
- `yarn start` or `yarn start:websocket`: launch bundled workflow example server.
25+
26+
## Coding Style & Naming Conventions
27+
28+
- Language: TypeScript (`Node >= 20`, Yarn 1.x).
29+
- Formatting and linting are enforced by `@eclipse-glsp/prettier-config` and `@eclipse-glsp/eslint-config`.
30+
- Use 4-space indentation and existing import ordering patterns.
31+
- Prefer descriptive kebab-case filenames; tests use `*.spec.ts`.
32+
- Keep public API barrel exports current (use `yarn generate:index` when needed).
33+
34+
## Testing Guidelines
35+
36+
- Framework: Mocha with shared config from `.mocharc`.
37+
- Place tests next to source files using `*.spec.ts` naming.
38+
- Run all tests: `yarn test`; package-only tests: `yarn --cwd packages/server test`.
39+
- Validate coverage with `yarn test:coverage` before opening larger changes.
40+
41+
## Commit & Pull Request Guidelines
42+
43+
- Open or reference an umbrella issue in `https://github.com/eclipse-glsp/glsp` before implementation.
44+
- Branch naming convention: `issues/<issue_number>` (for example, `issues/241`).
45+
- Commit messages should be imperative and include issue linkage with an absolute URL, e.g. `closes https://github.com/eclipse-glsp/glsp/issues/241`.
46+
- PRs should include: problem statement, scope, test evidence (`yarn test`, `yarn lint`), and screenshots/logs for behavior changes.
47+
- Ensure ECA requirements are met before requesting merge.

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@AGENTS.md

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# GLSP Server [![Build Status](https://img.shields.io/github/actions/workflow/status/eclipse-glsp/glsp-server-node/ci.yml?branch=main&label=build)](https://github.com/eclipse-glsp/glsp-server-node/actions/workflows/ci.yml)
2+
23
Contains the code for the Typescript-based framework to create [GLSP](https://github.com/eclipse-glsp/glsp) server components.
34
The implementation of this server is aligned with the default Java based [GLSP Server](https://github.com/eclipse-glsp/glsp-server-node).
45

eslint.config.mjs

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import glspConfig from '@eclipse-glsp/eslint-config';
2+
3+
export default [
4+
...glspConfig,
5+
// Ignore JS config/build files that are not part of the TS project
6+
{
7+
ignores: ['**/*.js', '**/*.mjs', '**/*.cjs']
8+
},
9+
// Apply parserOptions.project only to TypeScript files
10+
{
11+
files: ['**/*.{ts,tsx}'],
12+
languageOptions: {
13+
parserOptions: {
14+
project: './tsconfig.eslint.json',
15+
tsconfigRootDir: import.meta.dirname
16+
}
17+
}
18+
},
19+
// Repository-specific rule overrides
20+
{
21+
files: ['**/*.{ts,tsx}'],
22+
rules: {
23+
'@typescript-eslint/no-shadow': 'off',
24+
'@typescript-eslint/padding-line-between-statements': 'off',
25+
'no-restricted-imports': [
26+
'warn',
27+
{
28+
name: 'sprotty-protocol',
29+
message:
30+
"The sprotty-protocol default exports are customized and reexported by GLSP. Please import from '@eclipse-glsp/protocol' instead"
31+
},
32+
'.',
33+
'..',
34+
'../..'
35+
]
36+
}
37+
},
38+
// Test file overrides
39+
{
40+
files: ['**/*.spec.{ts,tsx}'],
41+
rules: {
42+
'@typescript-eslint/no-unused-expressions': 'off',
43+
'import-x/namespace': 'off'
44+
}
45+
}
46+
];

examples/workflow-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"bundle:browser": "webpack --env target=webworker ",
5252
"clean": "rimraf lib *.tsbuildinfo",
5353
"generate:index": "glsp generateIndex src/browser src/common src/node -s -f",
54-
"lint": "eslint --ext .ts,.tsx ./src",
54+
"lint": "eslint ./src",
5555
"watch": "tsc -w",
5656
"watch:bundle": "webpack -w"
5757
},

examples/workflow-server/src/common/util/model-types.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (c) 2022-2023 STMicroelectronics and others.
2+
* Copyright (c) 2022-2026 STMicroelectronics and others.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0 which is available at
@@ -13,7 +13,6 @@
1313
*
1414
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
1515
********************************************************************************/
16-
/* eslint-disable @typescript-eslint/padding-line-between-statements */
1716
export namespace ModelTypes {
1817
export const LABEL_HEADING = 'label:heading';
1918
export const LABEL_TEXT = 'label:text';

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@
1010
"all": "yarn install && yarn lint && yarn test",
1111
"build": "yarn compile && yarn bundle",
1212
"bundle": "yarn --cwd examples/workflow-server bundle",
13-
"check:headers": "glsp checkHeaders . -t lastCommit",
14-
"check:pr": "yarn all && yarn format:check && yarn check:headers",
13+
"check:all": "yarn install && yarn lint && yarn test && yarn format:check && yarn headers:check",
1514
"clean": "lerna run clean && rimraf coverage .nyc_output",
1615
"compile": "tsc -b",
16+
"fix:all": "yarn lint:fix && yarn format && yarn headers:fix",
1717
"format": "prettier --write .",
1818
"format:check": "prettier --check .",
1919
"generate:index": "lerna run generate:index && yarn lint:fix",
20-
"lint": "eslint --ext .ts,.tsx .",
20+
"headers:check": "glsp checkHeaders .",
21+
"headers:fix": "glsp checkHeaders . --autoFix",
22+
"lint": "eslint .",
2123
"lint:ci": "yarn lint --output-file eslint_report.json --format json",
2224
"lint:fix": "yarn lint --fix",
2325
"prepare": " yarn compile && yarn bundle",

0 commit comments

Comments
 (0)