Skip to content

Commit

Permalink
cleaning some eslint messages
Browse files Browse the repository at this point in the history
  • Loading branch information
tropicadri committed Jan 8, 2022
1 parent 852d638 commit fa26432
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/workbox-build/src/lib/populate-sw-template.ts
Expand Up @@ -33,7 +33,7 @@ export function populateSWTemplate({
skipWaiting,
}: GeneratePartial & {manifestEntries?: Array<ManifestEntry>}): string {
// There needs to be at least something to precache, or else runtime caching.
if (!(manifestEntries.length > 0 || runtimeCaching.length > 0)) {
if (!(manifestEntries?.length > 0 || runtimeCaching.length > 0)) {
throw new Error(errors['no-manifest-entries-or-runtime-caching']);
}

Expand Down
8 changes: 2 additions & 6 deletions packages/workbox-webpack-plugin/src/inject-manifest.ts
Expand Up @@ -280,7 +280,6 @@ class InjectManifest {
try {
this.config = validateWebpackInjectManifestOptions(this.config);
} catch (error) {
// eslint-disable-next-line
if (error instanceof Error) {
throw new Error(
`Please check your ${this.constructor.name} plugin ` +
Expand Down Expand Up @@ -380,12 +379,9 @@ class InjectManifest {
if (
this.config.compileSrc &&
// See https://github.com/GoogleChrome/workbox/issues/2729
// (TODO: Switch to ?. once our linter supports it.)
!(
compilation.options &&
compilation.options.devtool === 'eval-cheap-source-map' &&
compilation.options.optimization &&
compilation.options.optimization.minimize
compilation.options?.devtool === 'eval-cheap-source-map' &&
compilation.options.optimization?.minimize
)
) {
// See https://github.com/GoogleChrome/workbox/issues/2263
Expand Down

0 comments on commit fa26432

Please sign in to comment.