-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: not working on Windows 10 #21
Conversation
The test results are as follows. PS C:\path\to\eslint-cjs-to-esm> node eslint-cjs-to-esm.js "./test-fixtures/*"
C:\path\to\eslint-cjs-to-esm\test-fixtures\import-index.ts
1:26 error require file extension '/index.js' file-extension-in-import-ts/file-extension-in-import-ts
C:\path\to\eslint-cjs-to-esm\test-fixtures\import-no-js-suffix.ts
1:8 error require file extension '.js' file-extension-in-import-ts/file-extension-in-import-ts
1:8 error require file extension '.ts' node/file-extension-in-import
C:\path\to\eslint-cjs-to-esm\test-fixtures\no-node-protocol.ts
1:18 error Prefer `node:path` over `path` unicorn/prefer-node-protocol
C:\path\to\eslint-cjs-to-esm\test-fixtures\require.ts
1:1 error Expected "import" instead of "require()" import/no-commonjs
1:1 error Do not use "require" unicorn/prefer-module
✖ 6 problems (6 errors, 0 warnings)
4 errors and 0 warnings potentially fixable with the `--fix` option.
PS C:\path\to\eslint-cjs-to-esm> node eslint-cjs-to-esm.js "./test-fixtures/*" --fix
C:\path\to\eslint-cjs-to-esm\test-fixtures\require.ts
1:1 error Expected "import" instead of "require()" import/no-commonjs
1:1 error Do not use "require" unicorn/prefer-module
✖ 2 problems (2 errors, 0 warnings)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eslint-cjs-to-esm/.github/workflows/test.yml
Lines 5 to 23 in 018695b
jobs: | |
test: | |
name: "Test on Node.js ${{ matrix.node-version }}" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [ 18,20 ] | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: setup Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
cache: "npm" | |
node-version: ${{ matrix.node-version }} | |
- name: Install | |
run: npm ci | |
- name: Test | |
run: npm test |
Can you add a matrix?
test:
name: Test(Node ${{ matrix.node }} on ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node: [ 18, 20 ]
https://github.com/azu/eslint-cjs-to-esm/blob/main/package.json#L40 |
Another option: if process are Windows, just add |
Great. I will try this approach. Thank you.
|
I changed the implementation and test matrix in the way you explained. The behaviour is now not changed except in Windows. |
This error also happened on my local PC. https://github.com/azu/eslint-cjs-to-esm/actions/runs/7765836291/job/21181030640?pr=21 |
https://github.com/azu/eslint-cjs-to-esm/actions/runs/7765836291/job/21181030640?pr=21 We need to run |
Probably, need to use |
In cmd, single quote https://stackoverflow.com/questions/51080215/differences-between-single-and-double-quotes-in-cmd |
https://github.com/azu/eslint-cjs-to-esm/actions/runs/7765962449/job/21181296571?pr=21 - ./test-fixtures/*
+ ./test-fixtures/*.ts |
Thank you for your kind assistance. |
Thanks for work! Release |
Change the command for running eslint from node.js to npx for compatibility with Windows.
Closes #20