chore(style): allow case declarations and ban var (#987)

* chore(style): allow case declarations

* chore(style): ban `var` and prefer `const`
This commit is contained in:
q1anx1
2022-08-08 23:35:24 +08:00
committed by GitHub
parent 802995ed16
commit deed857788
65 changed files with 187 additions and 182 deletions

View File

@ -69,7 +69,7 @@ class ProductEditPage extends React.Component {
updateProductField(key, value) {
value = this.parseProductField(key, value);
let product = this.state.product;
const product = this.state.product;
product[key] = value;
this.setState({
product: product,
@ -252,7 +252,7 @@ class ProductEditPage extends React.Component {
}
renderPreview() {
let buyUrl = `/products/${this.state.product.name}/buy`;
const buyUrl = `/products/${this.state.product.name}/buy`;
return (
<Col span={22} style={{display: "flex", flexDirection: "column"}}>
<a style={{marginBottom: "10px", display: "flex"}} target="_blank" rel="noreferrer" href={buyUrl}>
@ -268,7 +268,7 @@ class ProductEditPage extends React.Component {
}
submitProductEdit(willExist) {
let product = Setting.deepCopy(this.state.product);
const product = Setting.deepCopy(this.state.product);
ProductBackend.updateProduct(this.state.product.owner, this.state.productName, product)
.then((res) => {
if (res.msg === "") {