Skip to content

Commit

Permalink
feat(eslint): init
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavier Carpentier committed Jun 1, 2016
1 parent c5dc48b commit 95918f5
Show file tree
Hide file tree
Showing 6 changed files with 249 additions and 3 deletions.
41 changes: 41 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
root = true

[*]
charset = utf-8
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[**.js]
indent_style = space
indent_size = 2
quote_type = single
space_after_anon_function = true
curly_bracket_next_line = true
brace_style = end-expand

[**.jsx]
indent_style = space
indent_size = 2
quote_type = single
space_after_anon_function = true
curly_bracket_next_line = true
brace_style = end-expand

[**.css]
indent_style = space
indent_size = 4

[**.html]
indent_style = space
indent_size = 4
max_char = 78
brace_style = expand

[node_modules/**.js]
codepaint = false

[*.json]
indent_style = space
indent_size = 2
36 changes: 36 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"rules": {
"indent": [
2,
2,
{"SwitchCase": 1}
],
"quotes": [
2,
"single"
],
"linebreak-style": [
2,
"unix"
],
"semi": [
2,
"always"
]
},
"env": {
"es6": true,
"node": true,
"amd": true
},
"extends": "eslint:recommended",
"ecmaFeatures": {
"jsx": true,
"experimentalObjectRestSpread": true,
"modules": true,
"async": true
},
"plugins": [
"react"
]
}
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.DS_Store

# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
/node_modules

# Xcode
*.xcuserstate
examples/ios/swiper.xcodeproj/project.xcworkspace/
examples/ios/swiper.xcodeproj/xcuserdata

# IntelliJ
.idea/
13 changes: 13 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.DS_Store
logs
*.log
pids
*.pid
*.seed
lib-cov
coverage
.lock-wscript
build/Release
node_modules
res
examples
112 changes: 112 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# react-native-country-picker-modal

[![npm version](http://img.shields.io/npm/dm/react-native-country-picker-modal.svg?style=flat-square)](https://npmjs.org/package/react-native-country-picker-modal "View this project on npm")

The best Country Picker for React Native.

![](http://i.imgur.com/WF4sdT7.gif)

### Installation
```bash
$ npm i react-native-country-picker-modal --save
```
### Basic Usage
- Install `react-native` first

```bash
$ npm i react-native -g
```

- Initialization of a react-native project

```bash
$ react-native init myproject
```

- Then, edit `myproject/index.ios.js`, like this:

```jsx
'use strict';
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View,
StatusBarIOS,
PixelRatio
} from 'react-native';

import CountryPicker from 'react-native-country-picker-modal';

class Example extends Component {
constructor(props){
StatusBarIOS.setHidden(true);
super(props);
this.state = {
cca2: 'US'
};
}
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to Country Picker !
</Text>
<CountryPicker
onChange={(value)=> this.setState({country: value})}
cca2={this.state.cca2}
translation='eng'
/>
<Text style={styles.instructions}>
press on the flag
</Text>
{this.state.country &&
<Text style={styles.data}>
{JSON.stringify(this.state.country, null, 2)}
</Text>
}
</View>
);
}
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center'
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
fontSize: 12,
textAlign: 'center',
color: '#888',
marginBottom: 5,
},
data: {
padding: 15,
marginTop: 10,
backgroundColor: '#ddd',
borderColor: '#888',
borderWidth: 1 / PixelRatio.get(),
color: '#777'
}
});

AppRegistry.registerComponent('example', () => Example);
```

## Contribution

- [@xcapentier](mailto:contact@xaviercarpentier.com) The main author.

## Questions

Feel free to [contact me](mailto:contact@xaviercarpentier.com) or [create an issue](https://github.com/xcarpentier/react-native-country-picker/issues/new)

> made with ♥
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
"name": "react-native-slack-webhook",
"version": "0.0.1",
"description": "Follow some activities (new user, payment, ...) from your app via Slack and this webhook lib ",
"main": "index.js",
"main": "dist/index.js",
"scripts": {
"test": "jest"
"test": "jest",
"build": "babel src --out-dir dist --presets es2015,react"
},
"repository": {
"type": "git",
Expand All @@ -19,5 +20,11 @@
"bugs": {
"url": "https://github.com/xcarpentier/react-native-slack-webhook/issues"
},
"homepage": "https://github.com/xcarpentier/react-native-slack-webhook#readme"
"homepage": "https://github.com/xcarpentier/react-native-slack-webhook#readme",
"devDependencies": {
"jest": "12.1.1",
"babel-cli": "6.9.0",
"babel-preset-es2015": "6.9.0",
"babel-preset-react": "6.5.0"
}
}

0 comments on commit 95918f5

Please sign in to comment.