Skip to content

Commit 5718db4

Browse files
committed
added initial template and eslint configs
1 parent b134a0e commit 5718db4

12 files changed

Lines changed: 110 additions & 10202 deletions

File tree

.eslintrc.js

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

example/.eslintrc.js

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,54 @@
11
module.exports = {
22
env: {
33
browser: true,
4-
es6: true,
4+
es2020: true,
55
},
66
extends: [
77
'plugin:react/recommended',
88
'airbnb',
9+
'plugin:@typescript-eslint/recommended',
10+
'prettier/@typescript-eslint',
11+
'plugin:prettier/recommended',
912
],
10-
globals: {
11-
Atomics: 'readonly',
12-
SharedArrayBuffer: 'readonly',
13-
},
1413
parser: '@typescript-eslint/parser',
1514
parserOptions: {
1615
ecmaFeatures: {
1716
jsx: true,
1817
},
19-
ecmaVersion: 2018,
18+
ecmaVersion: 11,
2019
sourceType: 'module',
2120
},
22-
plugins: [
23-
'react',
24-
'@typescript-eslint',
25-
],
21+
plugins: ['react', 'react-hooks', '@typescript-eslint', 'prettier'],
2622
rules: {
23+
'prettier/prettier': 'error',
24+
'react-hooks/rules-of-hooks': 'error',
25+
'react-hooks/exhaustive-deps': 'warn',
26+
'react/jsx-filename-extension': [1, { extensions: ['.tsx'] }],
27+
'import/prefer-default-export': 'off',
28+
'react/jsx-one-expression-per-line': 'off',
29+
'react/jsx-props-no-spreading': 'off',
30+
'no-unused-expressions': 'off',
31+
'react/prop-types': 'off',
32+
'import/no-duplicates': 'off',
33+
'@typescript-eslint/explicit-function-return-type': [
34+
'error',
35+
{
36+
allowExpressions: true,
37+
},
38+
],
39+
'@typescript-eslint/camelcase': 'off',
40+
'import/extensions': [
41+
'error',
42+
'ignorePackages',
43+
{
44+
ts: 'never',
45+
tsx: 'never',
46+
},
47+
],
48+
},
49+
settings: {
50+
'import/resolver': {
51+
typescript: {},
52+
},
2753
},
2854
};

example/.prettierrc.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
module.exports = {
2-
bracketSpacing: false,
3-
jsxBracketSameLine: true,
42
singleQuote: true,
53
trailingComma: 'all',
64
};

example/App.tsx

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

example/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
* @format
33
*/
44

5-
import {AppRegistry} from 'react-native';
6-
import App from './App';
7-
import {name as appName} from './app.json';
5+
import { AppRegistry } from 'react-native';
6+
import App from './src/pages/index';
7+
import { name as appName } from './app.json';
88

99
AppRegistry.registerComponent(appName, () => App);

example/metro.config.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
/**
2-
* Metro configuration for React Native
3-
* https://github.com/facebook/react-native
4-
*
5-
* @format
6-
*/
1+
const path = require('path');
2+
3+
const extraNodeModules = {
4+
'react-native-sensitive-info': path.resolve(__dirname + '/../'),
5+
};
6+
const watchFolders = [path.resolve(__dirname + '/../')];
77

88
module.exports = {
99
transformer: {
@@ -14,4 +14,8 @@ module.exports = {
1414
},
1515
}),
1616
},
17+
resolver: {
18+
extraNodeModules,
19+
},
20+
watchFolders,
1721
};

0 commit comments

Comments
 (0)