Skip to content

Commit 9b7d8a5

Browse files
authored
fix: Fix types for flat config (#326)
1 parent 8778bd3 commit 9b7d8a5

File tree

3 files changed

+38
-22
lines changed

3 files changed

+38
-22
lines changed

index.d.ts

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Linter, Rule } from 'eslint'
2+
3+
declare const config: {
4+
configs: {
5+
'flat/jest-playwright': Linter.Config
6+
'flat/recommended': Linter.Config
7+
'jest-playwright': Linter.Config
8+
'playwright-test': Linter.Config
9+
recommended: Linter.Config
10+
}
11+
rules: Record<string, Rule.RuleModule>
12+
}
13+
14+
export default config

index.mjs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import plugin from './dist/index.js'
2+
3+
export default plugin

package.json

+21-22
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,40 @@
1515
"engines": {
1616
"node": ">=16.6.0"
1717
},
18-
"types": "./dist/index.d.ts",
18+
"type": "commonjs",
1919
"exports": {
20-
"import": {
21-
"types": "./dist/index.d.mts",
22-
"default": "./dist/index.mjs"
23-
},
24-
"require": {
25-
"types": "./dist/index.d.ts",
26-
"default": "./dist/index.js"
20+
".": {
21+
"types": "./index.d.ts",
22+
"import": "./index.mjs",
23+
"require": "./dist/index.js"
2724
}
2825
},
2926
"files": [
30-
"dist"
27+
"dist",
28+
"index.js",
29+
"index.d.ts"
3130
],
3231
"scripts": {
33-
"build": "tsup src/index.ts --format cjs,esm --dts --out-dir dist --cjsInterop",
32+
"build": "tsup src/index.ts --format cjs --out-dir dist",
3433
"lint": "eslint .",
3534
"fmt": "prettier --write .",
3635
"fmt:check": "prettier --check .",
3736
"test": "vitest",
3837
"test:watch": "vitest --reporter=dot",
3938
"ts": "tsc --noEmit"
4039
},
40+
"peerDependencies": {
41+
"eslint": ">=8.40.0",
42+
"eslint-plugin-jest": ">=25"
43+
},
44+
"peerDependenciesMeta": {
45+
"eslint-plugin-jest": {
46+
"optional": true
47+
}
48+
},
49+
"dependencies": {
50+
"globals": "^13.23.0"
51+
},
4152
"devDependencies": {
4253
"@mskelton/eslint-config": "^8.4.0",
4354
"@mskelton/semantic-release-config": "^1.0.1",
@@ -55,17 +66,5 @@
5566
"tsup": "^8.0.1",
5667
"typescript": "^5.2.2",
5768
"vitest": "^1.3.1"
58-
},
59-
"peerDependencies": {
60-
"eslint": ">=8.40.0",
61-
"eslint-plugin-jest": ">=25"
62-
},
63-
"peerDependenciesMeta": {
64-
"eslint-plugin-jest": {
65-
"optional": true
66-
}
67-
},
68-
"dependencies": {
69-
"globals": "^13.23.0"
7069
}
7170
}

0 commit comments

Comments
 (0)