Skip to content

Commit eec48b0

Browse files
authored
GLSP-1634: Switch to eslint 9.x (#42)
Part of eclipse-glsp/glsp/issues/1634
1 parent 1b72d2a commit eec48b0

19 files changed

Lines changed: 706 additions & 1137 deletions

.eslintignore

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

.eslintrc.js

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

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,8 @@ examples/workflow-test/playwright/.storage/*.json
1616
*.vsix
1717
!*.env.example
1818
*.env
19+
20+
./claude/settings.local.json
21+
.claude/plans
22+
.reviews
23+
CLAUDE.local.md

AGENTS.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Repository Guidelines
2+
3+
## Project Structure & Module Organization
4+
5+
This repository is a Yarn workspaces monorepo.
6+
7+
- `packages/glsp-playwright/`: core library source (`src/`) and build output (`lib/`).
8+
- `examples/workflow-test/`: runnable Playwright example with page objects in `src/` and tests in `tests/`.
9+
- `docs/`: concept docs (`integration`, `extension`, `metadata`, and Playwright differences).
10+
- Root config files (`tsconfig.json`, `eslint.config.mjs`, `lerna.json`) define shared tooling.
11+
12+
Use `packages/*` for reusable framework code and `examples/*` for integration demos and test fixtures.
13+
14+
## Build, Test, and Development Commands
15+
16+
Run from repository root unless noted.
17+
18+
- `yarn install`: install all workspace dependencies.
19+
- `yarn build`: compile TypeScript project references and rewrite path aliases.
20+
- `yarn lint`: run ESLint across the monorepo.
21+
- `yarn format` / `yarn format:check`: apply/check Prettier formatting.
22+
- `yarn test`: run example Playwright suite (`examples/workflow-test`).
23+
- `yarn test:standalone`, `yarn test:theia`, `yarn test:vscode`: run integration-specific test projects.
24+
- `yarn watch`: watch and rebuild TypeScript + alias output during development.
25+
26+
## Coding Style & Naming Conventions
27+
28+
- Language: TypeScript (`.ts`), 4-space indentation (follow existing files).
29+
- Formatting: Prettier via `@eclipse-glsp/prettier-config`.
30+
- Linting: ESLint (`eslint.config.mjs`) with strict TypeScript rules (for example, no floating promises).
31+
- Naming patterns:
32+
- Tests: `*.spec.ts` under `examples/workflow-test/tests/**`.
33+
- Page objects/helpers: `*.po.ts`, `*.capability.ts`, `*.integration.ts`.
34+
- Keep feature folders aligned with GLSP feature names (`tool-palette`, `validation`, `undo-redo`, etc.).
35+
36+
## Testing Guidelines
37+
38+
Tests use Playwright (`@playwright/test`) and run from compiled output (`examples/workflow-test/lib/tests`).
39+
40+
- Build before testing when sources changed: `yarn build`.
41+
- Prefer targeted runs during development, then run `yarn test` before opening a PR.
42+
- Keep tests deterministic and cover standalone, Theia, and VS Code paths when relevant.
43+
44+
## Commit & Pull Request Guidelines
45+
46+
Commit history favors short, imperative subjects, often with issue IDs (example: `GLSP-1563: Update to node 20 and Theia 1.64.x`).
47+
48+
- Reference related issue IDs in commit/PR text when available.
49+
- PRs should fill all template sections in `.github/PULL_REQUEST_TEMPLATE.md`:
50+
`What it does`, `How to test`, `Follow-ups`, and `Changelog` impact.
51+
- Do not disclose vulnerabilities in issues/PRs; follow `SECURITY.md`.

CLAUDE.md

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

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+
{
6+
ignores: ['**/*.js', '**/*.mjs', '**/*.cjs', '**/dist/', '**/lib/', '**/repositories/', '**/*.map']
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+
'@typescript-eslint/no-floating-promises': 'error',
18+
'no-null/no-null': 'off',
19+
'no-restricted-imports': [
20+
'error',
21+
{
22+
paths: [
23+
{
24+
name: 'sprotty',
25+
message:
26+
"The sprotty default exports are customized and reexported by GLSP. Please use '@eclipse-glsp/client' instead"
27+
},
28+
{
29+
name: 'sprotty-protocol',
30+
message:
31+
"The sprotty default exports are customized and reexported by GLSP. Please use '@eclipse-glsp/client' instead"
32+
}
33+
],
34+
patterns: ['**/../index']
35+
}
36+
]
37+
},
38+
settings: {
39+
'import-x/resolver': {
40+
typescript: {
41+
project: 'tsconfig.json'
42+
}
43+
}
44+
}
45+
}
46+
];

examples/workflow-test/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"scripts": {
3535
"build": "tsc -b",
3636
"clean": "rimraf --glob lib tsconfig.tsbuildinfo server/*.log",
37-
"lint": "eslint --ext .ts,.tsx ./src ./tests",
37+
"lint": "eslint ./src ./tests",
3838
"prepare": "playwright install",
3939
"repo": "ts-node ./scripts/repositories.ts",
4040
"start:server": "node node_modules/@eclipse-glsp-examples/workflow-server-bundled/wf-glsp-server-node.js",

examples/workflow-test/tests/core/debug.standalone.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (c) 2024-2025 EclipseSource and others.
2+
* Copyright (c) 2024-2026 EclipseSource 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 max-len */
1716

1817
import { expect, extractDebugInformationOfGLSPLocator, extractMetaTree, test } from '@eclipse-glsp/glsp-playwright/';
1918
import { WorkflowApp } from '../../src/app/workflow-app';

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,21 @@
1212
]
1313
},
1414
"scripts": {
15-
"all": "yarn clean && yarn install && yarn lint",
1615
"build": "yarn compile && yarn compile:alias",
17-
"check:headers": "glsp checkHeaders . -t lastCommit",
18-
"check:pr": "yarn all && yarn format:checkyarn && check:headers",
16+
"check:all": "yarn install && yarn lint && yarn format:check && yarn headers:check",
1917
"clean": "lerna run clean",
2018
"compile": "tsc -b",
2119
"compile:alias": "lerna run compile:alias",
2220
"example": "yarn -s --cwd ./examples/workflow-test",
21+
"fix:all": "yarn lint:fix && yarn format && yarn headers:fix",
2322
"format": "prettier --write .",
2423
"format:check": "prettier --check .",
25-
"generate:index": "lerna run generate:index && yarn lint:fix",
26-
"lint": "eslint --ext .ts,.tsx .",
24+
"generate:index": "lerna run generate:index && yarn lint:fix",
25+
"headers:check": "glsp checkHeaders .",
26+
"headers:fix": "glsp checkHeaders . --autoFix",
27+
"lint": "eslint .",
2728
"lint:ci": "yarn lint --output-file eslint_report.json --format json",
28-
"lint:fix": " yarn lint --fix",
29+
"lint:fix": "yarn lint --fix",
2930
"prepare": "lerna run prepare && yarn build",
3031
"publish:latest": "lerna publish from-package --no-git-reset -y",
3132
"publish:next": "lerna publish preminor --exact --canary --preid next --dist-tag next --no-git-tag-version --no-push --ignore-scripts --yes",
@@ -43,7 +44,6 @@
4344
"@estruyf/github-actions-reporter": "^1.7.0",
4445
"@types/node": "20.x",
4546
"concurrently": "^8.2.2",
46-
"eslint-import-resolver-typescript": "^3.5.3",
4747
"lerna": "^9.0.0",
4848
"mocha-ctrf-json-reporter": "0.0.9",
4949
"tsc-alias": "1.8.10",

packages/glsp-playwright/.eslintrc.js

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

0 commit comments

Comments
 (0)