Prettier plugin for CFML (ColdFusion Markup Language)
npm install prettier-plugin-cfml tags
bash
npm install --save-dev prettier-plugin-cfml
`
$3
1. Install the Prettier extension
2. Install this plugin via npm in your project
3. Configure VS Code settings:
`json
{
"prettier.documentSelectors": ["/.cfm", "/.cfc", "*/.cfml"],
"[cfml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
`
Configuration
Add to your .prettierrc:
`json
{
"cfmlTabWidth": 2,
"cfmlSingleQuote": false,
"cfmlInlineThreshold": 40,
"cfmlPreserveSQL": true,
"plugins": ["prettier-plugin-cfml"]
}
`
$3
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| cfmlTabWidth | integer | 2 | Spaces per indentation level |
| cfmlSingleQuote | boolean | false | Use single quotes in attributes |
| cfmlInlineThreshold | integer | 40 | Max characters for inline tags |
| cfmlPreserveSQL | boolean | true | Format SQL in tags |
Examples
$3
`cfml
SELECT firstName,lastName,email FROM users
WHERE active=1
Welcome #user.name#
`
$3
`cfml
SELECT firstName, lastName, email
FROM users
WHERE active = 1
Welcome #user.name#
`
Supported File Types
- .cfm - ColdFusion pages
- .cfc - ColdFusion components
- .cfml - General CFML files
Development
`bash
Install dependencies
npm install
Build
npm run build
Test
npm test
Development mode
npm run dev
``