Skip to content

Commit

Permalink
fixed env linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
RupertJonesSA committed Sep 9, 2024
1 parent 63a600e commit 735e163
Show file tree
Hide file tree
Showing 10 changed files with 703 additions and 69 deletions.
12 changes: 11 additions & 1 deletion client/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
// https://docs.expo.dev/guides/using-eslint/
module.exports = {
extends: 'expo',
extends: "expo",
rules: {
"import/no-unresolved": [2, { ignore: ["^@env"] }],
},
settings: {
"import/resolver": {
node: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
},
},
};
2 changes: 1 addition & 1 deletion client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ yarn-error.*
# typescript
*.tsbuildinfo

.prettierrc
.prettierrc
4 changes: 2 additions & 2 deletions client/app/configs/firebaseConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { API_KEY, AUTH_DOMAIN } from "@env"; // Don't worry about this env error!
import { API_KEY, AUTH_DOMAIN } from '@env'; // Don't worry about this env error!
import AsyncStorage from "@react-native-async-storage/async-storage";
import { initializeApp, getApp, getApps } from "@firebase/app";
import {
Expand All @@ -10,7 +10,7 @@ import {

const firebaseConfig = {
apiKey: API_KEY || "Mock-Key",
authDomain: AUTH_DOMAIN
authDomain: AUTH_DOMAIN,
};

let app;
Expand Down
1 change: 0 additions & 1 deletion client/app/screens/chat/ChatScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const ChatScreen = () => {
const [messages, setMessages] = useState<Message[]>([]);
const [messageContent, setMessageContent] = useState<string>("");


useEffect(() => {
if (socket === null) return; // This line might need to be changed

Expand Down
12 changes: 8 additions & 4 deletions client/app/types/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
declare module '@env' {

export const EXPO_IP: string;
export const API_KEY, AUTH_DOMAIN, PROJECT_ID, STORAGE_BUCKET, MESSAGING_SENDER_ID, APP_ID: string;
declare module "@env" {
export const EXPO_IP: string;
export const API_KEY: string,
AUTH_DOMAIN: string,
PROJECT_ID: string,
STORAGE_BUCKET: string,
MESSAGING_SENDER_ID: string,
APP_ID: string;
}
7 changes: 5 additions & 2 deletions client/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ module.exports = function (api) {
[
"module:react-native-dotenv",
{
envName: "APP_ENV",
moudleName: "@env",
moduleName: "@env",
path: ".env",
blacklist: null,
whitelist: null,
safe: false,
allowUndefined: true,
},
],
],
Expand Down
10 changes: 10 additions & 0 deletions client/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
declare module "@env" {
export const EXPO_IP: string;
export const API_KEY: string;
export const AUTH_DOMAIN: string;
export const PROJECT_ID: string;
export const STORAGE_BUCKET: string;
export const MESSAGING_SENDER_ID: string;
export const APP_ID: string;
export const LOCATION_REFRESH_RATE: string;
}
Loading

0 comments on commit 735e163

Please sign in to comment.