Prettier Quickapp Plugin
raw JSON → 0.3.0 verified Sat Apr 25 auth: no javascript
Prettier plugin for formatting QuickApp (.ux) files, version 0.3.0. It integrates with Prettier to provide a universal interface for code formatting, supporting JS, CSS, Less, Sass, and Markdown within QuickApp projects. The plugin is specifically designed for the QuickApp platform (快应用), offering a common style guide for teams and helping identify potential code issues. It requires Prettier as a peer dependency and is compatible with Node.js >= 8.0.0. The plugin is maintained by nicejade and has a low release cadence with limited community adoption.
Common errors
error Cannot find module 'prettier' ↓
cause Prettier is not installed.
fix
Run: yarn add --dev prettier
error No parser could be inferred for file: example.ux ↓
cause Plugin not installed or not detected by Prettier.
fix
Ensure prettier-plugin-ux is installed in the same project as prettier.
error Error: Invalid configuration file: prettier ↓
cause Prettier options used incorrectly in package.json.
fix
Place prettier configuration under a "prettier" key in package.json (e.g., { "prettier": { "singleQuote": true } })
Warnings
gotcha Plugin requires Prettier to be installed separately. ↓
fix Install prettier as a dev dependency: yarn add --dev prettier
gotcha The plugin is auto-discovered by Prettier when installed in the same project. No manual configuration is needed. ↓
fix Simply install the plugin alongside Prettier.
gotcha Only supports .ux files; other file types are ignored. ↓
fix Ensure file extension is .ux when running prettier.
deprecated Node.js >= 8.0.0 required; older versions are not supported. ↓
fix Upgrade Node.js to version 8.0.0 or higher.
Install
npm install prettier-plugin-ux yarn add prettier-plugin-ux pnpm add prettier-plugin-ux Imports
- default wrong
import prettier from 'prettier';correctconst prettier = require('prettier'); require('prettier-plugin-ux');
Quickstart
// Install
yarn add --dev --exact prettier prettier-plugin-ux
// Format all .ux files
npx prettier --write "**/*.ux"
// In package.json scripts
"prettier": "prettier --write 'src/**/*.js' 'src/**/*.ux'"
// Optional: watch with onchange
"prettier-watch": "onchange '**/*.md' 'src/**/*.js' 'src/**/*.ux' -- prettier --write {{changed}}"