Skip to content

Commit 080209e

Browse files
authored
fix: stick on type: commonjs to ensure only one entry (#8)
1 parent c1a68da commit 080209e

12 files changed

+141
-454
lines changed

.changeset/cold-hats-press.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-import-context": patch
3+
---
4+
5+
fix: stick on `type: commonjs` to ensure only one entry
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
name="viewport"
1111
content="width=device-width, initial-scale=1.0"
1212
/>
13-
<title>lib boilerplate</title>
13+
<title>ESLint import context</title>
1414
</head>
1515
<body>
1616
<div id="app"></div>

package.json

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "eslint-import-context",
33
"version": "0.1.2",
4-
"type": "module",
4+
"type": "commonjs",
55
"description": "Provide context info for eslint-plugin-import-x, so no extra arguments need to be added.",
66
"repository": "git+https://github.com/un-ts/eslint-import-context.git",
77
"author": "JounQin <[email protected]> (https://www.1stG.me)",
@@ -11,19 +11,12 @@
1111
"engines": {
1212
"node": "^12.20.0 || ^14.18.0 || >=16.0.0"
1313
},
14-
"main": "./lib/index.cjs",
15-
"types": "./lib/index.d.cts",
16-
"module": "./lib/index.js",
14+
"main": "./lib/index.js",
15+
"types": "./lib/index.d.ts",
1716
"exports": {
1817
".": {
19-
"import": {
20-
"types": "./lib/index.d.ts",
21-
"default": "./lib/index.js"
22-
},
23-
"require": {
24-
"types": "./lib/index.d.cts",
25-
"default": "./lib/index.cjs"
26-
}
18+
"types": "./lib/index.d.ts",
19+
"default": "./lib/index.js"
2720
},
2821
"./package.json": "./package.json"
2922
},
@@ -32,9 +25,7 @@
3225
"!**/*.tsbuildinfo"
3326
],
3427
"scripts": {
35-
"build": "run-p 'build:*'",
36-
"build:tsc": "tsc -p src",
37-
"build:tsdown": "tsdown --no-clean -d lib -f cjs src/index.ts",
28+
"build": "tsc -p src",
3829
"clean": "premove .type-coverage coverage dist lib .eslintcache .stylelintcache",
3930
"dev": "vitest",
4031
"docs": "vite",
@@ -43,12 +34,12 @@
4334
"lint": "run-p 'lint:*'",
4435
"lint:es": "eslint . --cache --max-warnings 10",
4536
"lint:style": "stylelint . --cache",
46-
"lint:tsc": "tsc -p tsconfig.eslint.json --noEmit",
37+
"lint:tsc": "tsc -p tsconfig.base.json --noEmit",
4738
"prepare": "simple-git-hooks && yarn-berry-deduplicate || exit 0",
4839
"release": "yarn build && clean-pkg-json && changeset publish",
4940
"serve": "vite preview",
5041
"test": "vitest run",
51-
"typecov": "type-coverage",
42+
"typecov": "type-coverage -p tsconfig.base.json ",
5243
"version": "changeset version && yarn --no-immutable"
5344
},
5445
"devDependencies": {
@@ -68,9 +59,9 @@
6859
"@types/react-dom": "^19.1.5",
6960
"@types/web": "^0.0.235",
7061
"@vercel/analytics": "^1.5.0",
71-
"@vitejs/plugin-react-swc": "^3.9.0",
62+
"@vitejs/plugin-react-swc": "^3.10.0",
7263
"@vitest/coverage-v8": "^3.1.4",
73-
"@vitest/eslint-plugin": "^1.2.0",
64+
"@vitest/eslint-plugin": "^1.2.1",
7465
"clean-pkg-json": "^1.3.0",
7566
"eslint": "^9.27.0",
7667
"eslint-plugin-react-hooks": "^5.2.0",
@@ -88,7 +79,6 @@
8879
"size-limit": "^11.2.0",
8980
"size-limit-preset-node-lib": "^0.4.0",
9081
"stylelint": "^16.19.1",
91-
"tsdown": "^0.12.2",
9282
"type-coverage": "^2.29.7",
9383
"typescript": "^5.8.3",
9484
"vite": "^6.3.5",

test/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"extends": "../tsconfig.eslint"
2+
"extends": "../tsconfig.base"
33
}
File renamed without changes.

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "@1stg/tsconfig/node16",
2+
"extends": "@1stg/tsconfig/node",
33
"compilerOptions": {
44
"rootDir": ".",
55
// https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping#node-12

vitest.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import path from 'node:path'
2+
13
import { defineConfig } from 'vitest/config'
24

35
export default defineConfig({
46
resolve: {
57
alias: {
6-
'eslint-import-context': new URL('src/index.ts', import.meta.url)
7-
.pathname,
8+
'eslint-import-context': path.resolve(__dirname, 'src/index.ts'),
89
},
910
},
1011
test: {

0 commit comments

Comments
 (0)