Skip to content

Commit 1ce1258

Browse files
authored
feat: add TypeScript types (#1667)
1 parent 6f8ff4d commit 1ce1258

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

.eslintrc.js

+6
Original file line numberDiff line numberDiff line change
@@ -133,5 +133,11 @@ module.exports = {
133133
'import/no-commonjs': 'off',
134134
},
135135
},
136+
{
137+
files: ['*.d.ts'],
138+
rules: {
139+
strict: 'off',
140+
},
141+
},
136142
],
137143
};

index.d.ts

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

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
"url": "jkimbo.com"
1616
},
1717
"main": "lib/index.js",
18+
"types": "index.d.ts",
1819
"files": [
1920
"docs/",
20-
"lib/"
21+
"lib/",
22+
"index.d.ts"
2123
],
2224
"scripts": {
2325
"build": "babel --extensions .js,.ts src --out-dir lib --copy-files && rimraf --glob lib/__tests__ 'lib/**/__tests__'",

0 commit comments

Comments
 (0)