Skip to content

Commit

Permalink
fix: Rename node.js to nodejs.js
Browse files Browse the repository at this point in the history
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 (actions/setup-node#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 <kevin@kevinlocke.name>
  • Loading branch information
kevinoid committed May 7, 2023
1 parent 9b79913 commit f313889
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";

module.exports = {
"extends": "./node",
"extends": "./nodejs",

// Use style consistent with JSON for easier sharing between formats
"rules": {
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This package includes configurations for several different environments:
| Name | Description |
| --------------------------------------- | ---------------------------------------- |
| `@kevinoid/eslint-config/ie11` | Browsers including Internet Explorer 11. |
| `@kevinoid/eslint-config/node` | Node 6 and later. |
| `@kevinoid/eslint-config/nodejs` | Node 6 and later. |
| `@kevinoid/eslint-config/webextensions` | [Browser Extensions](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions) |
| `@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)) |

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

```json
{
"extends": "@kevinoid/eslint-config/node"
"extends": "@kevinoid/eslint-config/nodejs"
}
```

Expand All @@ -56,7 +56,7 @@ or `eslintConfig` in `package.json`, for example:
"version": "1.0.0",
...
"eslintConfig": {
"extends": "@kevinoid/eslint-config/node"
"extends": "@kevinoid/eslint-config/nodejs"
}
}
```
Expand Down
File renamed without changes.
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
"./ie11": "./ie11.js",
"./ie11.js": "./ie11.js",
"./package.json": "./package.json",
"./node": "./node.js",
"./node.js": "./node.js",
"./node": "./nodejs.js",
"./node.js": "./nodejs.js",
"./nodejs": "./nodejs.js",
"./nodejs.js": "./nodejs.js",
"./webextensions": "./webextensions.js",
"./webextensions.js": "./webextensions.js",
"./wsh": "./wsh.js",
Expand All @@ -44,7 +46,7 @@
"test-eslint": "npm run test-eslint-ie11 && npm run test-eslint-node && npm run test-eslint-webextensions && npm run test-eslint-wsh",
"//": "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.",
"test-eslint-ie11": ": | eslint --no-eslintrc -c ie11.js --stdin",
"test-eslint-node": ": | eslint --no-eslintrc -c node.js --stdin",
"test-eslint-node": ": | eslint --no-eslintrc -c nodejs.js --stdin",
"test-eslint-webextensions": ": | eslint --no-eslintrc -c webextensions.js --stdin",
"test-eslint-wsh": ": | eslint --no-eslintrc -c wsh.js --stdin",
"test-peer-versions": "peer-version-check package.json",
Expand Down

0 comments on commit f313889

Please sign in to comment.