eslint

React-navigation, tintColor is missing in props validation

允我心安 提交于 2020-05-15 04:15:28
问题 I have put my react-navigation code into a separate Routes file which I am then importing into my App.js file. Everything is working fine but I am using Airbnb ESLint config in Atom/Nuclide and getting an error with tintColor... "tintColor is missing in props validation" Tried this: Routes.propTypes = { tintColor: PropTypes.string.isRequired,} But then get error "tintColor PropType is defined but prop is never used" This is part of the code const Routes = () = { const ContentNavigator =

how to use ejs lint in cli

て烟熏妆下的殇ゞ 提交于 2020-05-15 02:58:06
问题 I am using EJS as my view engine on a node and express setup. I want to use ejs-lint to help get the line for errors. I haven't use a linter before, but from reading through the documentation here: https://github.com/RyanZim/EJS-Lint I'm assuming you can just check errors on a specified file in command line like this: ejslint Are my assumptions right and what am I doing wrong? I've already installed using npm install ejs-lint --save-dev Also, if I plan to add ESlint to my project I'm guessing

TSLint configuration for Angular 1 project

江枫思渺然 提交于 2020-05-15 02:44:08
问题 my team is working on project using Angular 1.5.* + typescript. Can someone give me advice for best TSLint configuration for such project as mine? I want now to add TSLint config ( https://github.com/Microsoft/TypeScript/blob/master/tslint.json) from official TS repo and with ESlint rules set. https://github.com/Microsoft/TypeScript/blob/master/tslint.json Will it be enough? What do you think? Thank you in advance for your answers. 回答1: Will it be enough? What do you think? Personally I don't

Component definition is missing display name react/display-name

≯℡__Kan透↙ 提交于 2020-05-14 14:43:47
问题 How do I add a display name to this? export default () => <Switch> <Route path="/login" exact component={LoginApp}/> <Route path="/faq" exact component={FAQ}/> <Route component={NotFound} /> </Switch>; 回答1: Put the function in a variable, set displayName on the function, and then export it. const MyComponent = () => ( <Switch> <Route path="/login" exact component={LoginApp}/> <Route path="/faq" exact component={FAQ}/> <Route component={NotFound} /> </Switch> ); MyComponent.displayName =

Component definition is missing display name react/display-name

為{幸葍}努か 提交于 2020-05-14 14:43:45
问题 How do I add a display name to this? export default () => <Switch> <Route path="/login" exact component={LoginApp}/> <Route path="/faq" exact component={FAQ}/> <Route component={NotFound} /> </Switch>; 回答1: Put the function in a variable, set displayName on the function, and then export it. const MyComponent = () => ( <Switch> <Route path="/login" exact component={LoginApp}/> <Route path="/faq" exact component={FAQ}/> <Route component={NotFound} /> </Switch> ); MyComponent.displayName =

Component definition is missing display name react/display-name

大兔子大兔子 提交于 2020-05-14 14:43:09
问题 How do I add a display name to this? export default () => <Switch> <Route path="/login" exact component={LoginApp}/> <Route path="/faq" exact component={FAQ}/> <Route component={NotFound} /> </Switch>; 回答1: Put the function in a variable, set displayName on the function, and then export it. const MyComponent = () => ( <Switch> <Route path="/login" exact component={LoginApp}/> <Route path="/faq" exact component={FAQ}/> <Route component={NotFound} /> </Switch> ); MyComponent.displayName =

Eslint determine globals from another file

落花浮王杯 提交于 2020-05-10 04:14:10
问题 I'm trying to set up ESLint in such a way that it parses a globals declaration file before linting the actual target file, so that I don't have to declare as globals all the functions and variables that are indeed globals, but letting the parser figure that out: In some_module.js : function do_something() { if (glob_action("foobar")) { ... something something ... } } While in globals.js I have a set of utilities and global variables: function glob_action(x) { ... something something ... } So

Eslint determine globals from another file

青春壹個敷衍的年華 提交于 2020-05-10 04:13:46
问题 I'm trying to set up ESLint in such a way that it parses a globals declaration file before linting the actual target file, so that I don't have to declare as globals all the functions and variables that are indeed globals, but letting the parser figure that out: In some_module.js : function do_something() { if (glob_action("foobar")) { ... something something ... } } While in globals.js I have a set of utilities and global variables: function glob_action(x) { ... something something ... } So

Eslint determine globals from another file

夙愿已清 提交于 2020-05-10 04:13:17
问题 I'm trying to set up ESLint in such a way that it parses a globals declaration file before linting the actual target file, so that I don't have to declare as globals all the functions and variables that are indeed globals, but letting the parser figure that out: In some_module.js : function do_something() { if (glob_action("foobar")) { ... something something ... } } While in globals.js I have a set of utilities and global variables: function glob_action(x) { ... something something ... } So

Eslint determine globals from another file

限于喜欢 提交于 2020-05-10 04:11:21
问题 I'm trying to set up ESLint in such a way that it parses a globals declaration file before linting the actual target file, so that I don't have to declare as globals all the functions and variables that are indeed globals, but letting the parser figure that out: In some_module.js : function do_something() { if (glob_action("foobar")) { ... something something ... } } While in globals.js I have a set of utilities and global variables: function glob_action(x) { ... something something ... } So