Skill update round trip / roundtrip (false, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, latest) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
30 lines
734 B
JavaScript
30 lines
734 B
JavaScript
const MESSAGE =
|
|
"qrcode is only reachable from mobile pairing. Use `import type` plus `await import('qrcode')` so startup does not parse its bundle."
|
|
|
|
function hasRuntimeImport(node) {
|
|
if (node.importKind === 'type') {
|
|
return false
|
|
}
|
|
return (
|
|
node.specifiers.length === 0 ||
|
|
node.specifiers.some((specifier) => specifier.importKind !== 'type')
|
|
)
|
|
}
|
|
|
|
export default {
|
|
meta: { name: 'mobile-pairing' },
|
|
rules: {
|
|
'no-eager-qrcode-import': {
|
|
create(context) {
|
|
return {
|
|
ImportDeclaration(node) {
|
|
if (node.source?.value === 'qrcode' && hasRuntimeImport(node)) {
|
|
context.report({ node, message: MESSAGE })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|