Skip to content

Commit e81b493

Browse files
committed
refactor: update ESLint configuration and dependencies; improve Vite plugin documentation
1 parent eb7aad7 commit e81b493

File tree

6 files changed

+38
-15
lines changed

6 files changed

+38
-15
lines changed

__tests__/vite-plugin.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { laravelLocalizer } from '../vite-plugin';
2-
import type { Plugin } from 'vite';
32

43
describe('laravelLocalizer Vite Plugin', () => {
54
it('should return a valid Vite plugin', () => {

eslint.config.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,9 @@ import reactHooksPlugin from 'eslint-plugin-react-hooks';
55

66
export default tseslint.config(
77
js.configs.recommended,
8-
...tseslint.configs.recommendedTypeChecked,
8+
...tseslint.configs.recommended,
99
{
1010
files: ['**/*.ts', '**/*.tsx'],
11-
languageOptions: {
12-
parserOptions: {
13-
project: './tsconfig.json',
14-
tsconfigRootDir: import.meta.dirname,
15-
},
16-
},
1711
plugins: {
1812
react: reactPlugin,
1913
'react-hooks': reactHooksPlugin,
@@ -33,9 +27,11 @@ export default tseslint.config(
3327
},
3428
{
3529
files: ['**/__tests__/**', '*.config.*', '*.cjs'],
36-
...tseslint.configs.disableTypeChecked,
30+
rules: {
31+
'@typescript-eslint/no-explicit-any': 'off',
32+
},
3733
},
3834
{
39-
ignores: ['dist/**', 'node_modules/**', 'coverage/**', '*.cjs'],
35+
ignores: ['dist/**', 'node_modules/**', 'coverage/**', '*.cjs', '*.min.js', 'eslint.config.js'],
4036
}
4137
);

eslint.config.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
"vite": "^5.0.0 || ^6.0.0"
8484
},
8585
"devDependencies": {
86+
"@eslint/js": "^9.39.1",
8687
"@testing-library/jest-dom": "^6.8.0",
8788
"@testing-library/react": "^16.3.0",
8889
"@testing-library/user-event": "^14.6.1",
@@ -101,6 +102,7 @@
101102
"ts-jest": "^29.4.5",
102103
"tsup": "^8.3.5",
103104
"typescript": "^5.7.2",
105+
"typescript-eslint": "^8.46.3",
104106
"vite": "^6.0.0"
105107
}
106108
}

vite-plugin.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ export interface LocalizerPluginOptions {
3232

3333
/**
3434
* Vite plugin for Laravel Localizer
35-
*
35+
*
3636
* Automatically regenerates TypeScript translation files when Laravel language files change.
37-
*
37+
*
3838
* @example
3939
* ```ts
4040
* import { defineConfig } from 'vite';
4141
* import { laravelLocalizer } from '@devwizard/laravel-localizer-react/vite';
42-
*
42+
*
4343
* export default defineConfig({
4444
* plugins: [
4545
* laravelLocalizer({
@@ -103,7 +103,7 @@ export function laravelLocalizer(options: LocalizerPluginOptions = {}): Plugin {
103103
}
104104

105105
debounceTimer = setTimeout(() => {
106-
generate(reason);
106+
void generate(reason);
107107
debounceTimer = null;
108108
}, debounce);
109109
};

0 commit comments

Comments
 (0)