License detector for UglifyJS that identifies and preserves license comments during minification
Overall
score
98%
{
"context": "This evaluation assesses how effectively the engineer uses the uglify-save-license package to preserve first-line comments during JavaScript minification. The focus is on proper integration of the package's comment detection callback with UglifyJS to achieve the specified first-line preservation behavior.",
"type": "weighted_checklist",
"checklist": [
{
"name": "uglify-save-license import",
"description": "The solution imports or requires the uglify-save-license package (e.g., `require('uglify-save-license')` or `import saveLicense from 'uglify-save-license'`).",
"max_score": 15
},
{
"name": "uglify-js import",
"description": "The solution imports or requires the uglify-js package to perform minification (e.g., `require('uglify-js')` or `import UglifyJS from 'uglify-js'`).",
"max_score": 10
},
{
"name": "Comment callback integration",
"description": "The solution passes the uglify-save-license function as the comments option to UglifyJS (e.g., `output: { comments: saveLicense }` or `output.comments = saveLicense` in the minify options).",
"max_score": 30
},
{
"name": "UglifyJS.minify usage",
"description": "The solution uses UglifyJS.minify() function to perform the actual minification of the source code.",
"max_score": 15
},
{
"name": "First-line preservation",
"description": "The implementation correctly preserves comments that appear on line 1 of the source code, as demonstrated by test cases or verified behavior.",
"max_score": 20
},
{
"name": "Handles both comment types",
"description": "The solution correctly handles both line comments (`//`) and block comments (`/* */`) on the first line, preserving either type appropriately.",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-uglify-save-licensedocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10