Skip to content

Commit 72480d1

Browse files
authored
fix: package.json types (#300)
* fix: package.json types * fix: remove types field in package.json * fix: types * fix
1 parent b11e32e commit 72480d1

File tree

23 files changed

+151
-25
lines changed

23 files changed

+151
-25
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@ packages/**/.yarn
2222
.DS_Store
2323

2424
integration-test-projects/**/*.yarn
25+
packages/template-syntax-parser/types
26+
packages/template-parser/types
27+
packages/parser/types
28+
packages/eslint-plugin/types

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"jest": "^29.7.0",
3434
"lerna": "^8.1.9",
3535
"prettier": "^3.5.2",
36+
"rimraf": "^6.0.1",
3637
"svgo": "^3",
3738
"turbo": "^2.0.11",
3839
"typescript": "^5.7.2"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import plugin = require("./index");
2+
export default plugin;

packages/eslint-plugin/lib/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ const recommended = require("./configs/recommended");
33
const parser = require("@html-eslint/parser");
44

55
/**
6-
* @type {{configs: {recommended: typeof recommended,"flat/recommended": import("eslint").Linter.FlatConfig , rules: typeof rules}}}
6+
* @typedef {import("./rules")} AllRules
7+
* @typedef {import("./configs/recommended")} RecommendedConfig
8+
*/
9+
10+
/**
11+
* @type {{rules: AllRules, configs: {recommended: RecommendedConfig, "flat/recommended": import("eslint").Linter.FlatConfig }}}
712
*/
813
const plugin = {
914
// @ts-ignore

packages/eslint-plugin/lib/types/rule.d.ts renamed to packages/eslint-plugin/lib/types/rule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ interface RuleFix {
5353
text: string;
5454
}
5555

56-
interface RuleFixer {
56+
export interface RuleFixer {
5757
insertTextAfter(nodeOrToken: AnyNodeAndLine, text: string): RuleFix;
5858

5959
insertTextAfterRange(range: eslint.AST.Range, text: string): RuleFix;

packages/eslint-plugin/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
"homepage": "https://github.com/yeonjuan/html-eslint#readme",
77
"license": "MIT",
88
"main": "lib/index.js",
9-
"types": "types/index.d.ts",
9+
"types": "types/exports.d.ts",
1010
"files": [
11-
"lib"
11+
"lib",
12+
"types"
1213
],
1314
"publishConfig": {
1415
"access": "public"
@@ -20,7 +21,8 @@
2021
"scripts": {
2122
"test": "jest --coverage",
2223
"ts": "tsc --noEmit",
23-
"lint": "eslint ."
24+
"lint": "eslint .",
25+
"build": "rimraf types && tsc --project tsconfig.build.json"
2426
},
2527
"bugs": {
2628
"url": "https://github.com/yeonjuan/html-eslint/issues"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"include": ["lib"],
4+
"compilerOptions": {
5+
"outDir": "types",
6+
"emitDeclarationOnly": true,
7+
"noEmit": false,
8+
"rootDir": "lib"
9+
}
10+
}

0 commit comments

Comments
 (0)