Skip to content

Commit bba68f5

Browse files
committed
inital commit with vscode extension
1 parent 8cff532 commit bba68f5

13 files changed

+2902
-0
lines changed

.eslintrc.json

+165
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
{
2+
"env": {
3+
"browser": false,
4+
"commonjs": true,
5+
"es6": true,
6+
"node": true,
7+
"mocha": true
8+
},
9+
"parserOptions": {
10+
"ecmaVersion": "latest",
11+
"sourceType": "module"
12+
},
13+
"rules": {
14+
"no-const-assign": "warn",
15+
"no-this-before-super": "warn",
16+
"no-undef": "warn",
17+
"no-unused-vars": "warn",
18+
"constructor-super": "warn",
19+
"valid-typeof": "warn",
20+
21+
"indent": ["error", 2],
22+
"linebreak-style": ["error", "unix"],
23+
"quotes": ["error", "single"],
24+
"semi": ["error", "always"],
25+
"no-loop-func": ["error"],
26+
"block-spacing": ["error", "always"],
27+
"camelcase": ["error"],
28+
"eqeqeq": ["error", "always"],
29+
"strict": ["error", "global"],
30+
"brace-style": [
31+
"error",
32+
"1tbs",
33+
{
34+
"allowSingleLine": true
35+
}
36+
],
37+
"comma-style": ["error", "last"],
38+
"comma-spacing": [
39+
"error",
40+
{
41+
"before": false,
42+
"after": true
43+
}
44+
],
45+
"eol-last": ["error"],
46+
"func-call-spacing": ["error", "never"],
47+
"key-spacing": [
48+
"error",
49+
{
50+
"beforeColon": false,
51+
"afterColon": true,
52+
"mode": "minimum"
53+
}
54+
],
55+
"keyword-spacing": [
56+
"error",
57+
{
58+
"before": true,
59+
"after": true,
60+
"overrides": {
61+
"function": {
62+
"after": false
63+
}
64+
}
65+
}
66+
],
67+
"max-len": [
68+
"error",
69+
{
70+
"code": 100,
71+
"ignoreUrls": true
72+
}
73+
],
74+
"max-nested-callbacks": [
75+
"error",
76+
{
77+
"max": 7
78+
}
79+
],
80+
"new-cap": [
81+
"error",
82+
{
83+
"newIsCap": true,
84+
"capIsNew": false,
85+
"properties": true
86+
}
87+
],
88+
"new-parens": ["error"],
89+
"no-lonely-if": ["error"],
90+
"no-trailing-spaces": ["error"],
91+
"no-unneeded-ternary": ["error"],
92+
"no-whitespace-before-property": ["error"],
93+
"object-curly-spacing": ["error", "always"],
94+
"operator-assignment": ["error", "always"],
95+
"operator-linebreak": ["error", "after"],
96+
"semi-spacing": [
97+
"error",
98+
{
99+
"before": false,
100+
"after": true
101+
}
102+
],
103+
"space-before-blocks": ["error", "always"],
104+
"space-before-function-paren": [
105+
"error",
106+
{
107+
"anonymous": "never",
108+
"named": "never",
109+
"asyncArrow": "always"
110+
}
111+
],
112+
"space-in-parens": ["error", "never"],
113+
"space-infix-ops": ["error"],
114+
"space-unary-ops": [
115+
"error",
116+
{
117+
"words": true,
118+
"nonwords": false,
119+
"overrides": {
120+
"typeof": false
121+
}
122+
}
123+
],
124+
"no-unreachable": ["error"],
125+
"no-global-assign": ["error"],
126+
"no-self-compare": ["error"],
127+
"no-unmodified-loop-condition": ["error"],
128+
"no-constant-condition": [
129+
"error",
130+
{
131+
"checkLoops": false
132+
}
133+
],
134+
"no-console": ["off"],
135+
"no-useless-concat": ["error"],
136+
"no-useless-escape": ["error"],
137+
"no-shadow-restricted-names": ["error"],
138+
"no-use-before-define": [
139+
"error",
140+
{
141+
"functions": false
142+
}
143+
],
144+
"arrow-parens": ["error", "always"],
145+
"arrow-body-style": ["error", "as-needed"],
146+
"arrow-spacing": ["error"],
147+
"no-confusing-arrow": [
148+
"error",
149+
{
150+
"allowParens": true
151+
}
152+
],
153+
"no-useless-computed-key": ["error"],
154+
"no-useless-rename": ["error"],
155+
"no-var": ["error"],
156+
"object-shorthand": ["error", "always"],
157+
"prefer-arrow-callback": ["error"],
158+
"prefer-const": ["error"],
159+
"prefer-numeric-literals": ["error"],
160+
"prefer-rest-params": ["error"],
161+
"prefer-spread": ["error"],
162+
"rest-spread-spacing": ["error", "never"],
163+
"template-curly-spacing": ["error", "never"]
164+
}
165+
}

.vscode-test.mjs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { defineConfig } from '@vscode/test-cli';
2+
3+
export default defineConfig({
4+
files: 'test/**/*.test.js',
5+
});

.vscode/extensions.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the extensions.json format
4+
"recommendations": [
5+
"dbaeumer.vscode-eslint",
6+
"ms-vscode.extension-test-runner"
7+
]
8+
}

.vscode/launch.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// A launch configuration that launches the extension inside a new window
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
{
6+
"version": "0.2.0",
7+
"configurations": [
8+
{
9+
"name": "Run Extension",
10+
"type": "extensionHost",
11+
"request": "launch",
12+
"args": [
13+
"--extensionDevelopmentPath=${workspaceFolder}"
14+
]
15+
}
16+
]
17+
}

.vscodeignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.vscode/**
2+
.vscode-test/**
3+
test/**
4+
.gitignore
5+
.yarnrc
6+
vsc-extension-quickstart.md
7+
**/jsconfig.json
8+
**/*.map
9+
**/.eslintrc.json
10+
**/.vscode-test.*

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Change Log
2+
3+
All notable changes to the "htmlclasses-parser" extension will be documented in this file.
4+
5+
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
6+
7+
## [Unreleased]
8+
9+
- Initial release

README.md

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# htmlclasses-parser README
2+
3+
This is the README for your extension "htmlclasses-parser". After writing up a brief description, we recommend including the following sections.
4+
5+
## Features
6+
7+
Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.
8+
9+
For example if there is an image subfolder under your extension project workspace:
10+
11+
\!\[feature X\]\(images/feature-x.png\)
12+
13+
> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.
14+
15+
## Requirements
16+
17+
If you have any requirements or dependencies, add a section describing those and how to install and configure them.
18+
19+
## Extension Settings
20+
21+
Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.
22+
23+
For example:
24+
25+
This extension contributes the following settings:
26+
27+
* `myExtension.enable`: Enable/disable this extension.
28+
* `myExtension.thing`: Set to `blah` to do something.
29+
30+
## Known Issues
31+
32+
Calling out known issues can help limit users opening duplicate issues against your extension.
33+
34+
## Release Notes
35+
36+
Users appreciate release notes as you update your extension.
37+
38+
### 1.0.0
39+
40+
Initial release of ...
41+
42+
### 1.0.1
43+
44+
Fixed issue #.
45+
46+
### 1.1.0
47+
48+
Added features X, Y, and Z.
49+
50+
---
51+
52+
## Working with Markdown
53+
54+
You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
55+
56+
* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux)
57+
* Toggle preview (`Shift+Cmd+V` on macOS or `Shift+Ctrl+V` on Windows and Linux)
58+
* Press `Ctrl+Space` (Windows, Linux, macOS) to see a list of Markdown snippets
59+
60+
## For more information
61+
62+
* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
63+
* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)
64+
65+
**Enjoy!**

extension.js

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// The module 'vscode' contains the VS Code extensibility API
2+
// Import the module and reference it with the alias vscode in your code below
3+
const vscode = require('vscode');
4+
5+
// This method is called when your extension is activated
6+
// Your extension is activated the very first time the command is executed
7+
8+
/**
9+
* @param {vscode.ExtensionContext} context
10+
*/
11+
function activate(context) {
12+
13+
// Use the console to output diagnostic information (console.log) and errors (console.error)
14+
// This line of code will only be executed once when your extension is activated
15+
console.log('Congratulations, your extension "htmlclasses-parser" is now active!');
16+
17+
// The command has been defined in the package.json file
18+
// Now provide the implementation of the command with registerCommand
19+
// The commandId parameter must match the command field in package.json
20+
const disposable = vscode.commands.registerCommand('htmlclasses-parser.helloWorld', () => {
21+
// The code you place here will be executed every time your command is executed
22+
23+
// Display a message box to the user
24+
vscode.window.showInformationMessage('Hello World from htmlClasses-parser!');
25+
});
26+
27+
context.subscriptions.push(disposable);
28+
}
29+
30+
// This method is called when your extension is deactivated
31+
function deactivate() {}
32+
33+
module.exports = {
34+
activate,
35+
deactivate
36+
};

jsconfig.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"compilerOptions": {
3+
"module": "Node16",
4+
"target": "ES2022",
5+
"checkJs": true, /* Typecheck .js files. */
6+
"lib": [
7+
"ES2022"
8+
]
9+
},
10+
"exclude": [
11+
"node_modules"
12+
]
13+
}

0 commit comments

Comments
 (0)