Skip to content

Commit 8400cbe

Browse files
authored
Upgrade to latest server version (add support for eslint 8) (#49)
1 parent 310a198 commit 8400cbe

File tree

9 files changed

+655
-403
lines changed

9 files changed

+655
-403
lines changed

LSP-eslint.sublime-settings

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,60 @@
11
{
22
"settings": {
3+
// Whether to use the ESLint class API even if the CLIEngine API is present. The setting is only honored
4+
// when using using ESLint version 7.x.
5+
"useESLintClass": false,
6+
// Show disable lint rule in the quick fix menu.
37
"codeAction.disableRuleComment": {
48
// Show the disable code actions.
59
"enable": true,
610
// Configure the disable rule code action to insert the comment on the `sameLine` or `separateLine`.
711
"location": "separateLine"
812
},
13+
// Show open lint rule documentation web page in the quick fix.
914
"codeAction.showDocumentation": {
1015
// Show the documentation code actions.
1116
"enable": true
1217
},
1318
"codeActionOnSave.enable": true,
1419
// Specifies the code action mode. Possible values are 'all' and 'problems'.
1520
"codeActionOnSave.mode": "all",
21+
// The rules that should be executed when computing the code actions on save or formatting a file.
22+
// Defaults to the rules configured via the ESLint configuration.
23+
// An empty array results in no rules being considered.
24+
// If the array contains more than one entry the order matters and the first match determines the rule's
25+
// on/off state. This setting is only honored if either ESLint version 8 or greater is used or ESLint
26+
// version 7 is used and the setting `useESLintClass` is set to `true`.
27+
//
28+
// In this example only semicolon related rules are considered:
29+
//
30+
// ```json
31+
// "codeActionOnSave.rules": [
32+
// "*semi*"
33+
// ]
34+
// ```
35+
//
36+
// This example removes all TypeScript ESLint specific rules from the code action on save pass but
37+
// keeps all other rules:
38+
//
39+
// ```json
40+
// "codeActionOnSave.rules": [
41+
// "!@typescript-eslint/*",
42+
// "*"
43+
// ]
44+
// ```
45+
//
46+
// This example keeps the indent and semi rule from TypeScript ESLint, disables all other TypeScript
47+
// ESLint rules and keeps the rest:
48+
//
49+
// ```json
50+
// "codeActionOnSave.rules": [
51+
// "@typescript-eslint/semi",
52+
// "@typescript-eslint/indent",
53+
// "!@typescript-eslint/*",
54+
// "*"
55+
// ]
56+
// ```
57+
// "codeActionOnSave.rules": [],
1658
// Deprecated. Recommended to use the global LSP option `lsp_code_actions_on_save` with the.
1759
// `"source.fixAll.eslint": true` key instead.
1860
"format": false,
@@ -21,8 +63,21 @@
2163
// Whether ESLint should issue a warning on ignored files.
2264
// Possible values: `warn`, `off`
2365
"onIgnoredFiles": "off",
24-
// The eslint options object to provide args normally passed to eslint when
25-
// executed from a command line (see https://eslint.org/docs/developer-guide/nodejs-api#cliengine).
66+
// Options to configure how ESLint is started using the [ESLint class API](http://eslint.org/docs/developer-guide/nodejs-api#eslint-class).
67+
// The server uses the ESLint class API if ESLint version 8 or higher is used or if ESLint version 7 is used,
68+
// and the setting `useESLintClass` is set to `true`. I all other cases the old CLIEngine API is used.
69+
// An example to point to a custom `.eslintrc.json` file using the new ESLint API is:
70+
// ```json
71+
// {
72+
// "eslint.options": { "overrideConfigFile": "C:/mydirectory/.eslintrc.json" }
73+
// }
74+
// ```
75+
// An example to point to a custom `.eslintrc.json` file using the old CLIEngine API is:
76+
// ```json
77+
// {
78+
// "eslint.options": { "configFile": "C:/mydirectory/.eslintrc.json" }
79+
// }
80+
// ```
2681
"options": {},
2782
// The package manager you use to install node modules.
2883
// Possible values: `npm`, `yarn`, `pnpm`
@@ -73,7 +128,7 @@
73128
"env": {
74129
// Enables ESLint debug mode
75130
// "DEBUG": "eslint:*,-eslint:code-path",
76-
// The value of NODE_ENV to use when running eslint tasks.
131+
// The value of `NODE_ENV` to use when running eslint tasks.
77132
// "NODE_ENV": "production",
78133
},
79134
"languages": [

language-server/compile-language-server.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ if [ "${ref}" = "" ]; then
3434
ref="main"
3535
fi
3636

37-
temp_zip="src-${ref}.zip"
38-
curl -L "${GITHUB_REPO_URL}/archive/${ref}.zip" -o "${temp_zip}"
37+
temp_zip="src-${ref//\//-}.zip"
38+
download_url="${GITHUB_REPO_URL}/archive/${ref}.zip"
39+
echo "Downloading ${download_url}"
40+
curl -L "${download_url}" -o "${temp_zip}"
3941
unzip -z "${temp_zip}" > update-info.log
4042
unzip "${temp_zip}" && rm -f "${temp_zip}"
4143
mv "${GITHUB_REPO_NAME}-"*/* "${TEMP_DIR}"

0 commit comments

Comments
 (0)