Migrate from `eslint-plugin-node` to `eslint-plugin-n` (#179)

pull/180/head
Eric Eastwood 10 months ago committed by GitHub
parent 6c38f47a0c
commit 0f26dc94d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -8,8 +8,7 @@
"ecmaVersion": 2022,
"sourceType": "script"
},
"plugins": ["node"],
"extends": ["eslint:recommended", "prettier"],
"extends": ["eslint:recommended", "prettier", "plugin:n/recommended"],
"rules": {
"indent": "off",
"comma-dangle": "off",
@ -77,9 +76,8 @@
}
}
],
"node/no-missing-require": "error",
"node/no-missing-import": "error",
"node/no-unsupported-features/es-syntax": "error",
"node/no-unsupported-features/es-builtins": "error"
"n/no-process-exit": "off",
"n/no-unsupported-features/es-syntax": "error",
"n/no-unsupported-features/es-builtins": "error"
}
}

@ -0,0 +1,5 @@
{
"rules": {
"n/no-unpublished-require": "off"
}
}

@ -9,7 +9,7 @@
"sourceType": "module"
},
"rules": {
"node/no-unsupported-features/es-syntax": "off",
"node/no-unsupported-features/es-builtins": "off"
"n/no-unsupported-features/es-syntax": "off",
"n/no-unsupported-features/es-builtins": "off"
}
}

@ -1,9 +1,5 @@
import 'matrix-public-archive-shared/hydrogen-vm-render-script';
import 'matrix-public-archive-shared/hydrogen-vm-render-script.js';
// Assets
// We have to disable no-missing-require lint because it doesn't take into
// account `package.json`. `exports`, see
// https://github.com/mysticatea/eslint-plugin-node/issues/255
// eslint-disable-next-line node/no-missing-import
import 'hydrogen-view-sdk/assets/theme-element-light.css';
import '../css/styles.css';

@ -1,12 +1,8 @@
import assert from 'matrix-public-archive-shared/lib/assert';
import MatrixPublicArchiveURLCreator from 'matrix-public-archive-shared/lib/url-creator';
import redirectIfRoomAliasInHash from 'matrix-public-archive-shared/lib/redirect-if-room-alias-in-hash';
import assert from 'matrix-public-archive-shared/lib/assert.js';
import MatrixPublicArchiveURLCreator from 'matrix-public-archive-shared/lib/url-creator.js';
import redirectIfRoomAliasInHash from 'matrix-public-archive-shared/lib/redirect-if-room-alias-in-hash.js';
// Assets
// We have to disable no-missing-require lint because it doesn't take into
// account `package.json`. `exports`, see
// https://github.com/mysticatea/eslint-plugin-node/issues/255
// eslint-disable-next-line node/no-missing-import
import 'hydrogen-view-sdk/assets/theme-element-light.css';
import '../css/styles.css';

@ -1,10 +1,6 @@
import 'matrix-public-archive-shared/room-directory-vm-render-script';
import 'matrix-public-archive-shared/room-directory-vm-render-script.js';
// Assets
// We have to disable no-missing-require lint because it doesn't take into
// account `package.json`. `exports`, see
// https://github.com/mysticatea/eslint-plugin-node/issues/255
// eslint-disable-next-line node/no-missing-import
import 'hydrogen-view-sdk/assets/theme-element-light.css';
import '../css/styles.css';
import '../css/room-directory.css';

196
package-lock.json generated

@ -35,7 +35,7 @@
"chalk": "^4.1.2",
"eslint": "^8.37.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-prettier": "^4.2.1",
"merge-options": "^3.0.4",
"mocha": "^9.2.1",
@ -2748,6 +2748,30 @@
"node": ">= 0.10.x"
}
},
"node_modules/builtins": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz",
"integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==",
"dev": true,
"dependencies": {
"semver": "^7.0.0"
}
},
"node_modules/builtins/node_modules/semver": {
"version": "7.5.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.0.tgz",
"integrity": "sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==",
"dev": true,
"dependencies": {
"lru-cache": "^6.0.0"
},
"bin": {
"semver": "bin/semver.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/bytes": {
"version": "3.1.1",
"license": "MIT",
@ -3377,9 +3401,10 @@
}
},
"node_modules/eslint-plugin-es": {
"version": "3.0.1",
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-4.1.0.tgz",
"integrity": "sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"eslint-utils": "^2.0.0",
"regexpp": "^3.0.0"
@ -3396,8 +3421,9 @@
},
"node_modules/eslint-plugin-es/node_modules/eslint-utils": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz",
"integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==",
"dev": true,
"license": "MIT",
"dependencies": {
"eslint-visitor-keys": "^1.1.0"
},
@ -3410,52 +3436,51 @@
},
"node_modules/eslint-plugin-es/node_modules/eslint-visitor-keys": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
"integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
"dev": true,
"license": "Apache-2.0",
"engines": {
"node": ">=4"
}
},
"node_modules/eslint-plugin-node": {
"version": "11.1.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz",
"integrity": "sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==",
"node_modules/eslint-plugin-n": {
"version": "15.7.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.7.0.tgz",
"integrity": "sha512-jDex9s7D/Qial8AGVIHq4W7NswpUD5DPDL2RH8Lzd9EloWUuvUkHfv4FRLMipH5q2UtyurorBkPeNi1wVWNh3Q==",
"dev": true,
"dependencies": {
"eslint-plugin-es": "^3.0.0",
"eslint-utils": "^2.0.0",
"builtins": "^5.0.1",
"eslint-plugin-es": "^4.1.0",
"eslint-utils": "^3.0.0",
"ignore": "^5.1.1",
"minimatch": "^3.0.4",
"resolve": "^1.10.1",
"semver": "^6.1.0"
"is-core-module": "^2.11.0",
"minimatch": "^3.1.2",
"resolve": "^1.22.1",
"semver": "^7.3.8"
},
"engines": {
"node": ">=8.10.0"
"node": ">=12.22.0"
},
"funding": {
"url": "https://github.com/sponsors/mysticatea"
},
"peerDependencies": {
"eslint": ">=5.16.0"
"eslint": ">=7.0.0"
}
},
"node_modules/eslint-plugin-node/node_modules/eslint-utils": {
"version": "2.1.0",
"node_modules/eslint-plugin-n/node_modules/semver": {
"version": "7.5.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.0.tgz",
"integrity": "sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==",
"dev": true,
"license": "MIT",
"dependencies": {
"eslint-visitor-keys": "^1.1.0"
"lru-cache": "^6.0.0"
},
"engines": {
"node": ">=6"
"bin": {
"semver": "bin/semver.js"
},
"funding": {
"url": "https://github.com/sponsors/mysticatea"
}
},
"node_modules/eslint-plugin-node/node_modules/eslint-visitor-keys": {
"version": "1.3.0",
"dev": true,
"license": "Apache-2.0",
"engines": {
"node": ">=4"
"node": ">=10"
}
},
"node_modules/eslint-plugin-prettier": {
@ -3492,6 +3517,33 @@
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
}
},
"node_modules/eslint-utils": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz",
"integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==",
"dev": true,
"dependencies": {
"eslint-visitor-keys": "^2.0.0"
},
"engines": {
"node": "^10.0.0 || ^12.0.0 || >= 14.0.0"
},
"funding": {
"url": "https://github.com/sponsors/mysticatea"
},
"peerDependencies": {
"eslint": ">=5"
}
},
"node_modules/eslint-utils/node_modules/eslint-visitor-keys": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz",
"integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==",
"dev": true,
"engines": {
"node": ">=10"
}
},
"node_modules/eslint-visitor-keys": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz",
@ -5444,8 +5496,9 @@
},
"node_modules/regexpp": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz",
"integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=8"
},
@ -7995,6 +8048,26 @@
"xtend": "^4.0.0"
}
},
"builtins": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz",
"integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==",
"dev": true,
"requires": {
"semver": "^7.0.0"
},
"dependencies": {
"semver": {
"version": "7.5.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.0.tgz",
"integrity": "sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==",
"dev": true,
"requires": {
"lru-cache": "^6.0.0"
}
}
}
},
"bytes": {
"version": "3.1.1"
},
@ -8421,7 +8494,9 @@
"requires": {}
},
"eslint-plugin-es": {
"version": "3.0.1",
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-4.1.0.tgz",
"integrity": "sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ==",
"dev": true,
"requires": {
"eslint-utils": "^2.0.0",
@ -8430,6 +8505,8 @@
"dependencies": {
"eslint-utils": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz",
"integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==",
"dev": true,
"requires": {
"eslint-visitor-keys": "^1.1.0"
@ -8437,34 +8514,36 @@
},
"eslint-visitor-keys": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
"integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
"dev": true
}
}
},
"eslint-plugin-node": {
"version": "11.1.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz",
"integrity": "sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==",
"eslint-plugin-n": {
"version": "15.7.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.7.0.tgz",
"integrity": "sha512-jDex9s7D/Qial8AGVIHq4W7NswpUD5DPDL2RH8Lzd9EloWUuvUkHfv4FRLMipH5q2UtyurorBkPeNi1wVWNh3Q==",
"dev": true,
"requires": {
"eslint-plugin-es": "^3.0.0",
"eslint-utils": "^2.0.0",
"builtins": "^5.0.1",
"eslint-plugin-es": "^4.1.0",
"eslint-utils": "^3.0.0",
"ignore": "^5.1.1",
"minimatch": "^3.0.4",
"resolve": "^1.10.1",
"semver": "^6.1.0"
"is-core-module": "^2.11.0",
"minimatch": "^3.1.2",
"resolve": "^1.22.1",
"semver": "^7.3.8"
},
"dependencies": {
"eslint-utils": {
"version": "2.1.0",
"semver": {
"version": "7.5.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.0.tgz",
"integrity": "sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==",
"dev": true,
"requires": {
"eslint-visitor-keys": "^1.1.0"
"lru-cache": "^6.0.0"
}
},
"eslint-visitor-keys": {
"version": "1.3.0",
"dev": true
}
}
},
@ -8487,6 +8566,23 @@
"estraverse": "^5.2.0"
}
},
"eslint-utils": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz",
"integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==",
"dev": true,
"requires": {
"eslint-visitor-keys": "^2.0.0"
},
"dependencies": {
"eslint-visitor-keys": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz",
"integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==",
"dev": true
}
}
},
"eslint-visitor-keys": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz",
@ -9689,6 +9785,8 @@
},
"regexpp": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz",
"integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==",
"dev": true
},
"registry-auth-token": {

@ -27,7 +27,7 @@
"chalk": "^4.1.2",
"eslint": "^8.37.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-prettier": "^4.2.1",
"merge-options": "^3.0.4",
"mocha": "^9.2.1",

@ -11,7 +11,7 @@ function getManifest() {
return _manifest;
}
// We have to disable this because it's built via the Vite client build.
// eslint-disable-next-line node/no-missing-require
// eslint-disable-next-line n/no-missing-require, n/no-unpublished-require
_manifest = require('../../dist/manifest.json');
return _manifest;
}

@ -10,7 +10,7 @@ function getManifest() {
return _manifest;
}
// We have to disable this because it's built via the Vite client build.
// eslint-disable-next-line node/no-missing-require
// eslint-disable-next-line n/no-missing-require, n/no-unpublished-require
_manifest = require('../../dist/manifest.json');
return _manifest;
}

@ -3,6 +3,7 @@
console.log('start-dev process.env.NODE_ENV', process.env.NODE_ENV);
const path = require('path');
// eslint-disable-next-line n/no-unpublished-require
const nodemon = require('nodemon');
const buildClient = require('../build-scripts/build-client');

@ -9,6 +9,7 @@
"strict": [
"error",
"safe"
]
],
"n/no-unpublished-require": "off"
}
}

Loading…
Cancel
Save