Skip to content

Commit 94460cb

Browse files
committed
Upgrade project to use latest eslint version
1 parent 597506e commit 94460cb

16 files changed

+366
-362
lines changed

.eslintrc.json

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

.github/workflows/package.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
## make sure this corresponds with the version in release.yml
2424
node-version: latest
2525

26-
2726
- run: yarn install --immutable --immutable-cache --check-cache
2827

2928
- name: Package extension

.vscode-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ module.exports = defineConfig([
88
workspaceFolder: './test-workspace',
99
installExtensions: ['justusadam.language-haskell'],
1010
mocha: {
11-
timeout: 120 * 1000 // 2 minute timeout
12-
}
13-
}
11+
timeout: 120 * 1000, // 2 minute timeout
12+
},
13+
},
1414
// you can specify additional test configurations, too
1515
]);

Changelog.md

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
## 2.5.3
44

55
- Split out packaging action
6-
([#1080](https://github.com/haskell/vscode-haskell/pull/1080)) by @fendor
6+
([#1080](https://github.com/haskell/vscode-haskell/pull/1080)) by @fendor
77
- Add Session Loading style to list of known configs
8-
([#1077](https://github.com/haskell/vscode-haskell/pull/1077)) by @fendor
8+
([#1077](https://github.com/haskell/vscode-haskell/pull/1077)) by @fendor
99
- Tooling update
10-
([#1043](https://github.com/haskell/vscode-haskell/pull/1043)) by @bzm3r
10+
([#1043](https://github.com/haskell/vscode-haskell/pull/1043)) by @bzm3r
1111
- Add `haskell.plugin.fourmolu.config.path` option
12-
([#987](https://github.com/haskell/vscode-haskell/pull/987)) by @georgefst
12+
([#987](https://github.com/haskell/vscode-haskell/pull/987)) by @georgefst
1313

1414
## 2.5.2
1515

@@ -22,94 +22,94 @@
2222
## 2.5.0
2323

2424
- Add tracking of cabal files
25-
([#618](https://github.com/haskell/vscode-haskell/pull/618)) by @fendor
25+
([#618](https://github.com/haskell/vscode-haskell/pull/618)) by @fendor
2626

2727
## 2.4.3
2828

2929
- Address invalid byte sequence error #1022
30-
([#1022](https://github.com/haskell/vscode-haskell/pull/1022)) by @felixlinker
30+
([#1022](https://github.com/haskell/vscode-haskell/pull/1022)) by @felixlinker
3131
- Always set the cwd for the executable (#1011)
32-
([#1011](https://github.com/haskell/vscode-haskell/pull/1011)) by @fendor
32+
([#1011](https://github.com/haskell/vscode-haskell/pull/1011)) by @fendor
3333

3434
## 2.4.2
3535

3636
- Add stan plugin option #1000
37-
([#1000](https://github.com/haskell/vscode-haskell/pull/1000)) by @fendor
37+
([#1000](https://github.com/haskell/vscode-haskell/pull/1000)) by @fendor
3838
- Probe for GHCup binary wrt #962
39-
([#963](https://github.com/haskell/vscode-haskell/pull/963)) by @hasufell
39+
([#963](https://github.com/haskell/vscode-haskell/pull/963)) by @hasufell
4040
- Bump old hls version and upgrade test runner to macos-latest
41-
([#960](https://github.com/haskell/vscode-haskell/pull/960)) by @July541
41+
([#960](https://github.com/haskell/vscode-haskell/pull/960)) by @July541
4242
- Increase time limitation to make test on Windows more stable
43-
([#959](https://github.com/haskell/vscode-haskell/pull/959)) by @July541
43+
([#959](https://github.com/haskell/vscode-haskell/pull/959)) by @July541
4444
- Update release docs for refreshing CI tokens
45-
([#942](https://github.com/haskell/vscode-haskell/pull/942)) by @fendor
45+
([#942](https://github.com/haskell/vscode-haskell/pull/942)) by @fendor
4646

4747
## 2.4.1
4848

4949
- Downgrade vscode-languageclient
50-
([#934](https://github.com/haskell/vscode-haskell/pull/934)) by @fendor
50+
([#934](https://github.com/haskell/vscode-haskell/pull/934)) by @fendor
5151
- Bump vscode to 1.80.0
52-
([#912](https://github.com/haskell/vscode-haskell/pull/912)) by @July541
52+
([#912](https://github.com/haskell/vscode-haskell/pull/912)) by @July541
5353

5454
## 2.4.0
5555

5656
- Prepare release 2.4.0
57-
([#906](https://github.com/haskell/vscode-haskell/pull/906)) by @VeryMilkyJoe
57+
([#906](https://github.com/haskell/vscode-haskell/pull/906)) by @VeryMilkyJoe
5858
- Simplify tests
59-
([#904](https://github.com/haskell/vscode-haskell/pull/904)) by @July541
59+
([#904](https://github.com/haskell/vscode-haskell/pull/904)) by @July541
6060
- Remove unused code
61-
([#898](https://github.com/haskell/vscode-haskell/pull/898)) by @fendor
61+
([#898](https://github.com/haskell/vscode-haskell/pull/898)) by @fendor
6262
- Remove hoogle command from vscode extension
63-
([#896](https://github.com/haskell/vscode-haskell/pull/896)) by @fendor
63+
([#896](https://github.com/haskell/vscode-haskell/pull/896)) by @fendor
6464
- Update readme
65-
([#886](https://github.com/haskell/vscode-haskell/pull/886)) by @VeryMilkyJoe
65+
([#886](https://github.com/haskell/vscode-haskell/pull/886)) by @VeryMilkyJoe
6666
- Fix broken tests
67-
([#880](https://github.com/haskell/vscode-haskell/pull/880)) by @July541
67+
([#880](https://github.com/haskell/vscode-haskell/pull/880)) by @July541
6868
- Update README.md: clarify how to use Stack with vscode-haskell extension
69-
([#874](https://github.com/haskell/vscode-haskell/pull/874)) by @miguel-negrao
69+
([#874](https://github.com/haskell/vscode-haskell/pull/874)) by @miguel-negrao
7070
- Remove debugger tools from CI
71-
([#873](https://github.com/haskell/vscode-haskell/pull/873)) by @fendor
71+
([#873](https://github.com/haskell/vscode-haskell/pull/873)) by @fendor
7272
- Refactor tests to work correctly
73-
([#872](https://github.com/haskell/vscode-haskell/pull/872)) by @July541
73+
([#872](https://github.com/haskell/vscode-haskell/pull/872)) by @July541
7474
- Downgrade vscode language client to 7.0.0
75-
([#853](https://github.com/haskell/vscode-haskell/pull/853)) by @fendor
75+
([#853](https://github.com/haskell/vscode-haskell/pull/853)) by @fendor
7676
- Update badge url for VSCode Marketplace
77-
([#851](https://github.com/haskell/vscode-haskell/pull/851)) by @fendor
77+
([#851](https://github.com/haskell/vscode-haskell/pull/851)) by @fendor
7878

7979
## 2.2.4
8080

81-
- Downgrade vscode language client to 7.0.0
82-
([#843](https://github.com/haskell/vscode-haskell/pull/853)) by @fendor
81+
- Downgrade vscode language client to 7.0.0
82+
([#843](https://github.com/haskell/vscode-haskell/pull/853)) by @fendor
8383

8484
## 2.2.3
8585

8686
- Prepare release 2.2.3
87-
([#843](https://github.com/haskell/vscode-haskell/pull/843)) by @fendor
87+
([#843](https://github.com/haskell/vscode-haskell/pull/843)) by @fendor
8888
- Add new plugins fields
89-
([#842](https://github.com/haskell/vscode-haskell/pull/842)) by @fendor
89+
([#842](https://github.com/haskell/vscode-haskell/pull/842)) by @fendor
9090
- Migrate to eslint
91-
([#782](https://github.com/haskell/vscode-haskell/pull/782)) by @fendor
91+
([#782](https://github.com/haskell/vscode-haskell/pull/782)) by @fendor
9292
- Bump minor versions of package dependencies
93-
([#781](https://github.com/haskell/vscode-haskell/pull/781)) by @fendor
93+
([#781](https://github.com/haskell/vscode-haskell/pull/781)) by @fendor
9494
- Update unsupported GHC doc link
95-
([#776](https://github.com/haskell/vscode-haskell/pull/776)) by @limaak
95+
([#776](https://github.com/haskell/vscode-haskell/pull/776)) by @limaak
9696
- Fix release CI
97-
([#775](https://github.com/haskell/vscode-haskell/pull/775)) by @fendor
97+
([#775](https://github.com/haskell/vscode-haskell/pull/775)) by @fendor
9898
- Fix mistake in generated ChangeLog
99-
([#774](https://github.com/haskell/vscode-haskell/pull/774)) by @fendor
99+
([#774](https://github.com/haskell/vscode-haskell/pull/774)) by @fendor
100100

101101
## 2.2.2
102102

103103
- Add link to HLS installation webpage
104-
([#751](https://github.com/haskell/vscode-haskell/pull/751)) by @fendor
104+
([#751](https://github.com/haskell/vscode-haskell/pull/751)) by @fendor
105105
- Change scope of serverExecutablePath to machine-overridable
106-
([#742](https://github.com/haskell/vscode-haskell/pull/742)) by @fendor
106+
([#742](https://github.com/haskell/vscode-haskell/pull/742)) by @fendor
107107
- Add Fourmolu config property
108-
([#736](https://github.com/haskell/vscode-haskell/pull/736)) by @georgefst
108+
([#736](https://github.com/haskell/vscode-haskell/pull/736)) by @georgefst
109109
- Add missing configuration options for the latest HLS version
110-
([#717](https://github.com/haskell/vscode-haskell/pull/717)) by @fendor
110+
([#717](https://github.com/haskell/vscode-haskell/pull/717)) by @fendor
111111
- Change sensible to sensitive
112-
([#709](https://github.com/haskell/vscode-haskell/pull/709)) by @ploeh
112+
([#709](https://github.com/haskell/vscode-haskell/pull/709)) by @ploeh
113113

114114
## 2.2.1
115115

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,6 @@ You can check each GHC version's support status and the policy followed for depr
212212

213213
The exact list of binaries can be checked in the last release of haskell-language-server: <https://github.com/haskell/haskell-language-server/releases/latest>
214214

215-
216-
217215
## Using multi-root workspaces
218216

219217
First, check out [what multi-root workspaces](https://code.visualstudio.com/docs/editor/multi-root-workspaces) are. The idea of using multi-root workspaces, is to be able to work on several different Haskell projects, where the GHC version or stackage LTS could differ, and have it work smoothly.
@@ -262,6 +260,7 @@ setup-info:
262260
9.0.2:
263261
url: 'https://downloads.haskell.org/ghc/9.0.2/ghc-9.0.2a-x86_64-fedora27-linux.tar.xz'
264262
```
263+
265264
Now make sure to remove cached/installed libraries to avoid getting segfaults at runtime.
266265
267266
As a final workaround, you can try to compile HLS from source (the extension should pick it up) via ghcup, see [https://haskell-language-server.readthedocs.io/en/stable/installation.html#ghcup](https://haskell-language-server.readthedocs.io/en/stable/installation.html#ghcup). In any case, the recommended approach is to let GHCup install the GHC binaries.

docs/Release.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ Follow this list for items that must be completed for release of the `vscode-has
2121
Sometimes there is a release (stable) and pre-release (unstable) at the same time and we need to do a release for the stable release and sometimes we need to do a release for the pre-release series.
2222
To simplify the release management, the following policy is in place:
2323

24-
* The branch `master` contains the current pre-release
25-
* As such, its `package.json` must always have the form `major.ODD_NUMBER.patch`
26-
* Dependency version bumps are automatically performed by dependabot against `master`
27-
* For each release, a tag must be created
28-
* Stable releases are located on a separate branch called `release-<major.EVEN_NUMBER>`
29-
* Before a release, the branch is rebased on top of current master
30-
* For each stable release, a tag must be created of the form `major.EVEN_NUMBER.patch`
24+
- The branch `master` contains the current pre-release
25+
- As such, its `package.json` must always have the form `major.ODD_NUMBER.patch`
26+
- Dependency version bumps are automatically performed by dependabot against `master`
27+
- For each release, a tag must be created
28+
- Stable releases are located on a separate branch called `release-<major.EVEN_NUMBER>`
29+
- Before a release, the branch is rebased on top of current master
30+
- For each stable release, a tag must be created of the form `major.EVEN_NUMBER.patch`
3131

3232
## Release CI
3333

@@ -37,9 +37,9 @@ Seemingly, the VSX Marketplace token does not expire. If it is lost for some rea
3737

3838
The latter needs to be refreshed once a year.
3939

40-
* Send an email to `[email protected]` requesting the token
41-
* Include your public GPG key so they can send you the token encrypted
42-
* Update the repository secrets
43-
* People from the [@haskell-ide](https://github.com/orgs/haskell/teams/haskell-ide) have full access to the vscode-haskell repo and can update secrets
40+
- Send an email to `[email protected]` requesting the token
41+
- Include your public GPG key so they can send you the token encrypted
42+
- Update the repository secrets
43+
- People from the [@haskell-ide](https://github.com/orgs/haskell/teams/haskell-ide) have full access to the vscode-haskell repo and can update secrets
4444

4545
Last time the VSCode Marketplace token was updated: 2023-08-17

eslint.config.mjs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import globals from 'globals';
2+
import pluginJs from '@eslint/js';
3+
import tseslint from 'typescript-eslint';
4+
5+
export default [
6+
{ files: ['**/*.{js,mjs,cjs,ts}'] },
7+
{ languageOptions: { globals: globals.node } },
8+
{
9+
...pluginJs.configs.recommended,
10+
rules: {
11+
'@typescript-eslint/no-explicit-any': 'off',
12+
'@typescript-eslint/no-unused-vars': [
13+
'error',
14+
{
15+
args: 'all',
16+
argsIgnorePattern: '^_',
17+
caughtErrors: 'all',
18+
caughtErrorsIgnorePattern: '^_',
19+
destructuredArrayIgnorePattern: '^_',
20+
varsIgnorePattern: '^_',
21+
ignoreRestSiblings: true,
22+
},
23+
],
24+
},
25+
},
26+
...tseslint.configs.recommended,
27+
];

package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,8 +1289,8 @@
12891289
"vscode:prepublish": "webpack --mode production",
12901290
"webpack": "webpack --mode none",
12911291
"watch": "webpack --mode development --watch",
1292-
"lint": "eslint -c .eslintrc.json --ext .ts src",
1293-
"lint-fix": "eslint --fix -c .eslintrc.json --ext .ts src",
1292+
"lint": "eslint -c eslint.config.mjs src",
1293+
"lint-fix": "eslint --fix -c eslint.config.mjs src",
12941294
"push-tag": "git tag -a $npm_package_version -m \"Version $npm_package_version\" && git push origin $npm_package_version",
12951295
"pretest": "tsc --alwaysStrict -p ./",
12961296
"format": "prettier . --write",
@@ -1302,23 +1302,26 @@
13021302
}
13031303
},
13041304
"devDependencies": {
1305+
"@eslint/js": "^9.13.0",
13051306
"@types/glob": "^8.1.0",
13061307
"@types/mocha": "^10.0.9",
13071308
"@types/node": "^22.7.7",
13081309
"@types/vscode": "^1.88.0",
13091310
"@types/which": "^3.0.4",
1310-
"@typescript-eslint/eslint-plugin": "^7.18.0",
1311-
"@typescript-eslint/parser": "^7.18.0",
1311+
"@typescript-eslint/eslint-plugin": "^8.11.0",
1312+
"@typescript-eslint/parser": "^8.11.0",
13121313
"@vscode/test-cli": "^0.0.10",
13131314
"@vscode/test-electron": "^2.4.1",
1314-
"eslint": "^8.57.0",
1315+
"eslint": "^9.13.0",
13151316
"eslint-webpack-plugin": "^4.2.0",
13161317
"glob": "^11.0.0",
1318+
"globals": "^15.11.0",
13171319
"husky": "^9.1.6",
13181320
"mocha": "^10.7.3",
13191321
"prettier": "^3.3.3",
13201322
"ts-loader": "^9.5.1",
13211323
"typescript": "^5.5.4",
1324+
"typescript-eslint": "^8.11.0",
13221325
"webpack": "^5.95.0",
13231326
"webpack-cli": "^5.1.1"
13241327
},

src/docsBrowser.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
12
import { dirname } from 'path';
23
import {
34
CancellationToken,
@@ -99,7 +100,7 @@ export function hoverLinksMiddlewareHook(
99100
document: TextDocument,
100101
position: Position,
101102
token: CancellationToken,
102-
next: ProvideHoverSignature
103+
next: ProvideHoverSignature,
103104
): ProviderResult<Hover> {
104105
const res = next(document, position, token);
105106
return Promise.resolve(res).then((r) => {
@@ -115,7 +116,7 @@ export function completionLinksMiddlewareHook(
115116
position: Position,
116117
context: CompletionContext,
117118
token: CancellationToken,
118-
next: ProvideCompletionItemsSignature
119+
next: ProvideCompletionItemsSignature,
119120
): ProviderResult<CompletionItem[] | CompletionList> {
120121
const res = next(document, position, context, token);
121122

@@ -141,7 +142,7 @@ function processLink(ms: MarkdownString | MarkedString): string | MarkdownString
141142
function transform(s: string): string {
142143
return s.replace(
143144
/\[(.+)\]\((file:.+\/doc\/(?:.*html\/libraries\/)?([^/]+)\/(?:.*\/)?(.+\.html#?.*))\)/gi,
144-
(all, title, localPath, packageName, fileAndAnchor) => {
145+
(_all, title, localPath, packageName, fileAndAnchor) => {
145146
let hackageUri: string;
146147
if (title === 'Documentation') {
147148
hackageUri = `https://hackage.haskell.org/package/${packageName}/docs/${fileAndAnchor}`;
@@ -156,7 +157,7 @@ function processLink(ms: MarkdownString | MarkedString): string | MarkdownString
156157
} else if (title === 'Source') {
157158
hackageUri = `https://hackage.haskell.org/package/${packageName}/docs/src/${fileAndAnchor.replace(
158159
/-/gi,
159-
'.'
160+
'.',
160161
)}`;
161162
const encoded = encodeURIComponent(JSON.stringify({ title, localPath, hackageUri }));
162163
let cmd: string;
@@ -169,7 +170,7 @@ function processLink(ms: MarkdownString | MarkedString): string | MarkdownString
169170
} else {
170171
return s;
171172
}
172-
}
173+
},
173174
);
174175
}
175176
if (typeof ms === 'string') {

src/errors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Uri } from 'vscode';
22

3-
export class HlsError extends Error { }
3+
export class HlsError extends Error {}
44

55
export class MissingToolError extends HlsError {
66
public readonly tool: string;

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ async function activateServerForFolder(context: ExtensionContext, uri: Uri, fold
153153
context,
154154
logger,
155155
currentWorkingDir,
156-
folder
156+
folder,
157157
);
158158
if (!serverExecutable) {
159159
return;

0 commit comments

Comments
 (0)