Skip to content

Commit

Permalink
fix(cli): 模版内 eslintrc 变量读读取错误导致初始化报错
Browse files Browse the repository at this point in the history
  • Loading branch information
Pines-Cheng committed Apr 11, 2019
1 parent 8990d4f commit 09cdab1
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/taro-cli/templates/default/eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"no-unused-vars": ["error", { "varsIgnorePattern": "Taro" }],
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx", ".tsx"] }]
},
<%if (!typescript) {-%>
<%if (!locals.typescript) {-%>
"parser": "babel-eslint"
<%} else { -%>
"parser": "@typescript-eslint/parser",
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-cli/templates/mobx/eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"no-unused-vars": ["error", { "varsIgnorePattern": "Taro" }],
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx", ".tsx"] }]
},
<%if (!typescript) {-%>
<%if (!locals.typescript) {-%>
"parser": "babel-eslint"
<%} else { -%>
"parser": "@typescript-eslint/parser",
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-cli/templates/redux/eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"no-unused-vars": ["error", { "varsIgnorePattern": "Taro" }],
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx", ".tsx"] }]
},
<%if (!typescript) {-%>
<%if (!locals.typescript) {-%>
"parser": "babel-eslint"
<%} else { -%>
"parser": "@typescript-eslint/parser",
Expand Down
14 changes: 12 additions & 2 deletions packages/taro-cli/templates/wxcloud/client/eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
"no-unused-vars": ["error", { "varsIgnorePattern": "Taro" }],
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx", ".tsx"] }]
},
"parser": "babel-eslint"<% if (typescript) {%>,
"plugins": ["typescript"]<%}%>
<%if (!locals.typescript) {-%>
"parser": "babel-eslint"
<%} else { -%>
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"useJSXTextNode": true,
"project": "./tsconfig.json"
}
<%}-%>
}
14 changes: 12 additions & 2 deletions packages/taro-cli/templates/wxplugin/eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
"no-unused-vars": ["error", { "varsIgnorePattern": "Taro" }],
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx", ".tsx"] }]
},
"parser": "babel-eslint"<% if (typescript) {%>,
"plugins": ["typescript"]<%}%>
<%if (!locals.typescript) {-%>
"parser": "babel-eslint"
<%} else { -%>
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"useJSXTextNode": true,
"project": "./tsconfig.json"
}
<%}-%>
}

0 comments on commit 09cdab1

Please sign in to comment.