Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Commit

Permalink
feat: 添加 vscode 开发方式
Browse files Browse the repository at this point in the history
  • Loading branch information
mohuishou committed Jun 2, 2020
1 parent d282c65 commit e7be12a
Show file tree
Hide file tree
Showing 39 changed files with 2,511 additions and 5,834 deletions.
28 changes: 28 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

# To fully customize the contents of this image, use the following Dockerfile instead:
# https://github.com/microsoft/vscode-dev-containers/tree/v0.117.1/containers/typescript-node-12/.devcontainer/Dockerfile
FROM node:12-buster-slim

# 更换为阿里云源
COPY sources.list /etc/apt/sources.list

# ** [Optional] Uncomment this section to install additional packages. **
#
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get -y install --no-install-recommends git wget curl \
#
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
ENV DEBIAN_FRONTEND=dialog

# 设置淘宝源
RUN npm config set registry https://registry.npm.taobao.org && \
npm i wepy-cli -g

25 changes: 25 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.117.1/containers/typescript-node-12
{
"name": "scuplus-dev",
"dockerFile": "Dockerfile",
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"dbaeumer.vscode-eslint",
"wleven.wepy-snippets",
"esbenp.prettier-vscode",
"qiu8310.minapp-vscode",
"ms-vscode.vscode-typescript-tslint-plugin",
"octref.vetur"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "npm i"
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "node"
}
8 changes: 8 additions & 0 deletions .devcontainer/sources.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb http://mirrors.aliyun.com/debian-security buster/updates main
deb-src http://mirrors.aliyun.com/debian-security buster/updates main
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
dist/*
cos*.js
**/plugins/*
28 changes: 13 additions & 15 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
module.exports = {
root: true,
parser: 'babel-eslint',
parser: "babel-eslint",
parserOptions: {
sourceType: 'module'
sourceType: "module",
},
env: {
browser: true
browser: true,
},
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
extends: 'standard',
extends: "standard",
// required to lint *.wpy files
plugins: [
'html'
],
plugins: ["html","prettier"],
settings: {
'html/html-extensions': ['.html', '.wpy']
"html/html-extensions": [".html", ".wpy", ".vue"],
},
// add your custom rules here
'rules': {
rules: {
// allow paren-less arrow functions
'arrow-parens': 0,
"arrow-parens": 0,
// allow async-await
'generator-star-spacing': 0,
"generator-star-spacing": 0,
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'space-before-function-paren': 0
}
}
"no-debugger": process.env.NODE_ENV === "production" ? 2 : 0,
"space-before-function-paren": 0,
},
};
10 changes: 10 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
"printWidth": 80, //一行的字符数,如果超过会进行换行,默认为80
"tabWidth": 2, //一个tab代表几个空格数,默认为80
"useTabs": false, //是否使用tab进行缩进,默认为false,表示用空格进行缩减
"singleQuote": false, //字符串是否使用单引号,默认为false,使用双引号
"semi": true, //行位是否使用分号,默认为true
"trailingComma": "none", //是否使用尾逗号,有三个可选值"<none|es5|all>"
"bracketSpacing": true, //对象大括号直接是否有空格,默认为true,效果:{ foo: bar }
"parser": "babylon" //代码的解析引擎,默认为babylon,与babel相同。
}
Loading

0 comments on commit e7be12a

Please sign in to comment.