vscode-eslint 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vscode-eslint-agent
|
|
3
|
+
description: Specialized agent that uses the vscode-eslint LSP server for advanced linting and code analysis.
|
|
4
|
+
kind: local
|
|
5
|
+
# Note: This binary currently speaks LSP. If using as an MCP server, a bridge may be required.
|
|
6
|
+
mcpServers:
|
|
7
|
+
eslint-lsp:
|
|
8
|
+
command: "node"
|
|
9
|
+
args: ["./node_modules/.bin/vscode-eslint", "--stdio"]
|
|
10
|
+
tools:
|
|
11
|
+
- mcp_eslint-lsp_*
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# VSCode ESLint Agent
|
|
15
|
+
|
|
16
|
+
You are an expert at JavaScript/TypeScript linting using the `vscode-eslint` LSP server.
|
|
17
|
+
Your role is to:
|
|
18
|
+
1. Analyze code for style and correctness issues.
|
|
19
|
+
2. Provide precise fixes for identified problems.
|
|
20
|
+
3. Help the user understand complex ESLint configurations and rules.
|
|
21
|
+
|
|
22
|
+
You have access to the `vscode-eslint` binary via an MCP-to-LSP bridge (assumed).
|
|
23
|
+
If you cannot communicate with the server, report the error to the user.
|
|
@@ -8,17 +8,18 @@
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
10
|
const path = require('path');
|
|
11
|
-
const
|
|
11
|
+
const pkg = require('../package.json');
|
|
12
12
|
|
|
13
13
|
function usage(exitCode = 0) {
|
|
14
14
|
const msg = [
|
|
15
|
-
|
|
15
|
+
`vscode-eslint (LSP server) v${pkg.version}`,
|
|
16
16
|
'',
|
|
17
17
|
'Usage:',
|
|
18
18
|
' vscode-eslint --stdio',
|
|
19
19
|
'',
|
|
20
20
|
'Options:',
|
|
21
21
|
' --stdio Use stdio transport (LSP over JSON-RPC on stdin/stdout)',
|
|
22
|
+
' --version Show version',
|
|
22
23
|
' -h, --help Show this help',
|
|
23
24
|
].join('\n');
|
|
24
25
|
if (exitCode === 0) {
|
|
@@ -34,6 +35,11 @@ if (args.includes('-h') || args.includes('--help')) {
|
|
|
34
35
|
usage(0);
|
|
35
36
|
}
|
|
36
37
|
|
|
38
|
+
if (args.includes('--version')) {
|
|
39
|
+
process.stdout.write(`${pkg.version}\n`);
|
|
40
|
+
process.exit(0);
|
|
41
|
+
}
|
|
42
|
+
|
|
37
43
|
const wantsStdio = args.includes('--stdio');
|
|
38
44
|
if (!wantsStdio) {
|
|
39
45
|
process.stderr.write('error: missing required --stdio\n\n');
|
|
@@ -41,16 +47,13 @@ if (!wantsStdio) {
|
|
|
41
47
|
}
|
|
42
48
|
|
|
43
49
|
// Run the bundled server produced by server/webpack.config.js
|
|
50
|
+
// We require it directly so it runs in the same process,
|
|
51
|
+
// similar to how typescript-language-server and other LSPs are structured.
|
|
44
52
|
const serverEntry = path.resolve(__dirname, '..', 'server', 'out', 'eslintServer.js');
|
|
45
53
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
process.exitCode = 1;
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
process.exitCode = code ?? 0;
|
|
56
|
-
});
|
|
54
|
+
try {
|
|
55
|
+
require(serverEntry);
|
|
56
|
+
} catch (err) {
|
|
57
|
+
process.stderr.write(`Failed to start ESLint server: ${err.message}\n`);
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "vscode-eslint",
|
|
3
3
|
"displayName": "ESLint",
|
|
4
4
|
"description": "Integrates ESLint JavaScript into VS Code.",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.3",
|
|
6
6
|
"author": "Microsoft Corporation",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
"url": "https://github.com/shubham151/vscode-eslint/issues"
|
|
14
14
|
},
|
|
15
15
|
"publisher": "dbaeumer",
|
|
16
|
+
"bin": {
|
|
17
|
+
"vscode-eslint": "bin/vscode-eslint"
|
|
18
|
+
},
|
|
16
19
|
"icon": "eslint_icon.png",
|
|
17
20
|
"categories": [
|
|
18
21
|
"Programming Languages",
|