Skip to content

Commit 0c0fe2f

Browse files
authored
GLSP-1634: Switch to eslint 9.x (#124)
Closes eclipse-glsp/glsp/issues/1634
1 parent 18b46ee commit 0c0fe2f

File tree

11 files changed

+702
-1071
lines changed

11 files changed

+702
-1071
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
.m2
22
yarn-cache
3+
4+
/.claude/settings.local.json
5+
/.claude/plans
6+
CLAUDE.local.MD
7+
.reviews

AGENTS.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Repository Guidelines
2+
3+
## Project Structure & Module Organization
4+
This repository is split into two main parts:
5+
- `client/`: TypeScript/Yarn workspace for the GLSP IDE integration package and workflow webapp example.
6+
- `client/packages/ide/src/`: reusable integration source.
7+
- `client/examples/workflow-webapp/src/`: example app source, bundled to `client/examples/workflow-webapp/app/`.
8+
- `server/`: Java 17 + Maven/Tycho Eclipse plugin build.
9+
- `server/plugins/org.eclipse.glsp.ide.editor/src/`: core Eclipse integration plugin.
10+
- `server/example/org.eclipse.glsp.ide.workflow.editor/src/`: workflow editor example plugin.
11+
- `server/releng/`: target platform, feature, and p2 repository modules.
12+
13+
## Build, Test, and Development Commands
14+
- `cd client && yarn install`: install workspace dependencies (Node `>=20`, Yarn 1.x).
15+
- `cd client && yarn build`: compile TS packages and bundle the workflow webapp.
16+
- `cd client && yarn lint`: run ESLint on all TS/TSX sources.
17+
- `cd client && yarn format:check`: verify Prettier formatting.
18+
- `cd client && yarn check:pr`: CI-like client gate (`build`, `lint`, `format:check`, headers).
19+
- `cd client/examples/workflow-webapp && yarn test`: run Mocha specs (`*.spec.ts|tsx`) for the example app.
20+
- `cd server && mvn clean install`: build Eclipse bundles.
21+
- `cd server && mvn clean install -Pp2`: build including p2 artifacts.
22+
- `cd server && mvn checkstyle:check -B`: run Java style checks.
23+
24+
## Coding Style & Naming Conventions
25+
- TypeScript: 4-space indentation, single quotes, trailing commas disabled, max line length 140 (see `.prettierrc`).
26+
- Linting: ESLint with `@eclipse-glsp` config (`client/.eslintrc.js`).
27+
- Java: follow Checkstyle rules configured via Maven (`maven-checkstyle-plugin`).
28+
- Naming: keep existing conventions (`*.spec.ts` for tests, PascalCase Java classes, kebab-case TS file names where already used).
29+
30+
## Testing Guidelines
31+
Prefer targeted tests for changed behavior:
32+
- Client example tests live beside sources and should match `*.spec.ts`/`*.spec.tsx`.
33+
- Run `yarn check:pr` for client-side validation before opening a PR.
34+
- For server changes, run `mvn clean verify` (or at least `mvn clean install`) and `mvn checkstyle:check`.
35+
36+
## Commit & Pull Request Guidelines
37+
- Create/track an umbrella issue first (`https://github.com/eclipse-glsp/glsp/issues/...`).
38+
- Branch naming in upstream repos follows `issues/{issue_number}`.
39+
- Reference the full issue URL in commit messages (not just `#123`).
40+
- Keep commit subjects short, imperative, and specific (history examples include `GLSP-1607: Fix deployment`).
41+
- PRs should include scope, rationale, test evidence (commands run), and screenshots/GIFs for UI changes.

client/.eslintignore

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

client/.eslintrc.js

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

client/CLAUDE.md

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

client/eslint.config.mjs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import glspConfig from '@eclipse-glsp/eslint-config';
2+
3+
export default [
4+
...glspConfig,
5+
{
6+
ignores: ['**/*.js', '**/*.mjs', '**/*.cjs', '**/dist/**', '**/lib/**']
7+
},
8+
{
9+
files: ['**/*.{ts,tsx}'],
10+
languageOptions: {
11+
parserOptions: {
12+
project: './tsconfig.eslint.json',
13+
tsconfigRootDir: import.meta.dirname
14+
}
15+
},
16+
rules: {
17+
'no-restricted-imports': [
18+
'warn',
19+
{
20+
name: 'sprotty',
21+
message: "The sprotty default exports are customized and reexported by GLSP. Please use '@eclipse-glsp/client' instead"
22+
},
23+
{
24+
name: 'sprotty-protocol',
25+
message:
26+
"The sprotty-protocol default exports are customized and reexported by GLSP. Please use '@eclipse-glsp/client' instead"
27+
}
28+
]
29+
}
30+
}
31+
];

client/examples/workflow-webapp/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
"bundle": "yarn compile && webpack",
88
"clean": "rimraf lib tsconfig.tsbuildinfo app/bundle.js app/bundle.js.map",
99
"compile": "tsc -b",
10-
"lint": "eslint --ext .ts,.tsx ./src",
11-
"lint:ci": "yarn lint -o eslint.xml -f checkstyle",
10+
"lint": "eslint ./src",
1211
"test": "mocha --config ../../.mocharc.json \"./src/**/*.spec.?(ts|tsx)\"",
1312
"test:ci": "export JUNIT_REPORT_PATH=./report.xml && yarn test --reporter mocha-jenkins-reporter",
1413
"watch": "webpack -w",

client/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,21 @@
77
"examples/*"
88
],
99
"scripts": {
10-
"all": "yarn build && yarn lint",
1110
"app": "yarn --cwd examples/workflow-webapp",
1211
"build": "yarn compile && yarn app bundle",
13-
"check:headers": "glsp checkHeaders ../../glsp-eclipse-integration -t lastCommit -f ts tsx java -e \"**/src-gen/**\"",
14-
"check:pr": "yarn all && yarn format:check && yarn check:headers",
12+
"check:all": "yarn install && yarn lint && yarn format:check && yarn headers:check",
1513
"clean": "lerna run clean",
1614
"compile": "tsc -b",
1715
"copy:client": "copyfiles -f ./examples/workflow-webapp/app/* ../server/example/org.eclipse.glsp.ide.workflow.editor/diagram",
16+
"fix:all": "yarn lint:fix && yarn format && yarn headers:fix",
1817
"format": "prettier --write .",
1918
"format:check": "prettier --check .",
2019
"generate:index": "lerna run generate:index && yarn lint:fix",
21-
"lint": "eslint --ext .ts,.tsx .",
20+
"headers:check": "glsp checkHeaders ../../glsp-eclipse-integration -f ts tsx java -e \"**/src-gen/**\"",
21+
"headers:fix": "glsp checkHeaders ../../glsp-eclipse-integration -f ts tsx java -e \"**/src-gen/**\" --autoFix",
22+
"lint": "eslint .",
2223
"lint:ci": "yarn lint --output-file eslint_report.json --format json",
23-
"lint:fix": " yarn lint --fix",
24+
"lint:fix": "yarn lint --fix",
2425
"prepare": "yarn build && yarn copy:client",
2526
"publish:latest": "lerna publish from-package --no-git-reset -y",
2627
"publish:next": "lerna publish preminor --exact --canary --preid next --dist-tag next --no-git-reset --no-git-tag-version --no-push --ignore-scripts --yes",

client/packages/ide/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
"build": "tsc -b",
3030
"clean": "rimraf lib tsconfig.tsbuildinfo",
3131
"generate:index": "glsp generateIndex src -f -s",
32-
"lint": "eslint --ext .ts,.tsx ./src",
33-
"lint:ci": "yarn lint -o eslint.xml -f checkstyle",
32+
"lint": "eslint ./src",
3433
"watch": "tsc -w"
3534
},
3635
"dependencies": {

0 commit comments

Comments
 (0)