Skip to content

Commit

Permalink
Use eslint-plugin-n instead of eslint-plugin-node
Browse files Browse the repository at this point in the history
Since eslint-plugin-node has been dormant for quite a while:
mysticatea/eslint-plugin-node#294
mysticatea/eslint-plugin-node#300
eslint-plugin-n is an actively maintained fork which is used by xo:
xojs/xo#660
switch to that fork.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
  • Loading branch information
kevinoid committed Jul 3, 2022
1 parent 99a22e5 commit 572d4c5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions node.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const { "rules": { "no-restricted-properties": noRestrictedProps } } =
require("./rules/best-practices.js");

const { "configs": { "recommended": { "parserOptions": { sourceType } } } } =
requirePeer("eslint-plugin-node");
requirePeer("eslint-plugin-n");

module.exports = {
// Based on Airbnb with changes to match Node core and my prefs.
Expand All @@ -30,7 +30,7 @@ module.exports = {

// extend node plugin last because it sets parserOptions based on type
// field from nearest ancestor package.json to process.cwd().
"./rules/node"
"./rules/n"
],

"parserOptions": {
Expand All @@ -39,7 +39,7 @@ module.exports = {
"ecmaFeatures": {
"generators": true
},
// It would be preferable to use the version set by eslint-plugin-node
// It would be preferable to use the version set by eslint-plugin-n
// (determined based on package.json#engines/node). Unfortunately, it
// currently sets ecmaVersion: 2019 unconditionally, which lacks support
// for widely used language features (e.g. import() and import.meta).
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"peerDependencies": {
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-jsdoc": "^39.0.0",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-n": "^15.0.0",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-unicorn": "^43.0.0"
},
Expand All @@ -68,7 +68,7 @@
"eslint-find-rules": "^4.0.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-jsdoc": "^39.0.0",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-n": "^15.0.0",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-unicorn": "^43.0.0",
"peer-version-check": "^0.1.0"
Expand Down
8 changes: 4 additions & 4 deletions rules/node.js → rules/n.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// ESLint common configuration rules for Node plugin
// https://github.com/mysticatea/eslint-plugin-node#-rules
// ESLint common configuration rules for N plugin
// https://github.com/weiran-zsd/eslint-plugin-node#-rules

"use strict";

module.exports = {
"extends": [
"plugin:node/recommended"
"plugin:n/recommended"
],

"rules": {
// require file extensions in import declarations
// https://nodejs.org/api/esm.html#esm_mandatory_file_extensions
"node/file-extension-in-import": "error"
"n/file-extension-in-import": "error"
}
};

0 comments on commit 572d4c5

Please sign in to comment.