Skip to content

Commit

Permalink
fix lint; sort translations
Browse files Browse the repository at this point in the history
  • Loading branch information
naltatis committed Dec 11, 2024
1 parent 3879890 commit 84d80b1
Show file tree
Hide file tree
Showing 13 changed files with 101 additions and 74 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{}
{}
18 changes: 8 additions & 10 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,18 @@ const Stack = createNativeStackNavigator();

const resources = {
en: {
translation: translationEN
translation: translationEN,
},
de: {
translation: translationDE
}
translation: translationDE,
},
};

i18n
.use(initReactI18next)
.init({
resources,
lng: getLocales()[0].languageCode,
fallbackLng: "en",
});
i18n.use(initReactI18next).init({
resources,
lng: getLocales()[0].languageCode,
fallbackLng: "en",
});

function AppNavigator() {
const { serverUrl } = useAppContext();
Expand Down
6 changes: 2 additions & 4 deletions components/AppContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import { BasicAuth } from "../interfaces/basicAuth";
const AppContext = createContext({
serverUrl: "",
basicAuth: { required: false } as BasicAuth,
updateServerUrl: async (url: string, basicAuth: BasicAuth) => {
url;
return;
},
// eslint-disable-next-line @typescript-eslint/no-unused-vars
updateServerUrl: async (url: string, basicAuth: BasicAuth) => {},
});

// Provider component
Expand Down
36 changes: 36 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import react from "eslint-plugin-react";
import reactNative from "eslint-plugin-react-native";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
{
ignores: ["android", "ios"],
},
...compat.extends("plugin:@typescript-eslint/recommended"),
{
plugins: {
"@typescript-eslint": typescriptEslint,
react,
"react-native": reactNative,
},
languageOptions: {
parser: tsParser,
},
rules: {
"@typescript-eslint/no-require-imports": "off",
},
},
];
2 changes: 1 addition & 1 deletion i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
"select": "Auswählen",
"useDemo": "Testinstanz verwenden"
}
}
}
32 changes: 16 additions & 16 deletions i18n/en.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"main": {
"title": "Setup server",
"description": "Search your network to find your evcc installation."
"description": "Search your network to find your evcc installation.",
"title": "Setup server"
},
"servers": {
"search": {
"start": "Start search",
"notAvailable": "The search is not possible on this device. Use the manual input.",
"nothingFound": "No evcc server was found.",
"searching": "Search for connection ..."
},
"changeServer": "Change server",
"manually": {
"specify": "Enter address manually",
"user": "User",
"password": "Password",
"missingOrWrongAuthentication": "Missing or incorrect authentication",
"authenticationRequired": "Authentication required",
"checkAdress": "The server does not appear to be an evcc instance. Please check the address.",
"checkAndSave": "Check and save",
"enterUrl": "Enter URL",
"missingOrWrongAuthentication": "Missing or incorrect authentication",
"password": "Password",
"serverIncompatible": "The evcc instance is not yet app-compatible. Update your installation.",
"serverNotAvailable": "Server not available. Please check the address.",
"checkAdress": "The server does not appear to be an evcc instance. Please check the address.",
"serverIncompatible": "The evcc instance is not yet app-compatible. Update your installation."
"specify": "Enter address manually",
"user": "User"
},
"changeServer": "Change server",
"removeServer": "Remove server",
"search": {
"notAvailable": "The search is not possible on this device. Use the manual input.",
"nothingFound": "No evcc server was found.",
"searching": "Search for connection ...",
"start": "Start search"
},
"select": "Select",
"useDemo": "Use Demo"
}
}
}
56 changes: 28 additions & 28 deletions i18n/lt.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"servers": {
"search": {
"start": "Pradėti paiešką",
"nothingFound": "Neradome evcc serverio.",
"searching": "Ieškoti sąsajos ...",
"notAvailable": "Paieška šiame įrenginyje negalima. Suveskite rankomis."
},
"manually": {
"enterUrl": "Įveskite URL",
"specify": "Įveskite adresą",
"user": "Vartotojas",
"password": "Slaptažodis",
"authenticationRequired": "Reikalingas autentifikavimas",
"checkAndSave": "Patikrinti ir išsaugoti",
"serverNotAvailable": "Serveris nepasiekiamas. Patikrinkite adresą.",
"missingOrWrongAuthentication": "Nėra autentifikavimo arba jis neteisingas",
"checkAdress": "Atrodo, kad serveris nėra evcc serveris. Patikrinkite adresą.",
"serverIncompatible": "Evcc egzempliorius dar nesuderinamas su programa. Atnaujinkite įdiegimą."
},
"changeServer": "Keisti serverį",
"removeServer": "Pašalinti serverį",
"select": "Pasirinkite",
"useDemo": "Naudokite demonstracinę versiją"
"main": {
"description": "Ieškokite savo tinkle, kad rastumėte įdiegtą evcc.",
"title": "Nustatykite serverį"
},
"servers": {
"changeServer": "Keisti serverį",
"manually": {
"authenticationRequired": "Reikalingas autentifikavimas",
"checkAdress": "Atrodo, kad serveris nėra evcc serveris. Patikrinkite adresą.",
"checkAndSave": "Patikrinti ir išsaugoti",
"enterUrl": "Įveskite URL",
"missingOrWrongAuthentication": "Nėra autentifikavimo arba jis neteisingas",
"password": "Slaptažodis",
"serverIncompatible": "Evcc egzempliorius dar nesuderinamas su programa. Atnaujinkite įdiegimą.",
"serverNotAvailable": "Serveris nepasiekiamas. Patikrinkite adresą.",
"specify": "Įveskite adresą",
"user": "Vartotojas"
},
"main": {
"title": "Nustatykite serverį",
"description": "Ieškokite savo tinkle, kad rastumėte įdiegtą evcc."
}
}
"removeServer": "Pašalinti serverį",
"search": {
"notAvailable": "Paieška šiame įrenginyje negalima. Suveskite rankomis.",
"nothingFound": "Neradome evcc serverio.",
"searching": "Ieškoti sąsajos ...",
"start": "Pradėti paiešką"
},
"select": "Pasirinkite",
"useDemo": "Naudokite demonstracinę versiją"
}
}
2 changes: 2 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web",
"lint": "tsc --noEmit && eslint --ext .js,.jsx,.ts,.tsx ./",
"lint": "tsc --noEmit && eslint .",
"format": "prettier --write ."
},
"dependencies": {
Expand Down Expand Up @@ -51,6 +51,8 @@
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.16.0",
"@typescript-eslint/eslint-plugin": "^8.1.0",
"@typescript-eslint/parser": "^8.1.0",
"eslint": "^9.9.0",
Expand Down
7 changes: 3 additions & 4 deletions screens/MainScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { WebView } from "react-native-webview";
import { Linking, ActivityIndicator, StyleSheet, Animated } from "react-native";
import { Text, Layout, Spinner, Button } from "@ui-kitten/components";
import { useAppContext } from "../components/AppContext";
import { BasicAuth } from "../interfaces/basicAuth";
import { useTranslation } from "react-i18next";

function LoadingScreen() {
Expand Down Expand Up @@ -130,9 +129,9 @@ export default function MainScreen({ navigation }) {
basicAuthCredential={
basicAuth.required
? {
username: basicAuth.username,
password: basicAuth.password,
}
username: basicAuth.username,
password: basicAuth.password,
}
: undefined
}
source={{ uri: serverUrl }}
Expand Down
2 changes: 1 addition & 1 deletion screens/ServerManualScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from "react";
import React from "react";
import { Layout } from "@ui-kitten/components";
import { View } from "react-native";
import ServerForm from "../components/ServerForm";
Expand Down

0 comments on commit 84d80b1

Please sign in to comment.