Skip to content

Commit d121b05

Browse files
committed
Refactor package.json
1 parent 0a4cac8 commit d121b05

File tree

3 files changed

+90
-82
lines changed

3 files changed

+90
-82
lines changed

lib/jsx-automatic.d.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ export namespace JSX {
2929
*
3030
* This **must** be an interface.
3131
*/
32-
interface IntrinsicElements {
33-
[name: string]:
34-
| Properties
35-
| {
36-
/**
37-
* The prop that matches `ElementChildrenAttribute` key defines the
38-
* type of JSX children, defines the children type.
39-
*/
40-
children?: Child
41-
}
42-
}
32+
type IntrinsicElements = Record<
33+
string,
34+
| Properties
35+
| {
36+
/**
37+
* The prop that matches `ElementChildrenAttribute` key defines the
38+
* type of JSX children, defines the children type.
39+
*/
40+
children?: Child
41+
}
42+
>
4343
}

lib/jsx-classic.d.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ export type IntrinsicAttributes = never
3434
*
3535
* This **must** be an interface.
3636
*/
37-
export interface IntrinsicElements {
38-
[name: string]:
39-
| Properties
40-
| {
41-
/**
42-
* The prop that matches `ElementChildrenAttribute` key defines the
43-
* type of JSX children, defines the children type.
44-
*/
45-
[children]?: Child
46-
}
47-
}
37+
export type IntrinsicElements = Record<
38+
string,
39+
| Properties
40+
| {
41+
/**
42+
* The prop that matches `ElementChildrenAttribute` key defines the
43+
* type of JSX children, defines the children type.
44+
*/
45+
[children]?: Child
46+
}
47+
>

package.json

+68-60
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,18 @@
11
{
2-
"name": "hastscript",
3-
"version": "9.0.0",
4-
"description": "hast utility to create trees",
5-
"license": "MIT",
6-
"keywords": [
7-
"unist",
8-
"hast",
9-
"hast-util",
10-
"util",
11-
"utility",
12-
"html",
13-
"rehype",
14-
"vdom",
15-
"virtual",
16-
"dom",
17-
"hyperscript",
18-
"dsl"
19-
],
20-
"repository": "syntax-tree/hastscript",
21-
"bugs": "https://github.com/syntax-tree/hastscript/issues",
22-
"funding": {
23-
"type": "opencollective",
24-
"url": "https://opencollective.com/unified"
25-
},
262
"author": "Titus Wormer <[email protected]> (https://wooorm.com)",
3+
"bugs": "https://github.com/syntax-tree/hastscript/issues",
274
"contributors": [
285
"Titus Wormer <[email protected]> (https://wooorm.com)"
296
],
30-
"sideEffects": false,
31-
"type": "module",
32-
"main": "index.js",
33-
"types": "index.d.ts",
34-
"exports": {
35-
".": "./index.js",
36-
"./jsx-runtime": "./lib/automatic-runtime-html.js",
37-
"./jsx-dev-runtime": "./lib/automatic-runtime-html.js",
38-
"./svg/jsx-runtime": "./lib/automatic-runtime-svg.js",
39-
"./svg/jsx-dev-runtime": "./lib/automatic-runtime-svg.js"
40-
},
41-
"files": [
42-
"lib/",
43-
"index.d.ts.map",
44-
"index.d.ts",
45-
"index.js"
46-
],
477
"dependencies": {
488
"@types/hast": "^3.0.0",
499
"comma-separated-tokens": "^2.0.0",
5010
"hast-util-parse-selector": "^4.0.0",
5111
"property-information": "^7.0.0",
5212
"space-separated-tokens": "^2.0.0"
5313
},
54-
"#devDependencies": "note: some bug with `typescript` 5.5 being broken",
14+
"description": "hast utility to create trees",
15+
"devDependencies#": "note: some bug with `typescript` 5.5 being broken",
5516
"devDependencies": {
5617
"@types/node": "^22.0.0",
5718
"acorn-jsx": "^5.0.0",
@@ -69,15 +30,39 @@
6930
"unist-builder": "^4.0.0",
7031
"xo": "^0.60.0"
7132
},
72-
"scripts": {
73-
"prepack": "npm run build && npm run format",
74-
"build": "tsc --build --clean && tsc --build && tsd && type-coverage",
75-
"generate": "node script/generate-jsx.js && node script/build.js",
76-
"format": "remark . -qfo && prettier . -w --log-level warn && xo --fix",
77-
"test-api": "node --conditions development test/index.js",
78-
"test-coverage": "c8 --100 --reporter lcov npm run test-api",
79-
"test": "npm run generate && npm run build && npm run format && npm run test-coverage"
33+
"exports": {
34+
"./jsx-dev-runtime": "./lib/automatic-runtime-html.js",
35+
"./jsx-runtime": "./lib/automatic-runtime-html.js",
36+
"./svg/jsx-dev-runtime": "./lib/automatic-runtime-svg.js",
37+
"./svg/jsx-runtime": "./lib/automatic-runtime-svg.js",
38+
".": "./index.js"
8039
},
40+
"files": [
41+
"index.d.ts.map",
42+
"index.d.ts",
43+
"index.js",
44+
"lib/"
45+
],
46+
"funding": {
47+
"type": "opencollective",
48+
"url": "https://opencollective.com/unified"
49+
},
50+
"keywords": [
51+
"dom",
52+
"dsl",
53+
"hast-util",
54+
"hast",
55+
"html",
56+
"hyperscript",
57+
"rehype",
58+
"unist",
59+
"utility",
60+
"util",
61+
"vdom",
62+
"virtual"
63+
],
64+
"license": "MIT",
65+
"name": "hastscript",
8166
"prettier": {
8267
"bracketSpacing": false,
8368
"semi": false,
@@ -91,29 +76,52 @@
9176
"remark-preset-wooorm"
9277
]
9378
},
79+
"repository": "syntax-tree/hastscript",
80+
"scripts": {
81+
"build": "tsc --build --clean && tsc --build && tsd && type-coverage",
82+
"format": "remark --frail --output --quiet -- . && prettier --log-level warn --write -- . && xo --fix",
83+
"generate": "node --conditions development script/generate-jsx.js && node --conditions development script/build.js",
84+
"test-api": "node --conditions development test/index.js",
85+
"test-coverage": "c8 --100 --reporter lcov -- npm run test-api",
86+
"test": "npm run generate && npm run build && npm run format && npm run test-coverage"
87+
},
88+
"sideEffects": false,
9489
"typeCoverage": {
9590
"atLeast": 100,
96-
"detail": true,
97-
"ignoreCatch": true,
98-
"#": "needed `any`s :'(",
91+
"ignoreFiles#": "needed `any`s :'(",
9992
"ignoreFiles": [
10093
"test/jsx-build-jsx-automatic-development.js"
10194
],
10295
"strict": true
10396
},
97+
"type": "module",
98+
"version": "9.0.0",
10499
"xo": {
105100
"overrides": [
106101
{
107-
"files": "**/*.ts",
102+
"files": [
103+
"**/*.ts"
104+
],
108105
"rules": {
109-
"@typescript-eslint/consistent-indexed-object-style": "off",
110-
"@typescript-eslint/consistent-type-definitions": "off"
106+
"@typescript-eslint/array-type": [
107+
"error",
108+
{
109+
"default": "generic"
110+
}
111+
],
112+
"@typescript-eslint/ban-types": [
113+
"error",
114+
{
115+
"extendDefaults": true
116+
}
117+
],
118+
"@typescript-eslint/consistent-type-definitions": [
119+
"error",
120+
"interface"
121+
]
111122
}
112123
}
113124
],
114-
"prettier": true,
115-
"rules": {
116-
"n/file-extension-in-import": "off"
117-
}
125+
"prettier": true
118126
}
119127
}

0 commit comments

Comments
 (0)