Skip to content

Commit 92f0331

Browse files
committed
Add ESLint configuration and update package.json for new commands and views
1 parent 365e405 commit 92f0331

3 files changed

Lines changed: 77 additions & 6 deletions

File tree

.vscodeignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.vscode/**
2+
.vscode-test/**
3+
src/**
4+
.gitignore
5+
.yarnrc
6+
vsc-extension-quickstart.md
7+
**/tsconfig.json
8+
**/eslint.config.mjs
9+
**/*.map
10+
**/*.ts
11+
**/.vscode-test.*

eslint.config.mjs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import typescriptEslint from "typescript-eslint";
2+
3+
export default [{
4+
files: ["**/*.ts"],
5+
}, {
6+
plugins: {
7+
"@typescript-eslint": typescriptEslint.plugin,
8+
},
9+
10+
languageOptions: {
11+
parser: typescriptEslint.parser,
12+
ecmaVersion: 2022,
13+
sourceType: "module",
14+
},
15+
16+
rules: {
17+
"@typescript-eslint/naming-convention": ["warn", {
18+
selector: "import",
19+
format: ["camelCase", "PascalCase"],
20+
}],
21+
22+
curly: "warn",
23+
eqeqeq: "warn",
24+
"no-throw-literal": "warn",
25+
semi: "warn",
26+
},
27+
}];

package.json

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,31 @@
1212
"activationEvents": [
1313
"onCommand:codecount.countLines",
1414
"onCommand:codecount.countFilesLines",
15-
"onCommand:codecount.countLinesByExtension"
15+
"onCommand:codecount.countLinesByExtension",
16+
"onCommand:codecount.refreshStats",
17+
"onCommand:codecount.gitRepoMissing",
18+
"onView:codecount.stats"
1619
],
1720
"main": "./out/extension.js",
1821
"contributes": {
22+
"viewsContainers": {
23+
"activitybar": [
24+
{
25+
"id": "codecount",
26+
"title": "CodeCount",
27+
"icon": "resources/codecount.svg"
28+
}
29+
]
30+
},
31+
"views": {
32+
"codecount": [
33+
{
34+
"id": "codecount.stats",
35+
"name": "CodeCount"
36+
}
37+
]
38+
},
1939
"commands": [
20-
{
21-
"command": "codecount.helloWorld",
22-
"title": "Hello World"
23-
},
2440
{
2541
"command": "codecount.countLines",
2642
"title": "Count Lines of Code"
@@ -32,8 +48,25 @@
3248
{
3349
"command": "codecount.countLinesByExtension",
3450
"title": "Count Lines of Code by Extension"
51+
},
52+
{
53+
"command": "codecount.refreshStats",
54+
"title": "Refresh CodeCount Stats"
55+
},
56+
{
57+
"command": "codecount.gitRepoMissing",
58+
"title": "Git Repo Missing"
3559
}
36-
]
60+
],
61+
"menus": {
62+
"view/title": [
63+
{
64+
"command": "codecount.refreshStats",
65+
"when": "view == codecount.stats",
66+
"group": "navigation"
67+
}
68+
]
69+
}
3770
},
3871
"scripts": {
3972
"vscode:prepublish": "pnpm run compile",

0 commit comments

Comments
 (0)