Skip to content

Commit 383b014

Browse files
Merge pull request #4 from Luke-zhang-04/staging
2 parents 4a9cb80 + 6038e2c commit 383b014

31 files changed

+5000
-3878
lines changed

.editorconfig

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ end_of_line = lf
99
insert_final_newline = true
1010
trim_trailing_whitespace = true
1111

12-
[*.{yml,yaml,css,scss}]
12+
[*.{json,html,yml,yaml,css,scss}]
1313
indent_style = space
1414
indent_size = 2
15-
16-
[*rc.json]
17-
indent_style = space
18-
indent_size = 4
19-
20-
[{*package.json,tsconfig.json}]
21-
indent_style = space
22-
indent_size = 2

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*/node_modules/
2+
/src/serviceWorker.ts
3+
lint
4+
start
5+
lib

.eslintrc.js

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
function* range(min, max) {
2+
for (let num = min; num < max; num++) {
3+
yield num
4+
}
5+
}
6+
7+
module.exports = {
8+
env: {
9+
es2021: true,
10+
node: true,
11+
},
12+
extends: ["eslint:recommended", "plugin:@typescript-eslint/eslint-recommended"],
13+
parser: "@typescript-eslint/parser",
14+
globals: {
15+
Atomics: "readonly",
16+
SharedArrayBuffer: "readonly",
17+
},
18+
parserOptions: {
19+
ecmaVersion: 2021,
20+
sourceType: "module",
21+
project: ["./tsconfig.json"],
22+
},
23+
plugins: ["@typescript-eslint", "prefer-arrow"],
24+
rules: {
25+
// General ESLint rules
26+
"arrow-body-style": ["warn", "as-needed"],
27+
"default-case-last": "warn",
28+
"dot-location": ["warn", "property"],
29+
eqeqeq: "error",
30+
"id-length": ["error", {exceptions: ["_", "$"]}],
31+
"max-len": "off",
32+
"max-lines": ["warn", 500],
33+
"max-statements": ["warn", {max: 25}],
34+
"no-else-return": "warn",
35+
"no-empty": ["warn", {allowEmptyCatch: true}],
36+
"no-extra-semi": "off",
37+
"no-negated-condition": "warn",
38+
"no-nested-ternary": "warn",
39+
"no-unused-vars": "off",
40+
"no-var": "warn",
41+
"object-shorthand": "warn",
42+
"one-var": ["warn", "never"],
43+
"padding-line-between-statements": [
44+
"warn",
45+
{blankLine: "always", prev: "*", next: "return"},
46+
{blankLine: "always", prev: ["const", "let", "var"], next: "*"},
47+
{blankLine: "any", prev: ["const", "let", "var"], next: ["const", "let", "var"]},
48+
{blankLine: "always", prev: "function", next: "*"},
49+
],
50+
"prefer-const": "warn",
51+
"prefer-destructuring": [
52+
"error",
53+
{
54+
array: false,
55+
object: true,
56+
},
57+
],
58+
"prefer-exponentiation-operator": "warn",
59+
"prefer-object-spread": "warn",
60+
"prefer-template": "warn",
61+
"require-await": "warn",
62+
"require-unicode-regexp": "warn",
63+
"sort-imports": ["warn"],
64+
65+
// Typescript Rules
66+
"@typescript-eslint/array-type": "warn",
67+
"@typescript-eslint/consistent-indexed-object-style": ["warn", "index-signature"],
68+
"@typescript-eslint/consistent-type-assertions": ["warn", {assertionStyle: "as"}],
69+
"@typescript-eslint/member-ordering": "warn",
70+
"@typescript-eslint/naming-convention": [
71+
"error",
72+
{
73+
selector: "default",
74+
format: ["camelCase"],
75+
},
76+
{
77+
selector: "variableLike",
78+
format: ["camelCase"],
79+
leadingUnderscore: "allow",
80+
},
81+
{
82+
selector: "memberLike",
83+
modifiers: ["private"],
84+
format: ["camelCase"],
85+
leadingUnderscore: "require",
86+
},
87+
{
88+
selector: "property",
89+
modifiers: ["private"],
90+
format: ["camelCase"],
91+
leadingUnderscore: "require",
92+
},
93+
{
94+
selector: "typeLike",
95+
format: ["PascalCase"],
96+
},
97+
{
98+
selector: "variable",
99+
types: ["boolean"],
100+
format: ["PascalCase"],
101+
prefix: ["is", "should", "has", "can", "did", "will"],
102+
},
103+
{
104+
selector: "parameter",
105+
format: ["camelCase"],
106+
leadingUnderscore: "allow",
107+
},
108+
{
109+
selector: "property",
110+
format: ["camelCase", "PascalCase", "snake_case", "UPPER_CASE"],
111+
},
112+
{
113+
selector: "enumMember",
114+
format: ["camelCase", "PascalCase", "snake_case", "UPPER_CASE"],
115+
},
116+
],
117+
"@typescript-eslint/no-magic-numbers": [
118+
"warn",
119+
{
120+
ignoreEnums: true,
121+
ignoreNumericLiteralTypes: true,
122+
ignoreReadonlyClassProperties: true,
123+
ignoreArrayIndexes: true,
124+
ignore: [...Array.from(range(-10, 11)), 16, 32, 64, 128, 256, 512],
125+
},
126+
],
127+
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "warn",
128+
"@typescript-eslint/prefer-for-of": "warn",
129+
"@typescript-eslint/prefer-function-type": "warn",
130+
"@typescript-eslint/prefer-optional-chain": "warn",
131+
132+
// Typescript extension rules
133+
"@typescript-eslint/default-param-last": "warn",
134+
"@typescript-eslint/dot-notation": "warn",
135+
"@typescript-eslint/lines-between-class-members": ["warn", "always"],
136+
"@typescript-eslint/no-dupe-class-members": "warn",
137+
"@typescript-eslint/no-duplicate-imports": "warn",
138+
"@typescript-eslint/no-extra-semi": "off",
139+
"@typescript-eslint/no-shadow": "warn",
140+
"@typescript-eslint/no-unused-expressions": "warn",
141+
"@typescript-eslint/no-unused-vars": "off",
142+
"@typescript-eslint/no-unused-vars-experimental": "warn",
143+
"@typescript-eslint/no-use-before-define": "warn",
144+
145+
// Preter arrow rules
146+
"prefer-arrow-callback": "warn",
147+
"prefer-arrow/prefer-arrow-functions": [
148+
"warn",
149+
{
150+
disallowPrototype: true,
151+
singleReturnOnly: false,
152+
classPropertiesAllowed: true,
153+
allowStandaloneDeclarations: false,
154+
},
155+
],
156+
},
157+
}

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
name: Bug report
33
about: Create a report to help us improve
44
title: "[BUG] "
5-
labels: ''
6-
assignees: ''
7-
5+
labels: ""
6+
assignees: ""
87
---
98

109
**Describe the bug**
1110
A clear and concise description of what the bug is.
1211

1312
**To Reproduce**
1413
Steps to reproduce the behavior:
14+
1515
1. Go to '...'
1616
2. Click on '....'
1717
3. Scroll down to '....'
@@ -24,8 +24,9 @@ A clear and concise description of what you expected to happen.
2424
If applicable, add screenshots to help explain your problem.
2525

2626
**VSCode (please complete the following information):**
27-
- OS: [e.g. iOS8.1]
28-
- Version [e.g. 22]
27+
28+
- OS: [e.g. iOS8.1]
29+
- Version [e.g. 22]
2930

3031
**Additional context**
3132
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
name: Feature request
33
about: Suggest an idea for this project
44
title: "[FEATURE] "
5-
labels: ''
6-
assignees: ''
7-
5+
labels: ""
6+
assignees: ""
87
---
98

109
**Is your feature request related to a problem? Please describe.**

.github/workflows/CI.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111
- uses: actions/checkout@v2
1212
- uses: actions/setup-node@v1
1313
with:
14-
node-version: '14.x'
15-
registry-url: 'https://registry.npmjs.org'
14+
node-version: "14.x"
15+
registry-url: "https://registry.npmjs.org"
1616

1717
- name: install deps
1818
run: yarn install --frozen-lockfile

.github/workflows/publish.yml

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,29 @@ jobs:
77
publish:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v2
1111

12-
- uses: actions/setup-node@v1
13-
with:
14-
node-version: '14.x'
15-
registry-url: 'https://registry.npmjs.org'
12+
- uses: actions/setup-node@v1
13+
with:
14+
node-version: "14.x"
15+
registry-url: "https://registry.npmjs.org"
1616

17-
- name: install deps
18-
run: yarn install --frozen-lockfile
17+
- name: install deps
18+
run: yarn install --frozen-lockfile
1919

20-
- name: build
21-
run: yarn vsce package
20+
- name: build
21+
run: yarn vsce package
2222

23-
- name: Release
24-
uses: softprops/action-gh-release@v1
25-
with:
26-
files: ./processing-vscode-*.vsix
27-
env:
28-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
- name: Release
24+
uses: softprops/action-gh-release@v1
25+
with:
26+
files: ./processing-vscode-*.vsix
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Publish to marketplace
31+
uses: lannonbr/vsce-action@master
32+
with:
33+
args: "publish -p $VSCE_TOKEN"
34+
env:
35+
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}

.prettierignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
*.json
1+
src/documentation-data.json
2+
*/node_modules/
3+
build
4+
.serverless
5+
.vscode
6+
lib/
7+
tsconfig*.json
8+
legacy

.prettierrc.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,35 @@
1+
# Normal Options
12
arrowParens: "always"
23
bracketSpacing: false
34
embeddedLanguageFormatting: "auto"
45
endOfLine: "lf"
56
htmlWhitespaceSensitivity: "strict"
67
jsxBracketSameLine: false
78
jsxSingleQuote: false
8-
printWidth: 101
9+
printWidth: 99
910
quoteProps: "as-needed"
1011
semi: false
1112
singleQuote: false
1213
tabWidth: 4
1314
trailingComma: "all"
1415
useTabs: false
16+
17+
# JSDoc plugin
18+
jsdocSpaces: 1
19+
jsdocDescriptionWithDot: false
20+
jsdocDescriptionTag: false
21+
jsdocVerticalAlignment: false
22+
jsdocKeepUnParseAbleExampleIndent: false
23+
jsdocSingleLineComment: false
24+
tsdoc: true
25+
26+
overrides:
27+
- files:
28+
- "*.html"
29+
- "*.yml"
30+
- "*.yaml"
31+
- "*.json"
32+
- "*.css"
33+
- "*.scss"
34+
options:
35+
tabWidth: 2

0 commit comments

Comments
 (0)