Skip to content

Commit

Permalink
fix: Fix types for flat config (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
mskelton authored Oct 23, 2024
1 parent 8778bd3 commit 9b7d8a5
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 22 deletions.
14 changes: 14 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Linter, Rule } from 'eslint'

declare const config: {
configs: {
'flat/jest-playwright': Linter.Config
'flat/recommended': Linter.Config
'jest-playwright': Linter.Config
'playwright-test': Linter.Config
recommended: Linter.Config
}
rules: Record<string, Rule.RuleModule>
}

export default config
3 changes: 3 additions & 0 deletions index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import plugin from './dist/index.js'

export default plugin
43 changes: 21 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,40 @@
"engines": {
"node": ">=16.6.0"
},
"types": "./dist/index.d.ts",
"type": "commonjs",
"exports": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
".": {
"types": "./index.d.ts",
"import": "./index.mjs",
"require": "./dist/index.js"
}
},
"files": [
"dist"
"dist",
"index.js",
"index.d.ts"
],
"scripts": {
"build": "tsup src/index.ts --format cjs,esm --dts --out-dir dist --cjsInterop",
"build": "tsup src/index.ts --format cjs --out-dir dist",
"lint": "eslint .",
"fmt": "prettier --write .",
"fmt:check": "prettier --check .",
"test": "vitest",
"test:watch": "vitest --reporter=dot",
"ts": "tsc --noEmit"
},
"peerDependencies": {
"eslint": ">=8.40.0",
"eslint-plugin-jest": ">=25"
},
"peerDependenciesMeta": {
"eslint-plugin-jest": {
"optional": true
}
},
"dependencies": {
"globals": "^13.23.0"
},
"devDependencies": {
"@mskelton/eslint-config": "^8.4.0",
"@mskelton/semantic-release-config": "^1.0.1",
Expand All @@ -55,17 +66,5 @@
"tsup": "^8.0.1",
"typescript": "^5.2.2",
"vitest": "^1.3.1"
},
"peerDependencies": {
"eslint": ">=8.40.0",
"eslint-plugin-jest": ">=25"
},
"peerDependenciesMeta": {
"eslint-plugin-jest": {
"optional": true
}
},
"dependencies": {
"globals": "^13.23.0"
}
}

0 comments on commit 9b7d8a5

Please sign in to comment.