Closed srhwork closed 8 years ago
I've made an issue about this: https://github.com/cst/cst/issues/112
@srh-work Btw, why you using:
class NotFound extends Component {
render = () => {};
}
instead of just
class NotFound extends Component {
render() {}
}
?
@zxqfox I'm using that syntax just for fun...nothing special.
After trying a lot, I managed to remove the warning in this way:
1.- Remove the "@class" property of the class block 2.- Using the classic syntax for function properties declaration "from render = () => {}; to render() {}" 3.- Adding "@return" property to blocks for functions with returning value 4.- Declare statics properties outside of the class
/**
* Error 404 component
*/
class NotFound extends Component {
/**
* React DOM rendering
*
* @return {Object} React DOM object
*/
render() {
return (
<div className='container'>
<section>
<h1 style={codeStyle}>404</h1>
<div>
<h2>
<i className='fa fa-warning' /> Oops! Página no encontrada.
</h2>
<br />
<p>
La página que ha solicitado no se encuentra disponible, esto puede ser debido
a que la ruta ha cambiado, o la dirección que ha escrito es incorrecta.
</p>
</div>
</section>
</div>
);
}
}
NotFound.propTypes = {
children: PropType.object.isRequired
}
@zxqfox since your issue was addressed in cst/cst#119, can this be fixed by updating cst
to 0.2.0
?
I'm also getting this issue with propTypes
in React components:
import React from 'react';
// ...
export default class App extends React.Component {
static propTypes = {
children: React.PropTypes.element.isRequired
};
// ...
}
This is using the latest version of jscs
by specifying the repo in package.json:
{
"devDependencies": {
"jscs": "jscs-dev/node-jscs"
}
}
Output:
Cannot iterate using ClassProperty at ./ui/App.js :
1 |import React from 'react';
--------^
2 |
3 |
1 code style error found.
If I remove the class property it runs through without errors.
can this be fixed by updating cst to 0.2.0?
It totally can :)
What do you think about making 1.0 so we can use ^
I guess.
@mdevils thoughts?
@markelog Thanks!
Version: 3.0.3