Skip to content

Commit 035d2e5

Browse files
iqbalhasandevgithub-actions[bot]
authored andcommitted
style: fix code formatting [skip ci]
1 parent 0070cf5 commit 035d2e5

File tree

3 files changed

+40
-7
lines changed

3 files changed

+40
-7
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,9 @@ Main hook for accessing translations and locale information.
176176

177177
**Options:**
178178

179-
| Option | Type | Default | Description |
180-
| ---------- | -------- | ---------- | -------------------------------------------- |
181-
| `langPath` | `string` | `'@/lang'` | Custom path to translations directory |
179+
| Option | Type | Default | Description |
180+
| ---------- | -------- | ---------- | ------------------------------------- |
181+
| `langPath` | `string` | `'@/lang'` | Custom path to translations directory |
182182

183183
**Returns:**
184184

eslint.config.min.js

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,29 @@
1-
import js from"@eslint/js";import tseslint from"typescript-eslint";import reactPlugin from"eslint-plugin-react";import reactHooksPlugin from"eslint-plugin-react-hooks";export default tseslint.config(js.configs.recommended,...tseslint.configs.recommended,{files:["**/*.ts","**/*.tsx"],plugins:{react:reactPlugin,"react-hooks":reactHooksPlugin},rules:{"@typescript-eslint/no-explicit-any":"warn","@typescript-eslint/no-unused-vars":["error",{argsIgnorePattern:"^_",varsIgnorePattern:"^_"}],"react-hooks/rules-of-hooks":"error","react-hooks/exhaustive-deps":"warn"}},{files:["**/__tests__/**","*.config.*","*.cjs"],rules:{"@typescript-eslint/no-explicit-any":"off"}},{files:["**/vite-plugin-*.ts"],rules:{"@typescript-eslint/no-this-alias":"off"}},{ignores:["dist/**","node_modules/**","coverage/**","*.cjs","*.min.js","eslint.config.js"]});
1+
import js from '@eslint/js';
2+
import tseslint from 'typescript-eslint';
3+
import reactPlugin from 'eslint-plugin-react';
4+
import reactHooksPlugin from 'eslint-plugin-react-hooks';
5+
export default tseslint.config(
6+
js.configs.recommended,
7+
...tseslint.configs.recommended,
8+
{
9+
files: ['**/*.ts', '**/*.tsx'],
10+
plugins: { react: reactPlugin, 'react-hooks': reactHooksPlugin },
11+
rules: {
12+
'@typescript-eslint/no-explicit-any': 'warn',
13+
'@typescript-eslint/no-unused-vars': [
14+
'error',
15+
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
16+
],
17+
'react-hooks/rules-of-hooks': 'error',
18+
'react-hooks/exhaustive-deps': 'warn',
19+
},
20+
},
21+
{
22+
files: ['**/__tests__/**', '*.config.*', '*.cjs'],
23+
rules: { '@typescript-eslint/no-explicit-any': 'off' },
24+
},
25+
{ files: ['**/vite-plugin-*.ts'], rules: { '@typescript-eslint/no-this-alias': 'off' } },
26+
{
27+
ignores: ['dist/**', 'node_modules/**', 'coverage/**', '*.cjs', '*.min.js', 'eslint.config.js'],
28+
}
29+
);

src/useLocalizer.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,17 +201,22 @@ export function useLocalizer(options: UseLocalizerOptions = {}): UseLocalizerRet
201201
interface WindowWithTranslations extends Window {
202202
__LARAVEL_LOCALIZER_TRANSLATIONS__?: Record<string, Record<string, string>>;
203203
}
204-
const translations = (window as WindowWithTranslations).__LARAVEL_LOCALIZER_TRANSLATIONS__?.[locale] || {};
204+
const translations =
205+
(window as WindowWithTranslations).__LARAVEL_LOCALIZER_TRANSLATIONS__?.[locale] || {};
205206

206207
// Note: langPath is stored for future use if needed for dynamic imports
207208
// Currently, translations are loaded globally via window object
208209
if (Object.keys(translations).length === 0 && langPath !== '@/lang') {
209-
console.warn(`[Laravel Localizer] Custom langPath '${langPath}' specified but translations not found. Ensure your vite.config has proper path alias.`);
210+
console.warn(
211+
`[Laravel Localizer] Custom langPath '${langPath}' specified but translations not found. Ensure your vite.config has proper path alias.`
212+
);
210213
}
211214

212215
return translations;
213216
} catch {
214-
console.warn(`[Laravel Localizer] Could not load translations for locale: ${locale}. Default path is '${langPath}'.`);
217+
console.warn(
218+
`[Laravel Localizer] Could not load translations for locale: ${locale}. Default path is '${langPath}'.`
219+
);
215220
return {};
216221
}
217222
}, [locale, langPath]);

0 commit comments

Comments
 (0)