|
| 1 | +<p align="center"> |
| 2 | + <a href="https://github.com/Flow-Scanner"> |
| 3 | + <img src="media/bannerslim.png" style="width: 41%;" /> |
| 4 | + </a> |
| 5 | +</p> |
| 6 | +<p align="center"><i>Detect unsafe contexts, queries in loops, hardcoded IDs, and more to optimize Salesforce Flows</i></p> |
| 7 | + |
| 8 | +<p align="center"> |
| 9 | + <img src="media/demo.gif" alt="Flow Overview"/> |
| 10 | +</p> |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +## Table of contents |
| 15 | + |
| 16 | +- **[Usage](#usage)** |
| 17 | +- **[Configuration](#configuration)** |
| 18 | + - [Scanner Options](#scanner-options) |
| 19 | + - [Extension Settings](#extension-settings) |
| 20 | +- **[Installation](#installation)** |
| 21 | +- **[Development](#development)** |
| 22 | + |
| 23 | +--- |
| 24 | + |
| 25 | +## Usage |
| 26 | + |
| 27 | + |
| 28 | +Lightning Flow Scanner VSX is plug-and-play. Open any project with flows and use our side bar or the **Command Palette** and type `flowscanner` to see the list of all available commands. |
| 29 | + |
| 30 | +* `Configure Flow Scanner` - Set up rules in `.flow-scanner.yml` |
| 31 | +* `Scan Flows` - Analyze a directory or selected flow files |
| 32 | +* `Fix Flows` - Automatically apply available fixes |
| 33 | +* `Flow Scanner Documentation` - Open the rules reference guide |
| 34 | + |
| 35 | +**Privacy:** Zero user data collected. All processing is client-side. → See our [Security Policy](https://github.com/Flow-Scanner/lightning-flow-scanner-vsx?tab=security-ov-file). |
| 36 | + |
| 37 | +--- |
| 38 | + |
| 39 | +## Configuration |
| 40 | + |
| 41 | +It is recommended to set up a `.flow-scanner.yml` and define: |
| 42 | + |
| 43 | +- The rules to be executed. |
| 44 | +- The severity of violating any specific rule. |
| 45 | +- Rule properties such as REGEX expressions. |
| 46 | +- Any known exceptions that should be ignored during scanning. |
| 47 | + |
| 48 | +### Scanner Options |
| 49 | + |
| 50 | +```json |
| 51 | +{ |
| 52 | + "rules": { |
| 53 | + // Your rules here |
| 54 | + }, |
| 55 | + "exceptions": { |
| 56 | + // Your exceptions here |
| 57 | + }, |
| 58 | + "betamode": false // Enable beta rules |
| 59 | +} |
| 60 | +``` |
| 61 | + |
| 62 | +Using the rules section of your configurations, you can specify the list of rules to be run. Furthermore, you can define the severity and configure expressions of rules. Below is a breakdown of the available attributes of rule configuration: |
| 63 | + |
| 64 | +```json |
| 65 | +{ |
| 66 | + "rules": { |
| 67 | + "<RuleName>": { |
| 68 | + "severity": "<Severity>", |
| 69 | + "expression": "<Expression>" |
| 70 | + } |
| 71 | + } |
| 72 | +} |
| 73 | +``` |
| 74 | + |
| 75 | +Note: if you prefer JSON format, you can create a `.flow-scanner.json` file using the same format. For a more on configurations, review the [scanner documentation](https://flow-scanner.github.io/lightning-flow-scanner-core/#configuration). |
| 76 | + |
| 77 | +### Extension Settings |
| 78 | + |
| 79 | +| Extension Settings | Description | Default Value | |
| 80 | +| ---------------------------- | ------------------------------------------------------------------- | ------------- | |
| 81 | +| `flowscanner.SpecifyFiles` | Set to true to select .Flow file paths instead of a root directory. | `true` | |
| 82 | + |
| 83 | +--- |
| 84 | + |
| 85 | +## Installation |
| 86 | + |
| 87 | +`lightning-flow-scanner-vsx` is available on: |
| 88 | + |
| 89 | +| Visual Studio Marketplace | Open VSX Registry | |
| 90 | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | |
| 91 | +| [](https://marketplace.visualstudio.com/items?itemName=ForceConfigControl.lightning-flow-scanner-vsx) | [](https://open-vsx.org/extension/ForceConfigControl/lightning-flow-scanner-vsx) | |
| 92 | + |
| 93 | +To install via CLI (VS Code) |
| 94 | + |
| 95 | +```bash |
| 96 | +code --install-extension ForceConfigControl.lightning-flow-scanner-vsx |
| 97 | +``` |
| 98 | + |
| 99 | +--- |
| 100 | + |
| 101 | +## Development |
| 102 | + |
| 103 | +> This project optionally uses [Volta](https://volta.sh) to manage Node.js versions. Install Volta with: |
| 104 | +> |
| 105 | +> ```sh |
| 106 | +> curl https://get.volta.sh | bash |
| 107 | +> ``` |
| 108 | +> |
| 109 | +> Volta will automatically use the Node.js version defined in `package.json`. |
| 110 | +
|
| 111 | +1. **Clone the repository** |
| 112 | +
|
| 113 | +```bash |
| 114 | + git clone https://github.com/Flow-Scanner/lightning-flow-scanner-vsx.git |
| 115 | +``` |
| 116 | +
|
| 117 | +2. **Install dependencies** |
| 118 | + |
| 119 | +```bash |
| 120 | + npm install |
| 121 | +``` |
| 122 | + |
| 123 | +3. **Compile a new version** |
| 124 | + |
| 125 | +```bash |
| 126 | + npm run build |
| 127 | +``` |
| 128 | + |
| 129 | +4. **Auto-compile new changes** |
| 130 | + |
| 131 | +```bash |
| 132 | + npm run watch |
| 133 | +``` |
| 134 | + |
| 135 | +5. **Run end-to-end tests** |
| 136 | + |
| 137 | +```bash |
| 138 | + npm run test |
| 139 | +``` |
| 140 | + |
| 141 | +6. **Linking** **Core Module (Optional)** |
| 142 | + |
| 143 | +If you’re developing or testing updates to the core module, you can link it locally: |
| 144 | + |
| 145 | +- In the core module directory, run: |
| 146 | + ```bash |
| 147 | + npm run link |
| 148 | + ``` |
| 149 | +- In this CLI project directory, run: |
| 150 | + ```bash |
| 151 | + npm link @flow-scanner/lightning-flow-scanner-core |
| 152 | + ``` |
| 153 | + |
| 154 | +--- |
| 155 | + |
| 156 | +## VSCE to VSX |
| 157 | + |
| 158 | +`lightning-flow-scanner-vsce` was unpublished from the Visual Studio and Open VSX Marketplaces due to a vulnerability stemming from unsafe rule loading. The issue was addressed in [core v5](https://github.com/Flow-Scanner/lightning-flow-scanner-core/releases/tag/v5.1.0). This fork, created on 22/09/2025, emphasizes security and maintainability. |
| 159 | + |
| 160 | +<p><strong>Want to help improve Lightning Flow Scanner? See our <a href="https://github.com/Flow-Scanner/lightning-flow-scanner-core?tab=contributing-ov-file">Contributing Guidelines</a></strong></p> |
0 commit comments