From 786e56ef9c92b666f9b350cc15f0a33a2acc6a2c Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Mon, 18 Nov 2024 09:46:51 +1300 Subject: [PATCH] feat: add TypeScript types (#382) --- index.d.ts | 19 +++++++++++++++++++ package.json | 39 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..323f38a --- /dev/null +++ b/index.d.ts @@ -0,0 +1,19 @@ +import { type Linter, type Rule } from "eslint"; + +declare const plugin: { + meta: { + name: string; + version: string; + }; + configs: { + all: Linter.LegacyConfig; + recommended: Linter.LegacyConfig; + "flat/all": Linter.FlatConfig; + "flat/recommended": Linter.FlatConfig; + }; + rules: { + [key: string]: Rule.RuleModule; + }; +}; + +export = plugin; diff --git a/package.json b/package.json index b0372d2..0c1aef8 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,10 @@ "license": "MIT", "author": "Ben Monro", "main": "dist/index.js", + "types": "index.d.ts", "files": [ - "dist" + "dist", + "index.d.ts" ], "scripts": { "build": "kcd-scripts build", @@ -46,7 +48,40 @@ "consistent-return": "off", "max-lines-per-function": "off", "testing-library/no-dom-import": "off" - } + }, + "overrides": [ + { + "files": [ + "**/*.ts" + ], + "rules": { + "@typescript-eslint/await-thenable": "off", + "@typescript-eslint/dot-notation": "off", + "@typescript-eslint/no-base-to-string": "off", + "@typescript-eslint/no-floating-promises": "off", + "@typescript-eslint/no-implied-eval": "off", + "@typescript-eslint/no-misused-promises": "off", + "@typescript-eslint/no-throw-literal": "off", + "@typescript-eslint/no-unnecessary-boolean-literal-compare": "off", + "@typescript-eslint/no-unnecessary-condition": "off", + "@typescript-eslint/no-unnecessary-qualifier": "off", + "@typescript-eslint/no-unnecessary-type-assertion": "off", + "@typescript-eslint/no-unsafe-argument": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-unsafe-call": "off", + "@typescript-eslint/no-unsafe-member-access": "off", + "@typescript-eslint/no-unsafe-return": "off", + "@typescript-eslint/prefer-includes": "off", + "@typescript-eslint/prefer-nullish-coalescing": "off", + "@typescript-eslint/prefer-reduce-type-parameter": "off", + "@typescript-eslint/prefer-string-starts-ends-with": "off", + "@typescript-eslint/restrict-plus-operands": "off", + "@typescript-eslint/return-await": "off", + "@typescript-eslint/switch-exhaustiveness-check": "off", + "@typescript-eslint/unbound-method": "off" + } + } + ] }, "eslintIgnore": [ "node_modules",