Skip to content

Commit 0d8edd1

Browse files
committed
bugfixed
1 parent ba3600b commit 0d8edd1

File tree

3 files changed

+22
-13
lines changed

3 files changed

+22
-13
lines changed

Notes/JavaScript/Eslint配置记录(with webpack).md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ $ npm install eslint-loader --save-dev
3434

3535
### 基本配置
3636

37-
#### 配置webpack
37+
#### 配置 webpack
3838

3939
```javascript
4040
module: {
@@ -96,15 +96,15 @@ module: {
9696
}
9797
```
9898

99-
Eslint的规则配置具体可戳[这里](http://eslint.org/docs/rules/)
99+
Eslint 的规则配置具体可戳[这里](http://eslint.org/docs/rules/)
100100

101-
通常,0代表不使用这个规则,1代表`warnning`的程度,2代表`error`的程度。
101+
通常,0 代表不使用这个规则,1 代表`warnning`的程度,2 代表`error`的程度。
102102

103103
有一篇博客写的挺细的:[详解 ESLint 规则,规范你的代码](http://guowenfh.github.io/2016/08/07/ESLint-Rules/)
104104

105105
### 插件
106106

107-
如果我们使用ES6/ES7或者JSX的语法,并用babel进行解析的话,可以安装[babel-eslint](https://github.com/babel/babel-eslint)
107+
如果我们使用 ES6/ES7 或者 JSX 的语法,并用 babel 进行解析的话,可以安装 [babel-eslint](https://github.com/babel/babel-eslint)
108108

109109
```bash
110110
$ npm install babel-eslint --save-dev
@@ -121,14 +121,14 @@ $ npm install babel-eslint --save-dev
121121
}
122122
```
123123

124-
在使用React的时候,如果Eslint里配置了`no-unused-vars`的规则,那么在检查代码的时候会报错,提示import的组件没有被调用(实际上使用了):
124+
在使用 React 的时候,如果 Eslint 里配置了`no-unused-vars`的规则,那么在检查代码的时候会报错,提示 import 的组件没有被调用(实际上使用了):
125125

126126
```bash
127127
React is defined but never used no-ununsed-vars
128128
Component is defined but never used
129129
```
130130

131-
查到Github上有人提出[issue](https://github.com/eslint/eslint/issues/4821),解决方案是使用`eslint-plugin-react`,因此来安装配置`eslint-plugin`
131+
查到 GitHub 上有人提出 [issue](https://github.com/eslint/eslint/issues/4821),解决方案是使用`eslint-plugin-react`,因此来安装配置`eslint-plugin`
132132

133133
- [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react)
134134

@@ -160,7 +160,7 @@ $ npm install eslint-plugin-react --save-dev
160160

161161
- [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import)
162162

163-
> 检查import是否合法的插件
163+
> 检查 import 是否合法的插件
164164
165165
```bash
166166
$ npm install eslint-plugin-import --save-dev
@@ -175,8 +175,8 @@ $ npm install eslint-plugin-import --save-dev
175175
],
176176
"rules": {
177177
// 检查引用的路径是否有误
178-
// 通过{"commonjs": true, "amd": true}来支持commonjs和amd方式的require
179-
"import/no-unresolved": [2, {"commonjs": true, "amd": true}]
178+
// 通过 {"commonjs": true, "amd": true} 来支持 commonjs 和 amd 方式的 require
179+
"import/no-unresolved": [2, {"commonjs": true, "amd": true}],
180180
"import/namespace": 2,
181181
"import/default": 2,
182182
"import/export": 2

Notes/前端工程/服务器配置记录.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,20 @@ $ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
6868
$ sudo apt-get install -y nodejs
6969

7070
#### 方法二:通过 nvm
71-
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash # 安装 nvm
71+
# 安装 nvm
72+
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash
73+
$ nvm # 检查 nvm 命令
74+
75+
# ==========
76+
# 若命令不存在,则可以通过
77+
$ source ~/.bashrc # 重启配置
78+
# 之后如果 $ nvm 依旧无效,则
7279
$ vim ~/.bashrc # 配置,增加如下内容(不必须)
7380
export NVM_DIR="/home/ecmadao/.nvm"
7481
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
7582
$ source ~/.bashrc # 重启配置
83+
# ==========
84+
7685
$ nvm ls-remote # 查看远程可安装的node版本
7786
$ nvm install v5.11.1 # 安装指定版本
7887
$ nvm ls # 查看本地所有版本
@@ -90,8 +99,8 @@ $ export PATH=$PATH:/usr/bin
9099
```bash
91100
# install & config git
92101
$ sudo apt-get install git
93-
$ git config --global user.name "Yourname"
94-
$ git config --global user.email "email@example.com"
102+
$ git config --global user.name "ecmadao"
103+
$ git config --global user.email "wlec@outlook.com"
95104

96105
# https://segmentfault.com/a/1190000004317077
97106
# http://www.cnblogs.com/hustskyking/p/problems-in-git-when-ssh.html

Tools/Plugin/js-plugin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ before.to(after); // in a day 相对时间多久之后
233233

234234
> 感觉挺新颖的,可以研究下
235235
236-
- [SimpleMDE](https://simplemde.com/)
236+
- **[SimpleMDE](https://simplemde.com/)**
237237

238238
> 支持markdown的富文本编辑器
239239

0 commit comments

Comments
 (0)