docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
{
"context": "This criteria evaluates how effectively the engineer uses the cjs-module-lexer package to analyze CommonJS modules. The focus is on proper usage of the package's parse() function and correct handling of its initialization API and output format.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Import package",
"description": "Uses require() to import the cjs-module-lexer package (e.g., const { parse, init } = require('cjs-module-lexer'))",
"max_score": 10
},
{
"name": "Call init()",
"description": "Calls the init() or initSync() function before using parse(), since the API requires initialization",
"max_score": 15
},
{
"name": "Use parse() function",
"description": "Uses the parse() function to analyze the source code, passing the source code string as the first argument",
"max_score": 25
},
{
"name": "Extract exports array",
"description": "Correctly extracts the exports array from the parse() function's return value (e.g., const { exports } = parse(sourceCode))",
"max_score": 20
},
{
"name": "Extract reexports array",
"description": "Correctly extracts the reexports array from the parse() function's return value (e.g., const { reexports } = parse(sourceCode))",
"max_score": 20
},
{
"name": "Handle errors",
"description": "Properly handles potential errors from parse() using try-catch or similar error handling mechanisms",
"max_score": 10
}
]
}