108
rated 0 times
[
110]
[
2]
/ answers: 1 / hits: 16264
/ 7 Years ago, sun, april 23, 2017, 12:00:00
This is the config i have for eslint in .eslintrc.json
file:
{
env: {
browser: true,
commonjs: true,
es6: true
},
extends: eslint:recommended,
parserOptions: {
ecmaVersion: 6,
ecmaFeatures: {
experimentalObjectRestSpread: true,
jsx: true
},
sourceType: module
},
plugins: [
react
],
rules: {
react/jsx-uses-react: error,
react/jsx-uses-vars: [error],
indent: 0,
linebreak-style: [
error,
windows
],
quotes: [
error,
single
],
semi: [
error,
always
]
},
settings: {
react: {
pragma: React,
version: 15.0
}
}
}
This is the app.jsx
from the react workspace below:
import React, { Component } from 'react';
class App extends React.Component {
render () {
return(
<h1>Hello Newbies</h1>
);
}
}
export default App;
I am getting error from eslint 'Component' is defined but never used.
I can not fix this by doing anything so far but digging the web. How can i fix this error? Help would be very much appreciated.
More From » reactjs