mcrowder65 / eslint-config-mcrowder65

0 stars 0 forks source link

Force consistent spacing with classes and html with react #10

Open mcrowder65 opened 6 years ago

mcrowder65 commented 6 years ago
//This shouldn't be allowed
      <Card className={styles.card}>
    name: {name} <br/>
    itemId: {itemId}<br/>
      </Card>

// This is acceptable
<Card className={styles.card}>
     name: {name} <br/>
     itemId: {itemId}<br/>
</Card>

Classes

// This shouldn't be acceptable
class FirstGraphqlComponent extends React.Component {
    state = {
      input: "",
    }

  onInputChange = e => {
    this.setState({ input: e.target.value });
  }
}

// This is acceptable, however
class FirstGraphqlComponent extends React.Component {
  state = {
    input: "",
  }

  onInputChange = e => {
    this.setState({ input: e.target.value });
  }
}