I was using sublime text, but now would like to use the atom.io editor. I have these lines of code:
// error: Missing semicolon.
import React, { Component } from 'react'
export default class RegisterName extends Component {
    constructor(props) {
        // error: Missing semicolon.
        super(props)
        this.state = {
            firstName: '',
            lastName: '',
            displayError: false,
            error: 'Please provide a valid name'
        //error: Missing semicolon.
        }
    }
    // error: Class property must be methods. Expected '(' but saw instead '='....
    next = () => {
        console.log('next')
        console.log(this.state.firstName, this.state.lastName)
    }
    render() {
        return(
            <View style={styles.container}>
                <View>
                    <TouchableOpacity style={styles.logoContainer}>
                        <Icon name="md-analytics" size={60} color="#2ec76e" />
                    // error: Unclosed regular expression
                    </TouchableOpacity>
Although this code is working fine. I'm getting these errors in atom.io editor. I have added the .jshintrc file, with these lines:
{
    "esnext": true
}
Also the grammar is set to: Babel E6 Javascript
But even this is not helping. How do I remove these errors?
In your root directory, add a new file:
.jshintrc
Add the following code and save:
{
   "esversion": 6
}
You can find the settings in using ctrl+, to open the settings and go to packages => linter-jshint (or something like that) and find the pointer to the .jshintrc file. If the file in your project structure differs, you can change that here.
npm install language-babel in the terminal.  If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With