Skip to content

Commit 5908ca7

Browse files
committed
fix(types): add commonjs type declarations
#39
1 parent 12d2b60 commit 5908ca7

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

package.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,21 @@
88
"module": "./src/index.js",
99
"main": "./dist/index.cjs",
1010
"types": "./types/index.d.ts",
11+
"exports": {
12+
"import": {
13+
"types": "./types/index.d.ts",
14+
"default": "./src/index.js"
15+
},
16+
"require": {
17+
"types": "./types/index.d.cts",
18+
"default": "./dist/index.cjs"
19+
}
20+
},
1121
"files": [
1222
"src",
1323
"types",
1424
"dist"
1525
],
16-
"exports": {
17-
"types": "./types/index.d.ts",
18-
"import": "./src/index.js",
19-
"require": "./dist/index.cjs"
20-
},
2126
"repository": {
2227
"type": "git",
2328
"url": "https://github.com/NickvanDyke/eslint-plugin-react-you-might-not-need-an-effect.git"

types/index.d.cts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import type { ESLint, Linter } from "eslint";
2+
3+
declare const plugin: ESLint.Plugin & {
4+
configs: {
5+
recommended: Linter.Config;
6+
"legacy-recommended": Linter.LegacyConfig;
7+
};
8+
};
9+
export = plugin;

0 commit comments

Comments
 (0)