diff --git a/app/.eslintrc b/app/.eslintrc index bc2c1ce8..92153f57 100644 --- a/app/.eslintrc +++ b/app/.eslintrc @@ -29,7 +29,8 @@ "comma-spacing": ["warn"], "camelcase": ["warn", {"ignoreDestructuring": true ,"properties": "never"}], "eol-last": ["warn", "always"], - "no-multiple-empty-lines": ["warn", {"max": 1}] + "no-multiple-empty-lines": ["warn", {"max": 1}], + "prefer-const": "warn" }, "plugins": [ "jest", diff --git a/app/src/frontend/building-edit.js b/app/src/frontend/building-edit.js index 79ff02c1..61b29efb 100644 --- a/app/src/frontend/building-edit.js +++ b/app/src/frontend/building-edit.js @@ -52,7 +52,7 @@ class EditForm extends Component { constructor(props) { super(props); this.state = {} - for (let field of props.fields) { + for (const field of props.fields) { this.state[field.slug] = props[field.slug] } this.state.error = this.props.error || undefined; diff --git a/app/src/frontend/overview.js b/app/src/frontend/overview.js index 52c2230b..095974d8 100644 --- a/app/src/frontend/overview.js +++ b/app/src/frontend/overview.js @@ -16,8 +16,8 @@ const Overview = (props) => { return } - let title = (props.mode === 'view')? 'View maps' : 'Add or edit data'; - let back = (props.mode === 'edit')? `/view/${dataLayer}.html` : undefined; + const title = (props.mode === 'view')? 'View maps' : 'Add or edit data'; + const back = (props.mode === 'edit')? `/view/${dataLayer}.html` : undefined; return (