Skip to content

Commit

Permalink
improve i18n and typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
zefanjajobse committed Dec 24, 2024
1 parent accf637 commit 82e56fe
Show file tree
Hide file tree
Showing 27 changed files with 925 additions and 783 deletions.
9 changes: 7 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
"typescript.tsdk": "node_modules/typescript/lib",
"i18n-ally.localesPaths": [
"src/locales/languages"
],
"i18n-ally.sourceLanguage": "en-US",
"i18n-ally.keystyle": "nested"
}
48 changes: 30 additions & 18 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,51 @@ 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
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [...compat.extends(
export default [
...compat.extends(
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
), {
),
{
plugins: {
"@typescript-eslint": typescriptEslint,
"@typescript-eslint": typescriptEslint,
},

languageOptions: {
parser: tsParser,
ecmaVersion: 2020,
sourceType: "module",
parser: tsParser,
ecmaVersion: 2020,
sourceType: "module",

parserOptions: {
ecmaFeatures: {
jsx: true,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},

settings: {
react: {
version: "detect",
},
react: {
version: "detect",
},
},

rules: {
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-var-requires": 0,

"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
},
}];
},
];
17 changes: 17 additions & 0 deletions i18next.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// import the original type declarations
import "i18next";
// import all namespaces (for the default language, only)
import common from "./src/locales/languages/en-US.json";

declare module "i18next" {
// Extend CustomTypeOptions
interface CustomTypeOptions {
// custom namespace type, if you changed it
defaultNS: "common";
// custom resources type
resources: {
common: typeof common;
};
// other
}
}
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@
"@types/file-saver": "^2.0.7",
"@types/jest": "^29.5.14",
"@types/node": "^22.10.2",
"@types/react": "^19.0.1",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",
"@typescript-eslint/eslint-plugin": "^8.18.0",
"@typescript-eslint/parser": "^8.18.0",
"@typescript-eslint/eslint-plugin": "^8.18.2",
"@typescript-eslint/parser": "^8.18.2",
"browserslist": "^4.24.3",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^7.1.2",
"css-minimizer-webpack-plugin": "^7.0.0",
"eslint": "^9.17.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react": "^7.37.3",
"express": "^5.0.1",
"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.6.3",
Expand All @@ -69,30 +69,30 @@
"typescript-plugin-css-modules": "^5.1.0",
"webpack": "^5.97.1",
"webpack-bundle-analyzer": "^4.10.2",
"webpack-cli": "^5.1.4",
"webpack-cli": "^6.0.1",
"webpack-dev-server": "^5.2.0",
"webpack-image-resize-loader": "^5.0.0",
"webpack-merge": "^6.0.1",
"workbox-webpack-plugin": "^7.3.0"
},
"dependencies": {
"@tanstack/react-query": "^5.62.7",
"@tanstack/react-query": "^5.62.10",
"@uidotdev/usehooks": "^2.4.1",
"chart.js": "^4.4.7",
"chartjs-adapter-date-fns": "^3.0.0",
"chartjs-plugin-zoom": "^2.2.0",
"date-fns": "^4.1.0",
"file-saver": "^2.0.5",
"i18n-iso-countries": "^7.13.0",
"i18next": "^24.1.0",
"i18next": "^24.2.0",
"i18next-browser-languagedetector": "^8.0.2",
"i18next-resources-to-backend": "^1.2.1",
"mini-css-extract-plugin": "^2.9.2",
"react": "^19.0.0",
"react-chartjs-2": "^5.2.0",
"react-dom": "^19.0.0",
"react-i18next": "^15.2.0",
"react-router": "^7.0.2",
"react-router": "^7.1.1",
"regenerator-runtime": "^0.14.1",
"web-vitals": "^4.2.4"
}
Expand Down
Loading

0 comments on commit 82e56fe

Please sign in to comment.