From fc5f444474ce7e5a65c8ced6a87838cc32145ddd Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Sun, 13 Oct 2024 00:31:49 +0200 Subject: [PATCH] Fix lint issues in rollup.config.mjs --- package.json | 2 +- rollup.config.mjs | 42 ++++++++++++++++++++++++------------------ 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index fa34786..e9e19ad 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "test:bundler:webpack": "cd test/webpack && npm install && npm test", "test:types": "tsc -p ./test/types/tsconfig.json", "test:unit": "node --experimental-import-meta-resolve node_modules/jasmine/bin/jasmine.js --config=test/unit/jasmine.json", - "lint": "eslint eslint.config.mjs \"src/**/*.ts\"", + "lint": "eslint \"*.mjs\" \"src/**/*.ts\"", "build": "npm run build:bundle && npm run build:types", "build:bundle": "rollup -c", "build:types": "tsc --project . --emitDeclarationOnly --declarationDir ./lib && api-extractor run", diff --git a/rollup.config.mjs b/rollup.config.mjs index f449d35..68bc1b9 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -83,13 +83,15 @@ function plugins({ target }) { declaration: false, declarationMap: false }), - target === 'es5' ? inject({ - include: 'src/**/*.ts', - exclude: 'src/stub/symbol.ts', - modules: { - Symbol: path.resolve(dirname, './src/stub/symbol.ts') - } - }) : undefined, + target === 'es5' + ? inject({ + include: 'src/**/*.ts', + exclude: 'src/stub/symbol.ts', + modules: { + Symbol: path.resolve(dirname, './src/stub/symbol.ts') + } + }) + : undefined, replace({ include: 'src/**/*.ts', preventAssignment: true, @@ -97,17 +99,21 @@ function plugins({ target }) { DEBUG: debug } }), - !debug ? strip({ - include: 'src/**/*.ts', - functions: ['assert'] - }) : undefined, - !debug ? terser({ - keep_classnames: keepRegex, // needed for WPT - keep_fnames: keepRegex, - mangle: { - toplevel: true - } - }) : undefined + !debug + ? strip({ + include: 'src/**/*.ts', + functions: ['assert'] + }) + : undefined, + !debug + ? terser({ + keep_classnames: keepRegex, // needed for WPT + keep_fnames: keepRegex, + mangle: { + toplevel: true + } + }) + : undefined ].filter(Boolean); }