Lint prefer-const

This commit is contained in:
Tom Russell 2019-05-27 18:35:12 +01:00
parent f6e933ff8f
commit 06c63c7272
3 changed files with 5 additions and 4 deletions

View File

@ -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",

View File

@ -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;

View File

@ -16,8 +16,8 @@ const Overview = (props) => {
return <Redirect to="/sign-up.html" />
}
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 (
<Sidebar title={title} back={back}>