Skip to content

Commit 0540006

Browse files
authored
fix: make types usable in CommonJS (#44)
* fix: make types usable in CommonJS * use local `@types/css-tree` package * don't use `node_modules/@types/css-tree` in development * use `node_modules` types instead of local typings * remove outdated `@types/eslint`
1 parent 265523d commit 0540006

File tree

9 files changed

+25
-7
lines changed

9 files changed

+25
-7
lines changed

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
package-lock = false
2+
install-links = false

jsr.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"dist/esm/index.d.ts",
99
"README.md",
1010
"jsr.json",
11-
"LICENSE"
11+
"LICENSE",
12+
"typings/css-tree/index.d.ts",
13+
"typings/css-tree/LICENSE"
1214
]
1315
}
1416
}

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
}
1818
},
1919
"files": [
20-
"dist"
20+
"dist",
21+
"typings"
2122
],
2223
"publishConfig": {
2324
"access": "public"
@@ -69,13 +70,13 @@
6970
],
7071
"license": "Apache-2.0",
7172
"dependencies": {
72-
"@eslint/plugin-kit": "^0.2.3",
73+
"@eslint/core": "^0.10.0",
74+
"@eslint/plugin-kit": "^0.2.5",
75+
"@types/css-tree": "file:./typings/css-tree",
7376
"css-tree": "^3.1.0"
7477
},
7578
"devDependencies": {
76-
"@eslint/core": "^0.7.0",
7779
"@eslint/json": "^0.5.0",
78-
"@types/eslint": "^8.56.10",
7980
"c8": "^9.1.0",
8081
"dedent": "^1.5.3",
8182
"eslint": "^9.11.1",

tests/types/cjs-import.test.cts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* @fileoverview CommonJS type import test for ESLint CSS Language Plugin.
3+
* @author Francesco Trotta
4+
*/
5+
6+
//-----------------------------------------------------------------------------
7+
// Imports
8+
//-----------------------------------------------------------------------------
9+
10+
import "@eslint/css";

tests/types/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"rootDir": "../..",
66
"strict": true
77
},
8-
"files": ["../../dist/esm/index.d.ts", "types.test.ts"]
8+
"files": [],
9+
"include": [".", "../../dist"]
910
}

tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"files": ["src/index.js"],
3-
"include": ["typings"],
43
"compilerOptions": {
54
"declaration": true,
65
"emitDeclarationOnly": true,
File renamed without changes.
File renamed without changes.

typings/css-tree/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"private": true,
3+
"name": "@types/css-tree"
4+
}

0 commit comments

Comments
 (0)