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"], "comma-spacing": ["warn"],
"camelcase": ["warn", {"ignoreDestructuring": true ,"properties": "never"}], "camelcase": ["warn", {"ignoreDestructuring": true ,"properties": "never"}],
"eol-last": ["warn", "always"], "eol-last": ["warn", "always"],
"no-multiple-empty-lines": ["warn", {"max": 1}] "no-multiple-empty-lines": ["warn", {"max": 1}],
"prefer-const": "warn"
}, },
"plugins": [ "plugins": [
"jest", "jest",

View File

@ -52,7 +52,7 @@ class EditForm extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = {} this.state = {}
for (let field of props.fields) { for (const field of props.fields) {
this.state[field.slug] = props[field.slug] this.state[field.slug] = props[field.slug]
} }
this.state.error = this.props.error || undefined; this.state.error = this.props.error || undefined;

View File

@ -16,8 +16,8 @@ const Overview = (props) => {
return <Redirect to="/sign-up.html" /> return <Redirect to="/sign-up.html" />
} }
let title = (props.mode === 'view')? 'View maps' : 'Add or edit data'; const title = (props.mode === 'view')? 'View maps' : 'Add or edit data';
let back = (props.mode === 'edit')? `/view/${dataLayer}.html` : undefined; const back = (props.mode === 'edit')? `/view/${dataLayer}.html` : undefined;
return ( return (
<Sidebar title={title} back={back}> <Sidebar title={title} back={back}>