Skip to content

Commit

Permalink
Adding react-native-community lint (react-native-share#479)
Browse files Browse the repository at this point in the history
  • Loading branch information
MateusAndrade authored and jgcmarins committed Apr 20, 2019
1 parent 24a1deb commit 3849e95
Show file tree
Hide file tree
Showing 4 changed files with 333 additions and 33 deletions.
30 changes: 3 additions & 27 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,10 @@
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:import/errors"
"plugin:import/errors",
"@react-native-community"

],
"rules": {
"comma-dangle": [2, "always-multiline"],
"quotes": [2, "single", { "allowTemplateLiterals": true }],
"react/prop-types": 0,
"no-case-declarations": 0,
"react/jsx-no-bind": 0,
"react/display-name": 0,
"new-cap": 0,
"react-native/no-unused-styles": 2,
"react-native/split-platform-components": 0,
"react-native/no-inline-styles": 0,
"react-native/no-color-literals": 0,
"no-unexpected-multiline": 0,
"no-class-assign": 1,
"no-console": 2,
"object-curly-spacing": [1, "always"],
"flowtype/define-flow-type": 1,
"flowtype/use-flow-type": 1,
"import/first": 2,
"import/default": 0,
"no-unused-vars": ["error", { "ignoreRestSiblings": true }],
"import/named": 0,
"import/namespace": [2, { "allowComputed": true }],
"no-extra-boolean-cast": 0,
"import/no-duplicates": 2
},
"settings": {
"import/resolver": {
"node": {
Expand Down
7 changes: 5 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ type Props = {
children: React.Node,
};

const shareSheetStyle = { flex: 1 };

class ShareSheet extends React.Component<Props> {
backButtonHandler: () => boolean;

Expand All @@ -61,7 +63,7 @@ class ShareSheet extends React.Component<Props> {
return (
<Overlay visible={this.props.visible} {...this.props}>
<View style={styles.actionSheetContainer}>
<TouchableOpacity style={{ flex: 1 }} onPress={this.props.onCancel} />
<TouchableOpacity style={shareSheetStyle} onPress={this.props.onCancel} />
<Sheet visible={this.props.visible}>
<View style={styles.buttonContainer}>{this.props.children}</View>
</Sheet>
Expand Down Expand Up @@ -162,7 +164,8 @@ class RNShare {
static InstagramStories = {
SHARE_BACKGROUND_IMAGE: NativeModules.RNShare.SHARE_BACKGROUND_IMAGE || 'shareBackgroundImage',
SHARE_STICKER_IMAGE: NativeModules.RNShare.SHARE_STICKER_IMAGE || 'shareStickerImage',
SHARE_BACKGROUND_AND_STICKER_IMAGE: NativeModules.RNShare.SHARE_BACKGROUND_AND_STICKER_IMAGE || 'shareBackgroundAndStickerImage',
SHARE_BACKGROUND_AND_STICKER_IMAGE:
NativeModules.RNShare.SHARE_BACKGROUND_AND_STICKER_IMAGE || 'shareBackgroundAndStickerImage',
};

static open(options: Options | MultipleOptions): Promise<OpenReturn> {
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
"devDependencies": {
"@commitlint/cli": "^6.1.0",
"@commitlint/config-conventional": "^6.1.0",
"@react-native-community/eslint-config": "^0.0.4",
"babel-eslint": "^8.2.1",
"eslint": "^4.17.0",
"eslint-plugin-flowtype": "^2.46.2",
"eslint-plugin-import": "^2.11.0",
"eslint-plugin-react": "^7.6.1",
"eslint-plugin-prettier": "2.6.2",
"eslint-plugin-react-native": "^3.2.0",
"flow-bin": "^0.77.0",
"generate-changelog": "1.7.0",
Expand Down Expand Up @@ -54,7 +56,7 @@
"readmeFilename": "README.md",
"scripts": {
"commitmsg": "commitlint -e $GIT_PARAMS",
"lint": "eslint src --max-warnings=0",
"lint": "eslint index.js --max-warnings=0",
"lint:staged": "lint-staged",
"prettier": "prettier --write --single-quote true --trailing-comma all --print-width 100",
"release:major": "node ./changelog --major && npm version major && git push origin && git push origin --follow-tags",
Expand Down
Loading

0 comments on commit 3849e95

Please sign in to comment.