Skip to content

Commit 786e56e

Browse files
authored
feat: add TypeScript types (#382)
1 parent 15809b6 commit 786e56e

File tree

2 files changed

+56
-2
lines changed

2 files changed

+56
-2
lines changed

index.d.ts

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { type Linter, type Rule } from "eslint";
2+
3+
declare const plugin: {
4+
meta: {
5+
name: string;
6+
version: string;
7+
};
8+
configs: {
9+
all: Linter.LegacyConfig;
10+
recommended: Linter.LegacyConfig;
11+
"flat/all": Linter.FlatConfig;
12+
"flat/recommended": Linter.FlatConfig;
13+
};
14+
rules: {
15+
[key: string]: Rule.RuleModule;
16+
};
17+
};
18+
19+
export = plugin;

package.json

+37-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@
2525
"license": "MIT",
2626
"author": "Ben Monro",
2727
"main": "dist/index.js",
28+
"types": "index.d.ts",
2829
"files": [
29-
"dist"
30+
"dist",
31+
"index.d.ts"
3032
],
3133
"scripts": {
3234
"build": "kcd-scripts build",
@@ -46,7 +48,40 @@
4648
"consistent-return": "off",
4749
"max-lines-per-function": "off",
4850
"testing-library/no-dom-import": "off"
49-
}
51+
},
52+
"overrides": [
53+
{
54+
"files": [
55+
"**/*.ts"
56+
],
57+
"rules": {
58+
"@typescript-eslint/await-thenable": "off",
59+
"@typescript-eslint/dot-notation": "off",
60+
"@typescript-eslint/no-base-to-string": "off",
61+
"@typescript-eslint/no-floating-promises": "off",
62+
"@typescript-eslint/no-implied-eval": "off",
63+
"@typescript-eslint/no-misused-promises": "off",
64+
"@typescript-eslint/no-throw-literal": "off",
65+
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "off",
66+
"@typescript-eslint/no-unnecessary-condition": "off",
67+
"@typescript-eslint/no-unnecessary-qualifier": "off",
68+
"@typescript-eslint/no-unnecessary-type-assertion": "off",
69+
"@typescript-eslint/no-unsafe-argument": "off",
70+
"@typescript-eslint/no-unsafe-assignment": "off",
71+
"@typescript-eslint/no-unsafe-call": "off",
72+
"@typescript-eslint/no-unsafe-member-access": "off",
73+
"@typescript-eslint/no-unsafe-return": "off",
74+
"@typescript-eslint/prefer-includes": "off",
75+
"@typescript-eslint/prefer-nullish-coalescing": "off",
76+
"@typescript-eslint/prefer-reduce-type-parameter": "off",
77+
"@typescript-eslint/prefer-string-starts-ends-with": "off",
78+
"@typescript-eslint/restrict-plus-operands": "off",
79+
"@typescript-eslint/return-await": "off",
80+
"@typescript-eslint/switch-exhaustiveness-check": "off",
81+
"@typescript-eslint/unbound-method": "off"
82+
}
83+
}
84+
]
5085
},
5186
"eslintIgnore": [
5287
"node_modules",

0 commit comments

Comments
 (0)