Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Changes no-unused-expressions lint from warning to error #2319

Conversation

amupitan
Copy link
Contributor

Build crashes whenever JSX is not returned as proposed here: #2303.

The build crashes whenever JSX isn't returned, as opposed to just giving a warning.

screenshot

To test:

Create a stateless component without a return clause.
For example:
import React from 'react';
export default function Logo(){
<div className="App-header">
<img src="./logo.svg" className="App-logo" alt="logo" />
<h2>Welcome to React</h2>
</div>
}

@gaearon gaearon added this to the 2.0.0 milestone May 22, 2017
@gaearon
Copy link
Contributor

gaearon commented May 22, 2017

I’m going to come back to this after we’re ready to cut over to 2.0 (with some other breaking changes). Thanks!

@kachkaev
Copy link

It'd be great if you considered adding allowTaggedTemplates: true if accepting this PR. See motivation in eslint/eslint#7632.

Without allowTaggedTemplates: true, things like this will cause an error, which is definitely not wanted:

import { injectGlobal } from 'styled-components';

injectGlobal`
  body {
    background: #f00,
  }
`;

@gaearon gaearon changed the base branch from master to next January 16, 2018 16:23
@gaearon gaearon merged commit ed27629 into facebook:next Jan 17, 2018
akstuhl pushed a commit to akstuhl/create-react-app that referenced this pull request Mar 15, 2018
* Changes no-unused-expressions lint from warning to error

* Update index.js

* Update index.js
@lock lock bot locked and limited conversation to collaborators Jan 20, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants