question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

react-native configuration flow example

See original GitHub issue

Hello there:

I have been battling trying to find a solid react-native setup example, that I can quickly install but have not yet found the ideal solution yet.

For some setups I get:

  • 'styles' was used before it was defined for others:
  • JSX not allowed in files with extension '.js' and so on… and of course I read a few suggestions like: "react/jsx-filename-extension": ["error", { "extensions": [".js", ".jsx"] }],

But there is no turn key solution/tutorial for this please…

So the furthest cleanest setup I have seen so far but not complete is:

running in your terminal:

export PKG=eslint-config-airbnb;
npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG@latest"

Then create a .eslintrc file and paste:

{
  "extends": "airbnb",
}

But now this alone is not sufficient for a react-native app… so please please please advise and update docs 😃

Thank you.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
julesmoretticommented, Dec 21, 2016

Perfect! I updated the .eslintrc and added the no-console: 0

{
  "extends": "airbnb",
  "rules": {
    "react/jsx-filename-extension": ["error", { "extensions": [".js", ".jsx"] }],
    "no-console": 0,
  }
}

Thank you!

0reactions
ljharbcommented, Dec 21, 2016

if the component has lifecycle methods, the linter won’t require it be an SFC.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Started with React Native and Flow | by Nader Dabit
The .flowconfig file is a place to put your specific flow configuration, similar to an .eslintrc file for eslint. New React Native projects ......
Read more >
A guide to Flow in React Native
The first thing to do to get started with Flow is to add // @flow at the top of the document. This will...
Read more >
React Runtimes
This guide will teach you how to use Flow to create safer React applications. In this guide we will assume you know the...
Read more >
Building a reusable auth flow in React Native
For a complete walkthrough on setting up a development environment for React Native on your local machine, you can go through the official ......
Read more >
Setting up an Authentication Flow in React Native
Setting up an Authentication Flow in React Native · They land on an entry point file. This file will check if they're a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found