Skip to content

Commit

Permalink
test: named exports without default for better devex
Browse files Browse the repository at this point in the history
  • Loading branch information
junners committed Jan 26, 2025
1 parent d6ea360 commit 64e9dd6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .swcrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://swc.rs/schema.json",
"sourceMaps": "inline",
"module": {
"type": "commonjs",
"type": "es6",
"strictMode": true,
"noInterop": false
},
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "lightning-flow-scanner-core",
"version": "4.11.3",
"main": "out/index.js",
"main": "index.js",
"types": "index.d.ts",
"engines": {
"node": "^20 || ^22 || ^23"
},
"type":"module",
"scripts": {
"test": "jest",
"test:cov": "jest --coverage",
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import {
FlowVariable,
} from "./main/models";
import { FixFlows, GetRuleDefinitions, ParseFlows, ScanFlows, Compiler } from "./main/libs";
import { IRulesConfig, IRuleDefinition } from "./main/interfaces";
import * as interfaces from "./main/interfaces";

function getRules(ruleNames?: string[]): IRuleDefinition[] {
function getRules(ruleNames?: string[]): interfaces.IRuleDefinition[] {
if (ruleNames && ruleNames.length > 0) {
const ruleSeverityMap = new Map<string, string>(ruleNames.map((name) => [name, "error"]));
return GetRuleDefinitions(ruleSeverityMap);
Expand All @@ -28,7 +28,7 @@ function parse(selectedUris: any): Promise<ParsedFlow[]> {
return ParseFlows(selectedUris);
}

function scan(parsedFlows: ParsedFlow[], ruleOptions?: IRulesConfig): ScanResult[] {
function scan(parsedFlows: ParsedFlow[], ruleOptions?: interfaces.IRulesConfig): ScanResult[] {
const flows: Flow[] = [];
for (const flow of parsedFlows) {
if (!flow.errorMessage && flow.flow) {
Expand Down Expand Up @@ -84,6 +84,7 @@ function fix(results: ScanResult[]): ScanResult[] {
return newResults;
}

export import IRuleDefinition = interfaces.IRuleDefinition;
export {
Flow,
ParsedFlow,
Expand All @@ -101,5 +102,4 @@ export {
parse,
scan,
fix,
IRuleDefinition,
};

0 comments on commit 64e9dd6

Please sign in to comment.