Incorrect warning: Unused export with no option to suppress
A single file defines and exports 2 react stateless/functional components. I'm incorrectly receiving a warning about the exports being unused.
components.js
import React from 'react';
function H1(props) {
return (
<h1 {...props}
//also incorrectly get a warning that is_cool is an unresolved variable
className={props.is_cool ? 'first' : 'second'}>
{props.content}
</h1>
);
}
function DateTime() {
return (
<div>The date is now: {new Date().toLocaleString()}</div>
);
}
//incorrectly marked as 'Unused export'
export {H1, DateTime}

Clicking right arrow reveals NO WAY to suppress. I'm forced to disable completely. Also Fix all option does nothing.
This file uses the exports
index.js
import React from 'react';
import ReactDOM from 'react-dom';
import * as C from './components'; //H1 and DateTime ARE used
ReactDOM.render(
<div style={{padding: 30}}>
//H1 used
<C.H1 id={'heading' + 1}
is_cool={0}
title={'Very interesting stuff here.'}
content={'This is cool'}
style={{fontSize: 50, color: '#669', fontWeight: 'normal'}}
/>
//DateTime used
<C.DateTime/>
</div>,
document.getElementById('content')
);
Please sign in to leave a comment.
Please vote for https://youtrack.jetbrains.com/issue/WEB-32805 and https://youtrack.jetbrains.com/issue/WEB-31785 to be notified on any progress with these issues