File tree Expand file tree Collapse file tree 8 files changed +193
-392
lines changed
background/tab_state_tracker Expand file tree Collapse file tree 8 files changed +193
-392
lines changed Original file line number Diff line number Diff line change 99 "type" : " module" ,
1010 "private" : true ,
1111 "engines" : {
12- "node" : " >= 18 "
12+ "node" : " >= 20 "
1313 },
1414 "scripts" : {
1515 "build" : " yarn run rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript" ,
2424 "@rollup/plugin-typescript" : " ^11.1.5" ,
2525 "@types/chrome" : " ^0.1.4" ,
2626 "@types/jest" : " ^29.4.0" ,
27- "@typescript-eslint/eslint-plugin" : " ^6.8.0 " ,
28- "@typescript-eslint/parser" : " ^6.8.0 " ,
29- "eslint" : " ^7.32 .0" ,
27+ "@typescript-eslint/eslint-plugin" : " 8.29.1 " ,
28+ "@typescript-eslint/parser" : " 8.29.1 " ,
29+ "eslint" : " 9.0 .0" ,
3030 "jest" : " ^29.7.0" ,
3131 "jest-environment-jsdom" : " ^29.0.0" ,
3232 "prettier" : " ^2.3.2" ,
Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ function handleMessages(
147147 if ( message . pkgRaw . includes ( DYNAMIC_STRING_MARKER ) ) {
148148 try {
149149 message . pkgRaw = removeDynamicStrings ( message . pkgRaw ) ;
150- } catch ( e ) {
150+ } catch {
151151 sendResponse ( { valid : false , reason : 'failed parsing AST' } ) ;
152152 return ;
153153 }
Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ export default class TabStateMachine extends StateMachine {
110110 * For more details on how this suppresses the error:
111111 * See: https://stackoverflow.com/questions/28431505/unchecked-runtime-lasterror-when-using-chrome-api/28432087#28432087
112112 */
113+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
113114 chrome . runtime . lastError && chrome . runtime . lastError . message ;
114115 } ,
115116 ) ;
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ function handleManifestNode(manifestNode: HTMLScriptElement): void {
103103 const manifestNodeTextContent = manifestNode . textContent ?? '' ;
104104 try {
105105 rawManifest = JSON . parse ( manifestNodeTextContent ) ;
106- } catch ( manifestParseError ) {
106+ } catch {
107107 setTimeout ( ( ) => parseFailedJSON ( { node : manifestNode , retry : 5000 } ) , 20 ) ;
108108 return ;
109109 }
@@ -304,7 +304,7 @@ export function storeFoundElement(element: HTMLElement): void {
304304 if ( element . getAttribute ( 'type' ) === 'application/json' ) {
305305 try {
306306 JSON . parse ( nodeTextContent ) ;
307- } catch ( parseError ) {
307+ } catch {
308308 setTimeout ( ( ) => parseFailedJSON ( { node : element , retry : 1500 } ) , 20 ) ;
309309 }
310310 return ;
@@ -390,7 +390,7 @@ export const scanForScriptsAndStyles = (): void => {
390390 childList : true ,
391391 subtree : true ,
392392 } ) ;
393- } catch ( _UnknownError ) {
393+ } catch {
394394 updateCurrentState ( STATES . INVALID , 'unknown' ) ;
395395 }
396396} ;
Original file line number Diff line number Diff line change @@ -98,8 +98,9 @@ function isValidCSSRule(rule: CSSRule): boolean {
9898function ensureCORSEnabledForStylesheet ( styleSheet : CSSStyleSheet ) : void {
9999 try {
100100 // Ensure all non same origin stylesheets can be accessed (CORS)
101+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
101102 styleSheet . cssRules ;
102- } catch ( e ) {
103+ } catch {
103104 updateStateOnInvalidStylesheet ( false , styleSheet ) ;
104105 }
105106}
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export function parseFailedJSON(queuedJsonToParse: {
2727 const nodeTextContent = queuedJsonToParse . node . textContent ?? '' ;
2828 try {
2929 JSON . parse ( nodeTextContent ) ;
30- } catch ( parseError ) {
30+ } catch {
3131 if ( queuedJsonToParse . retry > 0 ) {
3232 queuedJsonToParse . retry -- ;
3333 setTimeout ( ( ) => parseFailedJSON ( queuedJsonToParse ) , 20 ) ;
Original file line number Diff line number Diff line change @@ -294,7 +294,7 @@ let currentOrigin: Origin;
294294 const params = new URL ( document . location . href ) . searchParams ;
295295 setUpBackgroundMessageHandler ( params . get ( 'tab_id' ) ) ;
296296 const state = params . get ( 'state' ) as State ;
297- state && updateDisplay ( state ) ;
297+ updateDisplay ( state ) ;
298298 attachTextToHtml ( ) ;
299299 currentOrigin = params . get ( 'origin' ) as Origin ;
300300 attachMenuListeners ( currentOrigin ) ;
You can’t perform that action at this time.
0 commit comments