Registry / devops / xcx-lint-qts

xcx-lint-qts

JSON →
library2.2.13jsnpmunverified

A lint tool for mini-program (小程序) code that automatically injects tracking points (ptpid) into XML templates for WeChat (wx) and Alipay mini-programs. Version 2.2.13 is current, released with moderate cadence. It traverses XML files, generates globally unique point IDs, and optionally generates documentation (Excel, JSON, or online wiki). Key differentiators: tightly integrated with mini-program ecosystem, supports lazy-load image injection, and offers both CLI and JavaScript API for parsing. Compared to general lint tools, it specifically solves business requirement of auto-embedding tracking identifiers into UI components.

npm install xcx-lint-qts
INSTALL
IMPORT
SIG · XCX-LINT-QTS
X
xcx-lint-qts
devopsjavascriptv2.2.13
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

parseList
const { parseList } = require('xcx-lint-qts')
import { parseList } from 'xcx-lint-qts'
Package is CommonJS, not ESM. Default import does not work.
parseFile
const { parseFile } = require('xcx-lint-qts')
const parseFile = require('xcx-lint-qts').parseFile
Same as parseList, require destructuring is canonical.
main module
const xcx = require('xcx-lint-qts')
import xcx from 'xcx-lint-qts'
No default export. Module exports an object with parseList and parseFile.

Demonstrates both CLI command for linting and programmatic use of parseList with options.

// CLI usage: in mini-project root, run // qts-lint lint wx // or programmatically: const { parseList } = require('xcx-lint-qts'); const path = require('path'); const files = [ path.resolve('./pages/index/index.xml'), path.resolve('./pages/login/login.xml') ]; parseList(files, { type: 'wx', docs: true, root: process.cwd(), docsRoot: 'root' }); console.log('Tracking points injected and docs generated.');
Debug
Known issues
gotchaPackage is CommonJS only; does not support ESM imports. Use require() not import.
fix
Use const { parseList, parseFile } = require('xcx-lint-qts')
affects: all
gotchaparseList expects absolute file paths; relative paths require options.root to be set, or it prints a warning.
fix
Always pass absolute paths or provide options.root with the project root directory.
affects: all
gotchaThe CLI does not support combining --lazy-load with doc generation flags in certain versions; check order.
fix
Ensure --lazy-load is placed before --docs or -c flags.
affects: <2.2.0
deprecatedOption `online` for --docs is deprecated; prefer using json or omit for Excel.
fix
Use `-c json` for JSON output or omit `-c` for default Excel.
affects: >=2.2.0
Errors
Common errors & fixes
Error: Cannot find module 'xcx-lint-qts'
Package not installed globally or locally.
fix
Run `npm i -g xcx-lint-qts` for global CLI, or `npm install xcx-lint-qts` for local project.
TypeError: parseList is not a function
Incorrect import style (ESM import used on CommonJS module).
fix
Use `const { parseList } = require('xcx-lint-qts')` instead of `import { parseList } from 'xcx-lint-qts'`.
Warning: files paths are not absolute, please pass options.root
Relative file paths provided without setting options.root.
fix
Set `options.root` to the project root directory or convert file paths to absolute using `path.resolve()`.
Upgrade
Version history
2.2.13latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
21 hits · last 30 days
node
20
Resources
xcx-lint-qts — npm install xcx-lint-qts · libregistry