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__'",