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

Fixed linting errors caused by accessing '@env' module in certain files #264

Merged
merged 2 commits into from
Sep 12, 2024
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
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
2 changes: 1 addition & 1 deletion client/app/configs/firebaseConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
AlexanderWangY marked this conversation as resolved.
Show resolved Hide resolved
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
6 changes: 6 additions & 0 deletions client/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
declare module "@env" {
export const EXPO_IP: string;
export const API_KEY: string;
export const AUTH_DOMAIN: string;
export const LOCATION_REFRESH_RATE: string;
AlexanderWangY marked this conversation as resolved.
Show resolved Hide resolved
}
Loading
Loading