Skip to content

Commit 0bc1c34

Browse files
authored
Merge pull request #3 from synonymdev/example-and-linting-updates
Example Project Update
2 parents 2a29853 + f0ca0dc commit 0bc1c34

Some content is hidden

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

64 files changed

+5049
-24446
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
dist
33
src/protos
4+
example

.eslintrc

Lines changed: 57 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,70 @@
11
{
22
"root": true,
3+
"extends": "@react-native-community",
34
"parser": "@typescript-eslint/parser",
4-
"parserOptions": {
5-
"project": [
6-
"./src/tsconfig.json"
7-
]
5+
"plugins": ["@typescript-eslint"],
6+
"globals": {
7+
"localStorage": false
88
},
9-
"plugins": [
10-
"@typescript-eslint",
11-
"prettier",
12-
"no-null"
13-
],
14-
"extends": [
15-
"@react-native-community",
16-
"standard-with-typescript",
17-
"prettier",
18-
"prettier/@typescript-eslint",
19-
"prettier/standard"
20-
],
219
"rules": {
22-
"no-param-reassign": "error",
10+
"semi": "off",
11+
"@typescript-eslint/semi": ["error"],
2312
"no-shadow": "off",
24-
"prettier/prettier": "warn",
13+
"@typescript-eslint/no-shadow": "error",
14+
"@typescript-eslint/no-unused-vars": "error",
15+
"react-hooks/rules-of-hooks": "error",
16+
"react-hooks/exhaustive-deps": "warn",
17+
"no-console": 0,
18+
"no-empty": ["error", { "allowEmptyCatch": true }],
19+
"no-buffer-constructor": 0,
20+
"no-case-declarations": 0,
21+
"no-useless-escape": 0,
22+
"react/jsx-no-duplicate-props": [2, { "ignoreCase": true }],
23+
"react-native/no-unused-styles": 1,
24+
"react-native/no-raw-text": 0,
25+
"react/jsx-equals-spacing": [2, "never"],
26+
"react/no-unsafe": [2, { "checkAliases": true }],
27+
"react/jsx-curly-spacing": [
28+
2,
29+
{
30+
"when": "never",
31+
"attributes": { "allowMultiline": true },
32+
"children": true
33+
}
34+
],
2535
"indent": [
2636
2,
2737
"tab",
2838
{ "SwitchCase": 1, "ignoredNodes": ["ConditionalExpression"] }
2939
],
30-
"no-null/no-null": "error",
31-
"@typescript-eslint/ban-types": ["error", { "types": { "null": null } }],
32-
"@typescript-eslint/no-explicit-any": "error",
33-
"@typescript-eslint/no-non-null-assertion": "error",
34-
"@typescript-eslint/ban-ts-comment": "error",
35-
"@typescript-eslint/switch-exhaustiveness-check": "error",
36-
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
37-
"@typescript-eslint/explicit-function-return-type": "error",
38-
"@typescript-eslint/no-unused-vars": "warn",
39-
"@typescript-eslint/strict-boolean-expressions": "off",
40-
"@typescript-eslint/restrict-template-expressions": "off"
40+
"object-curly-spacing": [
41+
"error",
42+
"always",
43+
{
44+
"objectsInObjects": true
45+
}
46+
],
47+
"react/jsx-uses-vars": 2,
48+
"react/jsx-wrap-multilines": 2,
49+
"react/jsx-tag-spacing": [
50+
2,
51+
{
52+
"closingSlash": "never",
53+
"beforeSelfClosing": "always",
54+
"afterOpening": "never",
55+
"beforeClosing": "never"
56+
}
57+
],
58+
"react/jsx-indent": [2, "tab", { "indentLogicalExpressions": false }],
59+
"react/jsx-child-element-spacing": 2,
60+
"react/no-unused-prop-types": 2,
61+
"react/prop-types": 0,
62+
"no-undef": 0,
63+
"react/display-name": 0,
64+
"require-atomic-updates": 0,
65+
"no-async-promise-executor": 0,
66+
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
67+
"@typescript-eslint/explicit-function-return-type": "warn",
68+
"jest/no-disabled-tests": 0
4169
}
4270
}

.prettierrc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"semi": true,
2+
"bracketSpacing": true,
3+
"bracketSameLine": true,
34
"singleQuote": true,
4-
"jsxSingleQuote": true,
5-
"trailingComma": "none",
6-
"printWidth": 100,
5+
"trailingComma": "all",
76
"useTabs": true,
8-
"tabWidth": 2
7+
"tabWidth": 2,
8+
"semi": true
99
}

example/.bundle/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1

example/.eslintignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
node_modules
2+
nodejs-assets/*
3+
ios/*
4+
android/*
5+
!.eslintrc.js
6+
metro.config.js
7+
postinstall.js
8+
__mocks__/**
9+
coverage
10+
11+
src/utils/backup/protos

example/.eslintrc.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
root: true,
3-
extends: '@react-native-community',
4-
parser: '@typescript-eslint/parser',
2+
root: true,
3+
extends: '@react-native-community',
4+
parser: '@typescript-eslint/parser',
55
};

example/.flowconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ node_modules/react-native/Libraries/polyfills/.*
1111
; Flow doesn't support platforms
1212
.*/Libraries/Utilities/LoadingView.js
1313

14+
.*/node_modules/resolve/test/resolver/malformed_package_json/package\.json$
15+
1416
[untyped]
1517
.*/node_modules/@react-native-community/cli/.*/.*
1618

@@ -62,4 +64,4 @@ untyped-import
6264
untyped-type-import
6365

6466
[version]
65-
^0.158.0
67+
^0.170.0

example/.gitattributes

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

example/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,6 @@ buck-out/
5656
# Bundle artifact
5757
*.jsbundle
5858

59-
# CocoaPods
59+
# Ruby / CocoaPods
6060
/ios/Pods/
61+
/vendor/bundle/

example/.prettierrc.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module.exports = {
2-
bracketSpacing: false,
3-
jsxBracketSameLine: true,
2+
bracketSpacing: true,
3+
bracketSameLine: true,
44
singleQuote: true,
55
trailingComma: 'all',
6+
useTabs: true,
7+
semi: true,
68
};

0 commit comments

Comments
 (0)