Skip to content

Commit 0de698d

Browse files
committed
Fix CI test-published-types
1 parent f2db629 commit 0de698d

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

.github/workflows/type-check.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,26 @@ jobs:
4444
- name: build types
4545
run: npm run build-types
4646

47+
# Pack the lib into a tarball so that when we install the lib later in the
48+
# test-published-types directory, it's only install `dependencies` of the
49+
# lib.
50+
- name: pack the lib
51+
run: npm run pack --pack-destination /tmp/
52+
53+
- name: find the packed lib
54+
run: echo "ESLINT_PLUGIN_REACT_PATH=$(ls /tmp/eslint-plugin-react*.tgz | tail -n 1)" >> $GITHUB_ENV
55+
56+
- name: show the path to the packed lib
57+
run: echo "$ESLINT_PLUGIN_REACT_PATH"
58+
4759
- name: npm install working directory
4860
run: npm install
4961
working-directory: test-published-types
5062

63+
- name: install packed lib
64+
run: npm install --no-save "$ESLINT_PLUGIN_REACT_PATH"
65+
working-directory: test-published-types
66+
5167
- name: install typescript version ${{ matrix.ts_version }}
5268
run: npm install --no-save typescript@${{ matrix.ts_version }}
5369
working-directory: test-published-types

test-published-types/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
const react = require('eslint-plugin-react');
44

55
/** @type {import('eslint').Linter.Config[]} */
6-
module.exports = [
6+
const config = [
77
{
88
plugins: {
99
react,
1010
},
1111
},
1212
];
13+
14+
module.exports = config;

test-published-types/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"private": true,
44
"version": "0.0.0",
55
"dependencies": {
6-
"eslint": "^9.11.1",
7-
"eslint-plugin-react": "file:.."
6+
"eslint": "^9.11.1"
87
}
98
}

test-published-types/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
"compilerOptions": {
99
"lib": ["esnext"],
10-
"types": ["node"]
10+
"types": ["node"],
11+
"skipLibCheck": true
1112
}
1213
}

0 commit comments

Comments
 (0)