Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added react-hooks eslint configs and react-native-dotenv #23

Merged
merged 1 commit into from
Oct 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 29 additions & 27 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": ["react", "@typescript-eslint", "jest"],
"plugins": ["react", "@typescript-eslint", "jest", "react-hooks"],
"settings": {
"import/resolver": {
"typescript": {},
Expand All @@ -33,33 +33,7 @@
},
"rules": {
"@typescript-eslint/no-use-before-define": ["error"],
"no-use-before-define": "off",
"react/jsx-props-no-spreading": "off",
"no-console": ["error", { "allow": ["warn"] }],
"object-curly-newline": "off",
"arrow-parens": [2, "as-needed"],
"no-unused-expressions": [
"error",
{
"allowShortCircuit": true,
"allowTernary": true
}
],
"jest/no-disabled-tests": "warn",
"jest/no-focused-tests": "error",
"jest/no-identical-title": "error",
"jest/prefer-to-have-length": "warn",
"jest/valid-expect": "error",
"no-restricted-imports": [
"error",
{
"patterns": ["../*"]
}
],
"react/jsx-filename-extension": [
1,
{ "extensions": [".test.js", ".tsx", ".ts"] }
],
"import/extensions": [
"error",
"ignorePackages",
Expand Down Expand Up @@ -88,6 +62,34 @@
"caseInsensitive": true
}
}
],
"jest/no-disabled-tests": "warn",
"jest/no-focused-tests": "error",
"jest/no-identical-title": "error",
"jest/prefer-to-have-length": "warn",
"jest/valid-expect": "error",
"no-console": ["error", { "allow": ["warn"] }],
"no-restricted-imports": [
"error",
{
"patterns": ["../*"]
}
],
"no-unused-expressions": [
"error",
{
"allowShortCircuit": true,
"allowTernary": true
}
],
"no-use-before-define": "off",
"object-curly-newline": "off",
"react-hooks/exhaustive-deps": "warn",
"react-hooks/rules-of-hooks": "error",
"react/jsx-props-no-spreading": "off",
"react/jsx-filename-extension": [
1,
{ "extensions": [".test.js", ".tsx", ".ts"] }
]
}
}
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = function (api) {
[
'module:react-native-dotenv',
{
moduleName: '@env',
moduleName: "react-native-dotenv",
path: '.env',
safe: true,
},
Expand Down
8 changes: 8 additions & 0 deletions env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
declare module 'react-native-dotenv' {
export const API_KEY: any;
export const AUTH_DOMAIN: any;
export const PROJECT_ID: any;
export const STORAGE_BUCKET: any;
export const MESSAGING_SENDER_ID: any;
export const APP_ID: any;
}
4 changes: 2 additions & 2 deletions src/database/firebase.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import firebase from 'firebase';
import {
API_KEY,
AUTH_DOMAIN,
PROJECT_ID,
STORAGE_BUCKET,
MESSAGING_SENDER_ID,
APP_ID,
} from '@env';
import firebase from 'firebase';
} from 'react-native-dotenv';
import 'firebase/firestore';

import { Tree, Comment, Additional } from '@types';
Expand Down