paperclip-lint

raw JSON →
0.0.8 verified Fri May 01 auth: no javascript

A command-line utility and JavaScript library for linting Paperclip templates to ensure cross-browser compatibility. Version 0.0.8 is the latest stable release, though the package appears to have no recent updates. It provides both CLI (`pclint`) and programmatic usage via `require('paperclip-lint')`. Key differentiators: specifically designed for Paperclip templates, which are used with the Paperclip frontend framework. It outputs warnings and errors to help developers avoid browser-specific issues.

error Cannot find module 'paperclip-lint'
cause Package not installed or missing from node_modules.
fix
Run npm install paperclip-lint
error paperclip-lint is not a function
cause Incorrect import (e.g., named import when default expected).
fix
Use const pclint = require('paperclip-lint'); instead of { pclint }.
gotcha Package has not been updated in years; might not support modern JavaScript or Node versions.
fix Consider using an alternative linter or fork if needed.
gotcha The package expects Paperclip templates; using it with other template engines will produce false positives/negatives.
fix Ensure input is a valid Paperclip template string.
npm install paperclip-lint
yarn add paperclip-lint
pnpm add paperclip-lint

Shows how to use paperclip-lint programmatically to check a template string and access warnings and errors.

const pclint = require('paperclip-lint');
const template = '<div>{{foo}}</div>';
const report = pclint(template);
console.log('Warnings:', report.warnings);
console.log('Errors:', report.errors);