Skip to content

Commit 9082f5b

Browse files
committed
lint added
1 parent bc8a2a8 commit 9082f5b

8 files changed

Lines changed: 787 additions & 86 deletions

File tree

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ protected List<ReactPackage> getPackages() {
7474

7575
Sync gradle and go :)
7676

77-
#Methods
77+
# Methods
7878

79-
##Since version >= 3.0.0
79+
## Since version >= 3.0.0
8080

8181
We unified our library's methods to bring more efficiency and simplify the usability for other developers. We hope that you enjoy it. :)
8282

@@ -93,7 +93,8 @@ We unified our library's methods to bring more efficiency and simplify the usabi
9393
```javascript
9494
SInfo.setItem('key1', 'value1', {
9595
sharedPreferencesName: 'mySharedPrefs',
96-
keychainService: 'myKeychain'});
96+
keychainService: 'myKeychain',
97+
encript: true});
9798
```
9899

99100
But if you prefer to not use it, our default sharedPreferencesName is: **shared_preferences** and keychainService is: **app**
@@ -130,10 +131,6 @@ keychainService: 'myKeychain'}).then(values => {
130131
});
131132

132133
```
133-
#Contributing
134+
# Contributing
134135

135136
Pull requests are welcome :)
136-
137-
# Future Works
138-
139-
* Add support for Android's keystore

example/.eslintrc

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"parser": "babel-eslint",
3+
"extends": "airbnb",
4+
"globals": {
5+
"__DEV__": true
6+
},
7+
"env": {
8+
"browser": true,
9+
"node": true
10+
},
11+
"rules": {
12+
"comma-dangle": 0,
13+
"spaced-comment": 0,
14+
"camelcase": 0,
15+
"no-param-reassign": 0,
16+
"no-restricted-syntax": 0,
17+
"new-cap": [2, { "capIsNewExceptions": ["Map"] }],
18+
"no-underscore-dangle": 0,
19+
"global-require": 0,
20+
"no-nested-ternary": 0,
21+
"import/no-unresolved": [2, { ignore: ['dismissKeyboard'] }],
22+
"no-multiple-empty-lines": [2, { "max": 2, "maxEOF": 1 }],
23+
"prefer-template": 0,
24+
"react/prop-types": 0, //remove soon
25+
"react/prefer-stateless-function": 0,
26+
"react/jsx-filename-extension": 0
27+
},
28+
"plugins": ["react"],
29+
}

example/android/app/app.iml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,29 @@
7676
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
7777
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
7878
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
79+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
7980
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
81+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
82+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
8083
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
84+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-classes" />
85+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-runtime-classes" />
86+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
87+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-verifier" />
88+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-resources" />
89+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-support" />
90+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
8191
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
92+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" />
8293
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
94+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/restart-dex" />
8395
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
96+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
97+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/split-apk" />
8498
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
99+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
85100
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
101+
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
86102
</content>
87103
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
88104
<orderEntry type="sourceFolder" forTests="false" />

example/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ android {
8888

8989
defaultConfig {
9090
applicationId "com.example"
91-
minSdkVersion 16
91+
minSdkVersion 18
9292
targetSdkVersion 25
9393
versionCode 1
9494
versionName "1.0"

example/app.js

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { Component } from 'react';
2+
23
import {
34
AppRegistry,
45
StyleSheet,
@@ -8,38 +9,58 @@ import {
89

910
import SInfo from 'react-native-sensitive-info';
1011

11-
import RNSensitiveInfo from 'react-native-sensitive-info'; //<-- Add this line
12+
const styles = StyleSheet.create({
13+
container: {
14+
flex: 1,
15+
justifyContent: 'center',
16+
alignItems: 'center',
17+
backgroundColor: '#F5FCFF',
18+
},
19+
welcome: {
20+
fontSize: 20,
21+
textAlign: 'center',
22+
margin: 10,
23+
},
24+
instructions: {
25+
textAlign: 'center',
26+
color: '#333333',
27+
marginBottom: 5,
28+
},
29+
});
1230

1331
class example extends Component {
1432

1533
render() {
16-
1734
SInfo.setItem('key1', 'value1', {
18-
sharedPreferencesName: 'mySharedPrefs',
19-
keychainService: 'myKeychain'});
35+
sharedPreferencesName: 'mySharedPrefs',
36+
keychainService: 'myKeychain',
37+
encrypt: true });
2038

2139
SInfo.setItem('key2', 'value2');
2240

2341
SInfo.getItem('key1', {
24-
sharedPreferencesName: 'mySharedPrefs',
25-
keychainService: 'myKeychain'}).then(value => {
26-
console.log(value) //value1
27-
});
42+
sharedPreferencesName: 'mySharedPrefs',
43+
keychainService: 'myKeychain',
44+
encrypt: true }).then((value) => {
45+
console.log(value); //value1
46+
});
2847

29-
SInfo.getItem('key2').then(value => {
30-
console.log(value) //value2
48+
SInfo.getItem('key2').then((value) => {
49+
console.log(value); //value2
3150
});
3251

3352
SInfo.getAllItems({
34-
sharedPreferencesName: 'mySharedPrefs',
35-
keychainService: 'myKeychain'}).then(values => {
36-
console.log(values) //value1
37-
});
53+
sharedPreferencesName: 'mySharedPrefs',
54+
keychainService: 'myKeychain',
55+
encrypt: true }).then((values) => {
56+
console.log(values); //value1
57+
});
3858

3959
SInfo.deleteItem('key2');
40-
SInfo.deleteItem('key1',{
41-
sharedPreferencesName: 'mySharedPrefs',
42-
keychainService: 'myKeychain'});
60+
SInfo.deleteItem('key1', {
61+
sharedPreferencesName: 'mySharedPrefs',
62+
keychainService: 'myKeychain',
63+
encrypt: true });
4364

4465
return (
4566
<View style={styles.container}>
@@ -57,23 +78,4 @@ class example extends Component {
5778
}
5879
}
5980

60-
const styles = StyleSheet.create({
61-
container: {
62-
flex: 1,
63-
justifyContent: 'center',
64-
alignItems: 'center',
65-
backgroundColor: '#F5FCFF',
66-
},
67-
welcome: {
68-
fontSize: 20,
69-
textAlign: 'center',
70-
margin: 10,
71-
},
72-
instructions: {
73-
textAlign: 'center',
74-
color: '#333333',
75-
marginBottom: 5,
76-
},
77-
});
78-
7981
AppRegistry.registerComponent('example', () => example);

example/ios/example.xcodeproj/project.pbxproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
2DCD954D1E0B4F2C00145EB5 /* exampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* exampleTests.m */; };
3636
5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; };
3737
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
38-
A4D103ED5EDE4FB8BB256916 /* libRNSensitiveInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B341D5FA3AE45E4BAE5BE06 /* libRNSensitiveInfo.a */; };
38+
67C3EC358B26457A82EDDB93 /* libRNSensitiveInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 839B8927141841059619133C /* libRNSensitiveInfo.a */; };
3939
/* End PBXBuildFile section */
4040

4141
/* Begin PBXContainerItemProxy section */
@@ -255,8 +255,8 @@
255255
5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = "<group>"; };
256256
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
257257
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
258-
9EFE0BC7C34247C7B38835F1 /* RNSensitiveInfo.xcodeproj */ = {isa = PBXFileReference; name = "RNSensitiveInfo.xcodeproj"; path = "../node_modules/react-native-sensitive-info/ios/RNSensitiveInfo.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
259-
6B341D5FA3AE45E4BAE5BE06 /* libRNSensitiveInfo.a */ = {isa = PBXFileReference; name = "libRNSensitiveInfo.a"; path = "libRNSensitiveInfo.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
258+
74F76C9F053A446CB5E2440D /* RNSensitiveInfo.xcodeproj */ = {isa = PBXFileReference; name = "RNSensitiveInfo.xcodeproj"; path = "../node_modules/react-native-sensitive-info/ios/RNSensitiveInfo.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
259+
839B8927141841059619133C /* libRNSensitiveInfo.a */ = {isa = PBXFileReference; name = "libRNSensitiveInfo.a"; path = "libRNSensitiveInfo.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
260260
/* End PBXFileReference section */
261261

262262
/* Begin PBXFrameworksBuildPhase section */
@@ -283,7 +283,7 @@
283283
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
284284
00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
285285
139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
286-
A4D103ED5EDE4FB8BB256916 /* libRNSensitiveInfo.a in Frameworks */,
286+
67C3EC358B26457A82EDDB93 /* libRNSensitiveInfo.a in Frameworks */,
287287
);
288288
runOnlyForDeploymentPostprocessing = 0;
289289
};
@@ -450,7 +450,7 @@
450450
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
451451
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
452452
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
453-
9EFE0BC7C34247C7B38835F1 /* RNSensitiveInfo.xcodeproj */,
453+
74F76C9F053A446CB5E2440D /* RNSensitiveInfo.xcodeproj */,
454454
);
455455
name = Libraries;
456456
sourceTree = "<group>";

example/package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,13 @@
88
"react": "^16.0.0-alpha.6",
99
"react-native": "^0.44.0",
1010
"react-native-sensitive-info": "file:../"
11+
},
12+
"devDependencies": {
13+
"babel-eslint": "^7.2.3",
14+
"eslint": "3.19.0",
15+
"eslint-config-airbnb": "^14.1.0",
16+
"eslint-plugin-import": "^2.2.0",
17+
"eslint-plugin-jsx-a11y": "^5.0.1",
18+
"eslint-plugin-react": "^7.0.0"
1119
}
1220
}

0 commit comments

Comments
 (0)