Skip to content
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

Update internal linting dependencies #1550

Merged
merged 2 commits into from
Jan 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
166 changes: 104 additions & 62 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
"@babel/plugin-external-helpers": "^7.10.4",
"@babel/preset-env": "^7.11.0",
"coveralls": "^3.1.0",
"eslint-config-jquery": "^1.0.1",
"eslint-plugin-html": "^6.0.3",
"eslint-plugin-node": "^8.0.1",
"eslint-plugin-qunit": "^3.2.0",
"eslint-config-jquery": "^3.0.0",
"eslint-plugin-html": "^6.1.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-qunit": "^5.3.0",
"execa": "^0.8.0",
"fixturify": "^0.3.4",
"fuzzysort": "^1.1.4",
Expand Down
3 changes: 3 additions & 0 deletions src/cli/require-qunit.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = function requireQUnit( resolve = require.resolve ) {
try {

// First we attempt to find QUnit relative to the current working directory.
// eslint-disable-next-line node/no-missing-require
const localQUnitPath = resolve( "qunit", {

// Support: Node 10. Explicitly check "node_modules" to avoid a bug.
Expand All @@ -16,13 +17,15 @@ module.exports = function requireQUnit( resolve = require.resolve ) {
try {

// Second, we use the globally installed QUnit
// eslint-disable-next-line node/no-unpublished-require, node/no-missing-require
delete require.cache[ resolve( "../../qunit/qunit" ) ];
// eslint-disable-next-line node/no-missing-require, node/no-unpublished-require
return require( "../../qunit/qunit" );
} catch ( e ) {
if ( e.code === "MODULE_NOT_FOUND" ) {

// Finally, we use the local development version of QUnit
// eslint-disable-next-line node/no-unpublished-require, node/no-missing-require
delete require.cache[ resolve( "../../dist/qunit" ) ];
// eslint-disable-next-line node/no-missing-require, node/no-unpublished-require
return require( "../../dist/qunit" );
Expand Down
2 changes: 1 addition & 1 deletion src/cli/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async function run( args, options ) {
require( filePath );
} catch ( e ) {
if ( e.code === "ERR_REQUIRE_ESM" && ( !nodeVint || nodeVint >= 72 ) ) {
await import( filePath );
await import( filePath ); // eslint-disable-line node/no-unsupported-features/es-syntax
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rule sounds pretty severe, but looks like it is an upstream bug. This syntax is supported since Node 10. The actual functionality is supported (without experimental flag) since Node 12, but that is a run-time check. The syntax is safe to have (unused) on Node 10.

Disabling the rule here seems fine, since we are already covered from a syntax perspective by ESLint's built-in checks, and by the integration tests running on the various Node versions in Travis CI.

Ref mysticatea/eslint-plugin-node#250.

} else {
throw e;
}
Expand Down