Skip to content

Commit

Permalink
add: eslint to vue and react
Browse files Browse the repository at this point in the history
  • Loading branch information
魏银鹏 committed Sep 13, 2018
1 parent 7858e76 commit fac7c19
Show file tree
Hide file tree
Showing 11 changed files with 7,570 additions and 3,500 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

进入每个目录,如果有package.json则需要先在该目录下在终端(cmd)里`npm i`一下

webpack、eslint需要全局npm安装

`npm install -g eslint`

`npm install -g webpack`

## 目录(按照难度先后顺序)

1. react
Expand Down Expand Up @@ -35,4 +41,11 @@
webpack + vue-loader + webpack-dev-server

在webpack中用vue-loader编译vue单文件
有webpack-dev-server帮助开发
有webpack-dev-server帮助开
8. react-webpack-eslint
webpack + babel-loader + webpack-dev-server + eslint
包括eslint plugin的使用等

9. vue-webpack-eslint
webpack + +babel-loader + vue-loader + webpack-dev-server + eslint
包括eslint plugin的使用等
10 changes: 10 additions & 0 deletions react-webpack-eslint/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
"extends": "standard",
"plugins":["html", "react"],
"rules":{
// 解决react报错
"react/jsx-uses-react":2,
// 解决var App 报错
"react/jsx-uses-vars":2,
}
};
13 changes: 13 additions & 0 deletions react-webpack-eslint/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div id="root"></div>
<script src="./dist/main.js"></script>
</body>
</html>
Loading

0 comments on commit fac7c19

Please sign in to comment.