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"