From 1ce12588e7081558bd727dfe10428aed08080167 Mon Sep 17 00:00:00 2001 From: Mark Skelton Date: Tue, 5 Nov 2024 13:17:49 -0600 Subject: [PATCH] feat: add TypeScript types (#1667) --- .eslintrc.js | 6 ++++++ index.d.ts | 28 ++++++++++++++++++++++++++++ package.json | 4 +++- 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 index.d.ts diff --git a/.eslintrc.js b/.eslintrc.js index 5d6e5f4b9..3661f034b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -133,5 +133,11 @@ module.exports = { 'import/no-commonjs': 'off', }, }, + { + files: ['*.d.ts'], + rules: { + strict: 'off', + }, + }, ], }; diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 000000000..bbd18c78e --- /dev/null +++ b/index.d.ts @@ -0,0 +1,28 @@ +import type { Linter, Rule } from 'eslint'; + +declare const plugin: { + meta: { + name: string; + version: string; + }; + environments: { + globals: { + globals: { + [key: string]: boolean; + }; + }; + }; + configs: { + all: Linter.LegacyConfig; + recommended: Linter.LegacyConfig; + style: Linter.LegacyConfig; + 'flat/all': Linter.FlatConfig; + 'flat/recommended': Linter.FlatConfig; + 'flat/style': Linter.FlatConfig; + }; + rules: { + [key: string]: Rule.RuleModule; + }; +}; + +export = plugin; diff --git a/package.json b/package.json index 725519028..e6b2eae1f 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,11 @@ "url": "jkimbo.com" }, "main": "lib/index.js", + "types": "index.d.ts", "files": [ "docs/", - "lib/" + "lib/", + "index.d.ts" ], "scripts": { "build": "babel --extensions .js,.ts src --out-dir lib --copy-files && rimraf --glob lib/__tests__ 'lib/**/__tests__'",