Skip to content

Commit 46d918c

Browse files
committed
initial setup
1 parent 9c8cd45 commit 46d918c

Some content is hidden

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

56 files changed

+13415
-2
lines changed

.babelrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"presets": ["module:metro-react-native-babel-preset"],
3+
"plugins": [
4+
[
5+
"module-resolver",
6+
{
7+
"root": ["./src"],
8+
"alias": {
9+
"src": "./src"
10+
}
11+
}
12+
]
13+
]
14+
}

.eslintrc

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"parserOptions": {
4+
"project": "./tsconfig.json"
5+
},
6+
"plugins": [
7+
"@typescript-eslint",
8+
"react-hooks",
9+
"no-only-tests"
10+
],
11+
"extends": [
12+
"eslint:recommended",
13+
"plugin:@typescript-eslint/recommended",
14+
"plugin:react/recommended",
15+
"prettier",
16+
"prettier/@typescript-eslint",
17+
"prettier/react"
18+
],
19+
"env": {
20+
"browser": true,
21+
"node": true,
22+
"es6": true,
23+
"jest": true
24+
},
25+
"settings": {
26+
"react": {
27+
"pragma": "React",
28+
"version": "detect"
29+
}
30+
},
31+
"rules": {
32+
"@typescript-eslint/camelcase": [
33+
2,
34+
{
35+
"properties": "always"
36+
}
37+
],
38+
"@typescript-eslint/explicit-function-return-type": [
39+
2,
40+
{
41+
"allowExpressions": true
42+
}
43+
],
44+
"@typescript-eslint/interface-name-prefix": [
45+
2,
46+
"always"
47+
],
48+
"@typescript-eslint/no-explicit-any": 0,
49+
"@typescript-eslint/no-object-literal-type-assertion": 0,
50+
"@typescript-eslint/no-unused-vars": [
51+
2,
52+
{
53+
"argsIgnorePattern": "^_",
54+
"ignoreRestSiblings": true
55+
}
56+
],
57+
"@typescript-eslint/no-use-before-define": [
58+
2,
59+
{
60+
"functions": false
61+
}
62+
],
63+
"@typescript-eslint/no-var-requires": 0,
64+
"indent": 0,
65+
"no-console": 2,
66+
"no-empty": [
67+
2,
68+
{
69+
"allowEmptyCatch": true
70+
}
71+
],
72+
"no-unused-vars": 0,
73+
"no-shadow": 0,
74+
"object-shorthand": 2,
75+
"padding-line-between-statements": [
76+
2,
77+
{
78+
"blankLine": "always",
79+
"prev": [
80+
"const",
81+
"let"
82+
],
83+
"next": "*"
84+
},
85+
{
86+
"blankLine": "any",
87+
"prev": [
88+
"const",
89+
"let"
90+
],
91+
"next": [
92+
"const",
93+
"let"
94+
]
95+
},
96+
{
97+
"blankLine": "always",
98+
"prev": [
99+
"block",
100+
"block-like"
101+
],
102+
"next": "*"
103+
}
104+
],
105+
"react/display-name": 0,
106+
"react/jsx-boolean-value": [
107+
2,
108+
"always"
109+
],
110+
"react/no-unescaped-entities": 0,
111+
"react/prop-types": 0,
112+
"react-hooks/rules-of-hooks": 2,
113+
"react/no-this-in-sfc": 2,
114+
"quotes": [
115+
2,
116+
"single",
117+
{
118+
"allowTemplateLiterals": true,
119+
"avoidEscape": true
120+
}
121+
],
122+
"no-only-tests/no-only-tests": 2
123+
},
124+
"overrides": [
125+
{
126+
"files": [
127+
"**/*test.*"
128+
],
129+
"rules": {
130+
"@typescript-eslint/camelcase": 0
131+
}
132+
}
133+
]
134+
}

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ bower_components
2929
# node-waf configuration
3030
.lock-wscript
3131

32-
# Compiled binary addons (https://nodejs.org/api/addons.html)
33-
build/Release
32+
# Compiled files
33+
dist/
3434

3535
# Dependency directories
3636
node_modules/

.npmignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
tsconfig.json
2+
tsconfig.test.json
3+
4+
test.*
5+
6+
src/

jest.config.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
const path = require('path');
2+
3+
module.exports = {
4+
preset: 'react-native',
5+
globals: {
6+
'ts-jest': {
7+
babelConfig: true,
8+
tsConfig: 'tsconfig.test.json',
9+
diagnostics: {
10+
warnOnly: true,
11+
},
12+
},
13+
window: {},
14+
},
15+
testMatch: ['<rootDir>/src/**/?(*.)+(test).(j|t)s?(x)'],
16+
testPathIgnorePatterns: ['\\.snap$', '<rootDir>/node_modules/'],
17+
rootDir: '..',
18+
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json'],
19+
modulePaths: [path.resolve(__dirname, '..'), 'node_modules'],
20+
cacheDirectory: '.jest/cache',
21+
transform: {
22+
'^.+\\.tsx?$': 'ts-jest',
23+
'^.+\\.js$': '<rootDir>/node_modules/react-native/jest/preprocessor.js',
24+
},
25+
transformIgnorePatterns: [
26+
'node_modules/(?!(jest-)?react-native)',
27+
],
28+
verbose: false,
29+
};

0 commit comments

Comments
 (0)