Skip to content

Commit 28c1d36

Browse files
author
soliury
committed
use eslint to config standardjs
1 parent 42e1ac9 commit 28c1d36

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+5408
-5808
lines changed

.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
root = true
33

44
[*]
5-
indent_style = tab
6-
indent_size = 4
5+
indent_style = space
6+
indent_size = 2
77
end_of_line = lf
88
charset = utf-8
99
trim_trailing_whitespace = true

.eslintignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

.eslintrc

Lines changed: 60 additions & 244 deletions
Large diffs are not rendered by default.

index.android.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import React from 'react';
2-
import {AppRegistry} from 'react-native';
3-
import Noder from './src';
1+
import React from 'react'
2+
import {AppRegistry} from 'react-native'
3+
import Noder from './src'
44

5-
6-
AppRegistry.registerComponent('noder', () => Noder);
5+
AppRegistry.registerComponent('noder', () => Noder)

index.ios.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ import React from 'react'
22
import {AppRegistry} from 'react-native'
33
import Noder from './src'
44

5-
65
AppRegistry.registerComponent('noder', () => Noder)

index.web.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import 'babel-polyfill';
2-
import {AppRegistry} from 'react-native';
3-
import Noder from './src';
1+
import 'babel-polyfill'
2+
import {AppRegistry} from 'react-native'
3+
import Noder from './src'
44

5+
AppRegistry.registerComponent('noder', () => Noder)
56

6-
AppRegistry.registerComponent('noder', () => Noder);
7-
8-
var app = document.createElement('div');
9-
document.body.appendChild(app);
7+
var app = document.createElement('div')
8+
document.body.appendChild(app)
109

1110
AppRegistry.runApplication('noder', {
12-
rootTag: app
13-
});
11+
rootTag: app
12+
})

package.json

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"push-android-prod": "code-push release-react Noder android --deploymentName Production",
1818
"push-ios-prod": "code-push release-react Noder ios --deploymentName Production",
1919
"push-key": "code-push deployment ls Noder -k",
20-
"i-taobao": "npm i --registry=https://registry.npm.taobao.org"
20+
"i-taobao": "npm i --registry=https://registry.npm.taobao.org",
21+
"standard": "eslint --fix '**/*.js'"
2122
},
2223
"dependencies": {
2324
"flux-standard-action": "^1.2.0",
@@ -57,7 +58,12 @@
5758
"coffee-script": "^1.9.2",
5859
"dev-ip": "^1.0.1",
5960
"eslint": "^3.19.0",
61+
"eslint-config-standard": "^10.2.0",
62+
"eslint-config-standard-react": "^4.3.0",
63+
"eslint-plugin-flowtype": "^2.30.4",
64+
"eslint-plugin-promise": "^3.5.0",
6065
"eslint-plugin-react": "^6.10.3",
66+
"eslint-plugin-standard": "^3.0.1",
6167
"file-loader": "^0.9.0",
6268
"gulp": "^3.9.1",
6369
"gulp-replace": "^0.5.4",
@@ -68,6 +74,8 @@
6874
"react-native-cli": "^0.2.0",
6975
"redux-devtools": "^3.3.1",
7076
"run-sequence": "^1.2.2",
77+
"snazzy": "^7.0.0",
78+
"standard": "^10.0.1",
7179
"url-loader": "^0.5.7",
7280
"webpack": "^1.13.2",
7381
"webpack-dev-server": "^1.14.1",
@@ -77,5 +85,16 @@
7785
"node": ">= 4.x",
7886
"npm": ">= 3.x"
7987
},
80-
"bundleId": "org.reactjs.native.example.noder"
88+
"bundleId": "org.reactjs.native.example.noder",
89+
"standard": {
90+
"ignore": [],
91+
"globals": [
92+
"__DEV__"
93+
],
94+
"parser": "babel-eslint",
95+
"plugins": [
96+
"flowtype",
97+
"react"
98+
]
99+
}
81100
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import {Platform} from 'react-native';
1+
import {Platform} from 'react-native'
22

3-
module.exports = Platform.OS === 'web' ? require('./BlurView.ios') : require('./BlurView.' + Platform.OS);
3+
module.exports = Platform.OS === 'web' ? require('./BlurView.ios') : require('./BlurView.' + Platform.OS)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import {Platform} from 'react-native';
1+
import {Platform} from 'react-native'
22

3-
module.exports = Platform.OS === 'web' ? require('./VibrancyView.ios') : require('./VibrancyView.' + Platform.OS);
3+
module.exports = Platform.OS === 'web' ? require('./VibrancyView.ios') : require('./VibrancyView.' + Platform.OS)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import {Platform} from 'react-native';
1+
import {Platform} from 'react-native'
22

3-
module.exports = Platform.OS === 'web' ? require('./Button.ios') : require('./Button.' + Platform.OS);
3+
module.exports = Platform.OS === 'web' ? require('./Button.ios') : require('./Button.' + Platform.OS)

0 commit comments

Comments
 (0)