Skip to content

Commit

Permalink
🚨 Fixed linter warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed Dec 18, 2023
1 parent deca80c commit fbad588
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions src/analyze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export const detectableModules: ModuleEntry[] = [
detectableModules.push(
["es.typed-array.from", PT.StaticMember, name, "from"],
["es.typed-array.of", PT.StaticMember, name, "of"],
[module, PT.Global, name]
[module, PT.Global, name],
)
}))()
/**
Expand Down Expand Up @@ -341,7 +341,7 @@ class Walker {
}
})
this._modules.push(
...filterModules.filter((m) => !usedModules.includes(m))
...filterModules.filter((m) => !usedModules.includes(m)),
)
}

Expand Down Expand Up @@ -370,7 +370,7 @@ class Walker {
registerCall(
module: string,
object: string,
validator: (args: Array<unknown>) => boolean
validator: (args: Array<unknown>) => boolean,
) {
if (!this._calls.has(object)) {
this._calls.set(object, [])
Expand Down Expand Up @@ -416,15 +416,15 @@ class Walker {
path.node.property.type === "Identifier"
? path.node.property.name
: path.node.property.type === "Literal" &&
typeof path.node.property.value === "string"
? path.node.property.value
: undefined
typeof path.node.property.value === "string"
? path.node.property.value
: undefined
if (!property) return

// Static members (e.g. `Object.assign`)
if (state._members.has(path.node.object.name)) {
const [prop, module] = state._members.get(
path.node.object.name
path.node.object.name,
)
if (property === prop) {
state._modules.push(module)
Expand Down Expand Up @@ -463,7 +463,7 @@ export function filterModules(modules: readonly string[], ast: any) {
scope: true,
},
}),
walker
walker,
)
return [...new Set(walker._modules)]
}
4 changes: 2 additions & 2 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type CoreJSPluginOptions = Partial<
}

export function corejsPlugin(
options: CoreJSPluginOptions = { modules: "core-js/es" }
options: CoreJSPluginOptions = { modules: "core-js/es" },
) {
const config: CoreJSPluginOptions = {
modules: options.modules,
Expand Down Expand Up @@ -58,7 +58,7 @@ export function corejsPlugin(
list = filterModules(list, ast)
}
const polyfills = list.map(
(p) => `import 'core-js/modules/${p}.js';`
(p) => `import 'core-js/modules/${p}.js';`,
)

const magicString = new MagicString(code)
Expand Down

0 comments on commit fbad588

Please sign in to comment.