Skip to content

Commit

Permalink
Upgrade project to use latest eslint version (#1150)
Browse files Browse the repository at this point in the history
  • Loading branch information
fendor authored Oct 22, 2024
1 parent 597506e commit 24ee810
Show file tree
Hide file tree
Showing 16 changed files with 366 additions and 362 deletions.
25 changes: 0 additions & 25 deletions .eslintrc.json

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
## make sure this corresponds with the version in release.yml
node-version: latest


- run: yarn install --immutable --immutable-cache --check-cache

- name: Package extension
Expand Down
6 changes: 3 additions & 3 deletions .vscode-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ module.exports = defineConfig([
workspaceFolder: './test-workspace',
installExtensions: ['justusadam.language-haskell'],
mocha: {
timeout: 120 * 1000 // 2 minute timeout
}
}
timeout: 120 * 1000, // 2 minute timeout
},
},
// you can specify additional test configurations, too
]);
78 changes: 39 additions & 39 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
## 2.5.3

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

## 2.5.2

Expand All @@ -22,94 +22,94 @@
## 2.5.0

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

## 2.4.3

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

## 2.4.2

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

## 2.4.1

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

## 2.4.0

- Prepare release 2.4.0
([#906](https://github.com/haskell/vscode-haskell/pull/906)) by @VeryMilkyJoe
([#906](https://github.com/haskell/vscode-haskell/pull/906)) by @VeryMilkyJoe
- Simplify tests
([#904](https://github.com/haskell/vscode-haskell/pull/904)) by @July541
([#904](https://github.com/haskell/vscode-haskell/pull/904)) by @July541
- Remove unused code
([#898](https://github.com/haskell/vscode-haskell/pull/898)) by @fendor
([#898](https://github.com/haskell/vscode-haskell/pull/898)) by @fendor
- Remove hoogle command from vscode extension
([#896](https://github.com/haskell/vscode-haskell/pull/896)) by @fendor
([#896](https://github.com/haskell/vscode-haskell/pull/896)) by @fendor
- Update readme
([#886](https://github.com/haskell/vscode-haskell/pull/886)) by @VeryMilkyJoe
([#886](https://github.com/haskell/vscode-haskell/pull/886)) by @VeryMilkyJoe
- Fix broken tests
([#880](https://github.com/haskell/vscode-haskell/pull/880)) by @July541
([#880](https://github.com/haskell/vscode-haskell/pull/880)) by @July541
- Update README.md: clarify how to use Stack with vscode-haskell extension
([#874](https://github.com/haskell/vscode-haskell/pull/874)) by @miguel-negrao
([#874](https://github.com/haskell/vscode-haskell/pull/874)) by @miguel-negrao
- Remove debugger tools from CI
([#873](https://github.com/haskell/vscode-haskell/pull/873)) by @fendor
([#873](https://github.com/haskell/vscode-haskell/pull/873)) by @fendor
- Refactor tests to work correctly
([#872](https://github.com/haskell/vscode-haskell/pull/872)) by @July541
([#872](https://github.com/haskell/vscode-haskell/pull/872)) by @July541
- Downgrade vscode language client to 7.0.0
([#853](https://github.com/haskell/vscode-haskell/pull/853)) by @fendor
([#853](https://github.com/haskell/vscode-haskell/pull/853)) by @fendor
- Update badge url for VSCode Marketplace
([#851](https://github.com/haskell/vscode-haskell/pull/851)) by @fendor
([#851](https://github.com/haskell/vscode-haskell/pull/851)) by @fendor

## 2.2.4

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

## 2.2.3

- Prepare release 2.2.3
([#843](https://github.com/haskell/vscode-haskell/pull/843)) by @fendor
([#843](https://github.com/haskell/vscode-haskell/pull/843)) by @fendor
- Add new plugins fields
([#842](https://github.com/haskell/vscode-haskell/pull/842)) by @fendor
([#842](https://github.com/haskell/vscode-haskell/pull/842)) by @fendor
- Migrate to eslint
([#782](https://github.com/haskell/vscode-haskell/pull/782)) by @fendor
([#782](https://github.com/haskell/vscode-haskell/pull/782)) by @fendor
- Bump minor versions of package dependencies
([#781](https://github.com/haskell/vscode-haskell/pull/781)) by @fendor
([#781](https://github.com/haskell/vscode-haskell/pull/781)) by @fendor
- Update unsupported GHC doc link
([#776](https://github.com/haskell/vscode-haskell/pull/776)) by @limaak
([#776](https://github.com/haskell/vscode-haskell/pull/776)) by @limaak
- Fix release CI
([#775](https://github.com/haskell/vscode-haskell/pull/775)) by @fendor
([#775](https://github.com/haskell/vscode-haskell/pull/775)) by @fendor
- Fix mistake in generated ChangeLog
([#774](https://github.com/haskell/vscode-haskell/pull/774)) by @fendor
([#774](https://github.com/haskell/vscode-haskell/pull/774)) by @fendor

## 2.2.2

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

## 2.2.1

Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,6 @@ You can check each GHC version's support status and the policy followed for depr

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>



## Using multi-root workspaces

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.
Expand Down Expand Up @@ -262,6 +260,7 @@ setup-info:
9.0.2:
url: 'https://downloads.haskell.org/ghc/9.0.2/ghc-9.0.2a-x86_64-fedora27-linux.tar.xz'
```
Now make sure to remove cached/installed libraries to avoid getting segfaults at runtime.
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.
Expand Down
22 changes: 11 additions & 11 deletions docs/Release.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ Follow this list for items that must be completed for release of the `vscode-has
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.
To simplify the release management, the following policy is in place:

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

## Release CI

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

The latter needs to be refreshed once a year.

* Send an email to `[email protected]` requesting the token
* Include your public GPG key so they can send you the token encrypted
* Update the repository secrets
* 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
- Send an email to `[email protected]` requesting the token
- Include your public GPG key so they can send you the token encrypted
- Update the repository secrets
- 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

Last time the VSCode Marketplace token was updated: 2023-08-17
27 changes: 27 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';

export default [
{ files: ['**/*.{js,mjs,cjs,ts}'] },
{ languageOptions: { globals: globals.node } },
{
...pluginJs.configs.recommended,
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
},
},
...tseslint.configs.recommended,
];
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1289,8 +1289,8 @@
"vscode:prepublish": "webpack --mode production",
"webpack": "webpack --mode none",
"watch": "webpack --mode development --watch",
"lint": "eslint -c .eslintrc.json --ext .ts src",
"lint-fix": "eslint --fix -c .eslintrc.json --ext .ts src",
"lint": "eslint -c eslint.config.mjs src",
"lint-fix": "eslint --fix -c eslint.config.mjs src",
"push-tag": "git tag -a $npm_package_version -m \"Version $npm_package_version\" && git push origin $npm_package_version",
"pretest": "tsc --alwaysStrict -p ./",
"format": "prettier . --write",
Expand All @@ -1302,23 +1302,26 @@
}
},
"devDependencies": {
"@eslint/js": "^9.13.0",
"@types/glob": "^8.1.0",
"@types/mocha": "^10.0.9",
"@types/node": "^22.7.7",
"@types/vscode": "^1.88.0",
"@types/which": "^3.0.4",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"@typescript-eslint/eslint-plugin": "^8.11.0",
"@typescript-eslint/parser": "^8.11.0",
"@vscode/test-cli": "^0.0.10",
"@vscode/test-electron": "^2.4.1",
"eslint": "^8.57.0",
"eslint": "^9.13.0",
"eslint-webpack-plugin": "^4.2.0",
"glob": "^11.0.0",
"globals": "^15.11.0",
"husky": "^9.1.6",
"mocha": "^10.7.3",
"prettier": "^3.3.3",
"ts-loader": "^9.5.1",
"typescript": "^5.5.4",
"typescript-eslint": "^8.11.0",
"webpack": "^5.95.0",
"webpack-cli": "^5.1.1"
},
Expand Down
11 changes: 6 additions & 5 deletions src/docsBrowser.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { dirname } from 'path';
import {
CancellationToken,
Expand Down Expand Up @@ -99,7 +100,7 @@ export function hoverLinksMiddlewareHook(
document: TextDocument,
position: Position,
token: CancellationToken,
next: ProvideHoverSignature
next: ProvideHoverSignature,
): ProviderResult<Hover> {
const res = next(document, position, token);
return Promise.resolve(res).then((r) => {
Expand All @@ -115,7 +116,7 @@ export function completionLinksMiddlewareHook(
position: Position,
context: CompletionContext,
token: CancellationToken,
next: ProvideCompletionItemsSignature
next: ProvideCompletionItemsSignature,
): ProviderResult<CompletionItem[] | CompletionList> {
const res = next(document, position, context, token);

Expand All @@ -141,7 +142,7 @@ function processLink(ms: MarkdownString | MarkedString): string | MarkdownString
function transform(s: string): string {
return s.replace(
/\[(.+)\]\((file:.+\/doc\/(?:.*html\/libraries\/)?([^/]+)\/(?:.*\/)?(.+\.html#?.*))\)/gi,
(all, title, localPath, packageName, fileAndAnchor) => {
(_all, title, localPath, packageName, fileAndAnchor) => {
let hackageUri: string;
if (title === 'Documentation') {
hackageUri = `https://hackage.haskell.org/package/${packageName}/docs/${fileAndAnchor}`;
Expand All @@ -156,7 +157,7 @@ function processLink(ms: MarkdownString | MarkedString): string | MarkdownString
} else if (title === 'Source') {
hackageUri = `https://hackage.haskell.org/package/${packageName}/docs/src/${fileAndAnchor.replace(
/-/gi,
'.'
'.',
)}`;
const encoded = encodeURIComponent(JSON.stringify({ title, localPath, hackageUri }));
let cmd: string;
Expand All @@ -169,7 +170,7 @@ function processLink(ms: MarkdownString | MarkedString): string | MarkdownString
} else {
return s;
}
}
},
);
}
if (typeof ms === 'string') {
Expand Down
2 changes: 1 addition & 1 deletion src/errors.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Uri } from 'vscode';

export class HlsError extends Error { }
export class HlsError extends Error {}

export class MissingToolError extends HlsError {
public readonly tool: string;
Expand Down
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ async function activateServerForFolder(context: ExtensionContext, uri: Uri, fold
context,
logger,
currentWorkingDir,
folder
folder,
);
if (!serverExecutable) {
return;
Expand Down
Loading

0 comments on commit 24ee810

Please sign in to comment.