Skip to content

Commit

Permalink
Fix CI test-published-types
Browse files Browse the repository at this point in the history
  • Loading branch information
ocavue committed Oct 17, 2024
1 parent f2db629 commit 0de698d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/type-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,26 @@ jobs:
- name: build types
run: npm run build-types

# Pack the lib into a tarball so that when we install the lib later in the
# test-published-types directory, it's only install `dependencies` of the
# lib.
- name: pack the lib
run: npm run pack --pack-destination /tmp/

- name: find the packed lib
run: echo "ESLINT_PLUGIN_REACT_PATH=$(ls /tmp/eslint-plugin-react*.tgz | tail -n 1)" >> $GITHUB_ENV

- name: show the path to the packed lib
run: echo "$ESLINT_PLUGIN_REACT_PATH"

- name: npm install working directory
run: npm install
working-directory: test-published-types

- name: install packed lib
run: npm install --no-save "$ESLINT_PLUGIN_REACT_PATH"
working-directory: test-published-types

- name: install typescript version ${{ matrix.ts_version }}
run: npm install --no-save typescript@${{ matrix.ts_version }}
working-directory: test-published-types
Expand Down
4 changes: 3 additions & 1 deletion test-published-types/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
const react = require('eslint-plugin-react');

/** @type {import('eslint').Linter.Config[]} */
module.exports = [
const config = [
{
plugins: {
react,
},
},
];

module.exports = config;
3 changes: 1 addition & 2 deletions test-published-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"private": true,
"version": "0.0.0",
"dependencies": {
"eslint": "^9.11.1",
"eslint-plugin-react": "file:.."
"eslint": "^9.11.1"
}
}
3 changes: 2 additions & 1 deletion test-published-types/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

"compilerOptions": {
"lib": ["esnext"],
"types": ["node"]
"types": ["node"],
"skipLibCheck": true
}
}

0 comments on commit 0de698d

Please sign in to comment.