Skip to content

Commit 75c8c97

Browse files
authored
📦 Chore: migrate to standardjs (#83)
* 🚧 WIP(code style): migrate to standardjs * 🐛 Fix(upload): upload events off * ✅ Test: fix test configuration * 📦 Chore: add console for message * 🐛 Fix: show message should not block following operations
1 parent 3366be1 commit 75c8c97

27 files changed

+3990
-1619
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist

.eslintrc.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
module.exports = {
2+
root: true,
3+
extends: ['standard-with-typescript', 'prettier-standard'],
4+
parserOptions: {
5+
project: './tsconfig.json'
6+
},
7+
rules: {
8+
'@typescript-eslint/naming-convention': [
9+
'error',
10+
{
11+
selector: 'interface',
12+
format: ['PascalCase'],
13+
custom: {
14+
regex: '^I[A-Z]',
15+
match: true
16+
}
17+
}
18+
],
19+
'@typescript-eslint/explicit-function-return-type': 0,
20+
'@typescript-eslint/strict-boolean-expressions': 0,
21+
'no-console': 'warn'
22+
},
23+
overrides: [
24+
{
25+
files: ['./*.js', './*.ts'],
26+
rules: {
27+
'import/no-anonymous-default-export': 0,
28+
'filenames/match-exported': 0
29+
}
30+
}
31+
]
32+
}

.eslintrc.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ package-lock.json
99
coverage
1010
.coveralls.yml
1111
.DS_Store
12-
dist
12+
dist
13+
tmp
14+
assets/test.md

.prettierrc

Lines changed: 0 additions & 7 deletions
This file was deleted.

.vscode/extensions.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
{
22
// See http://go.microsoft.com/fwlink/?LinkId=827846
33
// for the documentation about the extensions.json format
4-
"recommendations": ["dbaeumer.vscode-eslint"]
4+
"recommendations": [
5+
"dbaeumer.vscode-eslint",
6+
"esbenp.prettier-vscode",
7+
"streetsidesoftware.code-spell-checker",
8+
"davidanson.vscode-markdownlint",
9+
"yzhang.markdown-all-in-one",
10+
"wix.vscode-import-cost",
11+
"pkief.material-icon-theme",
12+
"eamodio.gitlens"
13+
]
514
}

.vscode/launch.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,22 @@
1111
"request": "launch",
1212
"runtimeExecutable": "${execPath}",
1313
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
14-
"outFiles": ["${workspaceFolder}/dist/**/*.js"]
14+
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
15+
"preLaunchTask": "${defaultBuildTask}"
1516
},
1617
{
1718
"name": "Extension Tests",
1819
"type": "extensionHost",
1920
"request": "launch",
2021
"runtimeExecutable": "${execPath}",
2122
"args": [
23+
"--disable-extensions",
24+
"--user-data-dir=tmp",
2225
"--extensionDevelopmentPath=${workspaceFolder}",
23-
"--extensionTestsPath=${workspaceFolder}/dist/test/runner/index"
26+
"--extensionTestsPath=${workspaceFolder}/out/test/runner/index"
2427
],
25-
"outFiles": ["${workspaceFolder}/dist/test/**/*.js"]
28+
"outFiles": ["${workspaceFolder}/out/test/**/*.js"],
29+
"preLaunchTask": "npm: test-compile"
2630
}
2731
]
2832
}

.vscode/settings.json

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,37 @@
77
"out": true // set this to false to include "out" folder in search results
88
},
99
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
10-
"typescript.tsc.autoDetect": "off"
10+
"typescript.tsc.autoDetect": "off",
11+
"files.insertFinalNewline": true,
12+
"eslint.validate": [
13+
"javascript",
14+
"javascriptreact",
15+
"typescript",
16+
"typescriptreact"
17+
],
18+
// Use eslint to format js/ts files
19+
// prettier is included by eslint
20+
"[javascript]": {
21+
"editor.formatOnSave": false
22+
},
23+
"[javascriptreact]": {
24+
"editor.formatOnSave": false
25+
},
26+
"[typescript]": {
27+
"editor.formatOnSave": false
28+
},
29+
"[typescriptreact]": {
30+
"editor.formatOnSave": false
31+
},
32+
"editor.codeActionsOnSave": {
33+
"source.fixAll.eslint": true
34+
},
35+
"eslint.packageManager": "yarn",
36+
"typescript.tsdk": "node_modules\\typescript\\lib",
37+
"editor.tabSize": 2,
38+
"cSpell.words": [
39+
"Mixins",
40+
"picgo",
41+
"vspicgo"
42+
]
1143
}

.vscode/tasks.json

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,42 @@
1-
// See https://go.microsoft.com/fwlink/?LinkId=733558
2-
// for the documentation about the tasks.json format
1+
// Available variables which can be used inside of strings.
2+
// ${workspaceRoot}: the root folder of the team
3+
// ${file}: the current opened file
4+
// ${fileBasename}: the current opened file's basename
5+
// ${fileDirname}: the current opened file's dirname
6+
// ${fileExtname}: the current opened file's extension
7+
// ${cwd}: the current working directory of the spawned process
8+
// A task runner that calls a custom npm script that compiles the extension.
39
{
4-
"version": "2.0.0",
5-
"tasks": [
6-
{
7-
"type": "npm",
8-
"script": "watch",
9-
"problemMatcher": "$tsc-watch",
10-
"isBackground": true,
11-
"presentation": {
12-
"reveal": "never"
13-
},
14-
"group": {
15-
"kind": "build",
16-
"isDefault": true
17-
}
18-
}
19-
]
10+
"version": "2.0.0",
11+
"presentation": {
12+
"echo": false,
13+
"reveal": "always",
14+
"focus": false,
15+
"panel": "dedicated",
16+
"showReuseMessage": false
17+
},
18+
"tasks": [
19+
{
20+
"type": "npm",
21+
"script": "build",
22+
"group": "build",
23+
"problemMatcher": ["$ts-checker-webpack", "$ts-checker-eslint-webpack"]
24+
},
25+
{
26+
"type": "npm",
27+
"script": "lint",
28+
"group": "build",
29+
"problemMatcher": ["$eslint-stylish"]
30+
},
31+
{
32+
"type": "npm",
33+
"script": "watch",
34+
"group": {
35+
"kind": "build",
36+
"isDefault": true
37+
},
38+
"isBackground": true,
39+
"problemMatcher": ["$ts-checker-webpack-watch", "$ts-checker-eslint-webpack-watch"]
40+
}
41+
]
2042
}

.yarnrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
--upgrade.registry "https://registry.npm.taobao.org"
66
--install.ignore-engines true
77
--install.registry "https://registry.npm.taobao.org"
8-
--remove.ignore-engines true
8+
--remove.ignore-engines true
9+
ignore-engines true

0 commit comments

Comments
 (0)