File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 108108 "@eslint/plugin-kit" : " ^0.2.5" ,
109109 "@humanfs/node" : " ^0.16.6" ,
110110 "@humanwhocodes/module-importer" : " ^1.0.1" ,
111- "@humanwhocodes/retry" : " ^0.4.1 " ,
111+ "@humanwhocodes/retry" : " ^0.4.2 " ,
112112 "@types/estree" : " ^1.0.6" ,
113113 "@types/json-schema" : " ^7.0.15" ,
114114 "ajv" : " ^6.12.4" ,
Original file line number Diff line number Diff line change @@ -6158,6 +6158,54 @@ describe("ESLint", () => {
61586158 assert . strictEqual ( createCallCount , 1 ) ;
61596159 } ) ;
61606160
6161+ // https://github.com/eslint/eslint/issues/19243
6162+ it ( "should not exit the process unexpectedly after a rule crashes" , async ( ) => {
6163+ const cwd = getFixturePath ( ) ;
6164+
6165+ /*
6166+ * Mocha attaches `unhandledRejection` event handlers to the current process.
6167+ * To test without global handlers, we must launch a new process.
6168+ */
6169+ const teardown = createCustomTeardown ( {
6170+ cwd,
6171+ files : {
6172+ "test.js" : `
6173+ const { ESLint } = require(${ JSON . stringify ( require . resolve ( "eslint" ) ) } );
6174+
6175+ const eslint = new ESLint({
6176+ flags: ${ JSON . stringify ( flags ) } ,
6177+ overrideConfigFile: true,
6178+ plugins: {
6179+ boom: {
6180+ rules: {
6181+ boom: {
6182+ create: () => ({
6183+ "*"() {
6184+ throw "Boom!";
6185+ },
6186+ }),
6187+ }
6188+ }
6189+ }
6190+ },
6191+ baseConfig: {
6192+ rules: {
6193+ "boom/boom": "error"
6194+ }
6195+ }
6196+ });
6197+
6198+ eslint.lintFiles("passing.js").catch(() => { });
6199+ `
6200+ }
6201+ } ) ;
6202+
6203+ await teardown . prepare ( ) ;
6204+ const execFile = util . promisify ( require ( "node:child_process" ) . execFile ) ;
6205+
6206+ await execFile ( process . execPath , [ "test.js" ] , { cwd } ) ;
6207+ } ) ;
6208+
61616209 describe ( "Error while globbing" , ( ) => {
61626210
61636211 it ( "should throw an error with a glob pattern if an invalid config was provided" , async ( ) => {
You can’t perform that action at this time.
0 commit comments