From c463dfe91160fec29118512059a6c0d131c78c04 Mon Sep 17 00:00:00 2001 From: Rami Jarrar Date: Fri, 23 Aug 2024 20:17:35 +1000 Subject: [PATCH] feat: add type definitions --- lib/index.d.ts | 5 +++++ lib/index.js | 8 +++++--- package.json | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 lib/index.d.ts diff --git a/lib/index.d.ts b/lib/index.d.ts new file mode 100644 index 0000000..66d9b0e --- /dev/null +++ b/lib/index.d.ts @@ -0,0 +1,5 @@ +import type { ESLint } from 'eslint'; + +declare const plugin: ESLint.Plugin; + +export = plugin; diff --git a/lib/index.js b/lib/index.js index cbb2d8e..6435ed9 100644 --- a/lib/index.js +++ b/lib/index.js @@ -14,10 +14,10 @@ var requireIndex = require('requireindex'); // Plugin Definition //------------------------------------------------------------------------------ -// import all rules in lib/rules -module.exports.rules = requireIndex(__dirname + '/rules'); +const plugin = { + // import all rules in lib/rules + rules: requireIndex(__dirname + '/rules'), -module.exports.configs = { recommended: { plugins: ['i18next'], rules: { @@ -25,3 +25,5 @@ module.exports.configs = { } } }; + +module.exports = plugin; diff --git a/package.json b/package.json index f3179e0..efc1b4c 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "files": [ "lib" ], + "types": "lib/index.d.ts", "repository": { "type": "git", "url": "https://github.com/edvardchen/eslint-plugin-i18next.git"