Skip to content

Commit

Permalink
chore: improve type definition
Browse files Browse the repository at this point in the history
  • Loading branch information
edvardchen committed Sep 14, 2024
1 parent 88747c4 commit 4cb23d8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import i18next from 'eslint-plugin-i18next';

export default [
// your other configs
i18next.configs?.['flat/recommended'],
i18next.configs['flat/recommended'],
];
```

Expand Down
2 changes: 1 addition & 1 deletion examples/app-with-eslint9/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default [
linterOptions: { reportUnusedDisableDirectives: 'error' },
},
pluginJs.configs.recommended,
i18next.configs?.['flat/recommended'],
i18next.configs['flat/recommended'],
{
rules: { 'i18next/no-literal-string': ['error', { mode: 'all' }] },
},
Expand Down
6 changes: 5 additions & 1 deletion lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import type { ESLint } from 'eslint';

declare const plugin: ESLint.Plugin;
declare const plugin: ESLint.Plugin & {
configs: {
'flat/recommended': ESLint.ConfigData
}
};

export = plugin;
3 changes: 3 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ var requireIndex = require('requireindex');

// import all rules in lib/rules
const rules = requireIndex(__dirname + '/rules');
/**
* @type {import('eslint').ESLint.Plugin}
*/
const plugin = {
rules,

Expand Down

0 comments on commit 4cb23d8

Please sign in to comment.