Skip to content

Commit f313889

Browse files
committed
fix: Rename node.js to nodejs.js
To avoid inadvertently running node.js (using Windows Script Host) instead of node.exe when .js is present in %PATHEXT% (as it is by default). The problem is exacerbated by a regression in .cmd shims generated by npm (npm/cmd-shim#64 npm/cmd-shim#71) and has already caused problems in CI (https://github.com/actions/setup-node/issues/720). Continue to export node and node.js from the package for backward compatibility. These may be removed in a future version. Signed-off-by: Kevin Locke <[email protected]>
1 parent 9b79913 commit f313889

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use strict";
22

33
module.exports = {
4-
"extends": "./node",
4+
"extends": "./nodejs",
55

66
// Use style consistent with JSON for easier sharing between formats
77
"rules": {

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This package includes configurations for several different environments:
3434
| Name | Description |
3535
| --------------------------------------- | ---------------------------------------- |
3636
| `@kevinoid/eslint-config/ie11` | Browsers including Internet Explorer 11. |
37-
| `@kevinoid/eslint-config/node` | Node 6 and later. |
37+
| `@kevinoid/eslint-config/nodejs` | Node 6 and later. |
3838
| `@kevinoid/eslint-config/webextensions` | [Browser Extensions](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions) |
3939
| `@kevinoid/eslint-config/wsh` | [JScript 5.8](https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/scripting-articles/hbxc2t98(v=vs.84)) in [Windows Script Host](https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2003/cc738350(v=ws.10)) |
4040

@@ -44,7 +44,7 @@ in `.eslintrc`, for example:
4444

4545
```json
4646
{
47-
"extends": "@kevinoid/eslint-config/node"
47+
"extends": "@kevinoid/eslint-config/nodejs"
4848
}
4949
```
5050

@@ -56,7 +56,7 @@ or `eslintConfig` in `package.json`, for example:
5656
"version": "1.0.0",
5757
...
5858
"eslintConfig": {
59-
"extends": "@kevinoid/eslint-config/node"
59+
"extends": "@kevinoid/eslint-config/nodejs"
6060
}
6161
}
6262
```

node.js renamed to nodejs.js

File renamed without changes.

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@
2525
"./ie11": "./ie11.js",
2626
"./ie11.js": "./ie11.js",
2727
"./package.json": "./package.json",
28-
"./node": "./node.js",
29-
"./node.js": "./node.js",
28+
"./node": "./nodejs.js",
29+
"./node.js": "./nodejs.js",
30+
"./nodejs": "./nodejs.js",
31+
"./nodejs.js": "./nodejs.js",
3032
"./webextensions": "./webextensions.js",
3133
"./webextensions.js": "./webextensions.js",
3234
"./wsh": "./wsh.js",
@@ -44,7 +46,7 @@
4446
"test-eslint": "npm run test-eslint-ie11 && npm run test-eslint-node && npm run test-eslint-webextensions && npm run test-eslint-wsh",
4547
"//": "Test that config can be loaded and works on empty input. Note: echo prints 'ECHO is on.' in cmd.exe, : produces no output in cmd.exe or sh.",
4648
"test-eslint-ie11": ": | eslint --no-eslintrc -c ie11.js --stdin",
47-
"test-eslint-node": ": | eslint --no-eslintrc -c node.js --stdin",
49+
"test-eslint-node": ": | eslint --no-eslintrc -c nodejs.js --stdin",
4850
"test-eslint-webextensions": ": | eslint --no-eslintrc -c webextensions.js --stdin",
4951
"test-eslint-wsh": ": | eslint --no-eslintrc -c wsh.js --stdin",
5052
"test-peer-versions": "peer-version-check package.json",

0 commit comments

Comments
 (0)