diff --git a/.eslintignore b/.eslintignore index 224070368..5a18daace 100644 --- a/.eslintignore +++ b/.eslintignore @@ -2,3 +2,4 @@ coverage/ lib/ !.eslintrc.js src/rules/__tests__/fixtures/ +index.d.ts diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 000000000..356a8d6d1 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,28 @@ +import { Linter, Rule } from 'eslint'; + +declare const plugin: { + meta: { + name: string; + version: string; + }; + environments: { + globals: { + globals: { + [key: string]: boolean; + }; + }; + }; + configs: { + all: Linter.Config; + recommended: Linter.Config; + style: Linter.Config; + 'flat/all': Linter.FlatConfig; + 'flat/recommended': Linter.FlatConfig; + 'flat/style': Linter.FlatConfig; + }; + rules: { + [key: string]: Rule.RuleModule; + }; +}; + +export default plugin; diff --git a/package.json b/package.json index e6227cf81..163dbd395 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__'",