Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
Add README
Browse files Browse the repository at this point in the history
  • Loading branch information
Nico Dinata committed Feb 29, 2020
1 parent a807b13 commit e9fee04
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# import-sort-style-rn

Sensible [import sorting](https://github.com/renke/import-sort/) style for React Native projects.

## Installation

```
yarn add --dev import-sort-cli import-sort-style-rn
```

## Setup

Add the following to your `package.json`:

```json
"importSort": {
".js, .jsx, .ts, .tsx": {
"style": "rn"
}
}
```

## Style

```javascript
// Modules with side effects (not sorted internally because order may matter)
import 'c';
import 'a';

// React (Native) modules
import React from 'react';
import { Text, ... } from 'react-native';

// Node.js modules
import { readFile } from 'fs';

// Installed modules
import axios from 'axios';

// "External" project modules ("../")
import Divider from '../components/Divider';

// "Internal" project modules ("./")
import Bubble from './Bubble';

// Resource files (.png, .jpg, .jpeg, .svg)
import Logo from '../assets/logo.png';

```

### References

- https://github.com/renke/import-sort/tree/master/packages/import-sort-style-module
- https://github.com/pietile/import-sort-style-pietile

0 comments on commit e9fee04

Please sign in to comment.