@herb-tools/formatter 0.8.1 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/formatter.ts CHANGED
@@ -2,13 +2,13 @@ import { FormatPrinter } from "./format-printer.js"
2
2
 
3
3
  import { isScaffoldTemplate } from "./scaffold-template-detector.js"
4
4
  import { resolveFormatOptions } from "./options.js"
5
+ import { hasFormatterIgnoreDirective } from "./format-ignore.js"
5
6
 
6
7
  import type { Config } from "@herb-tools/config"
7
8
  import type { RewriteContext } from "@herb-tools/rewriter"
8
9
  import type { HerbBackend, ParseResult } from "@herb-tools/core"
9
10
  import type { FormatOptions } from "./options.js"
10
11
 
11
-
12
12
  /**
13
13
  * Formatter uses a Herb Backend to parse the source and then
14
14
  * formats the resulting AST into a well-indented, wrapped string.
@@ -61,6 +61,7 @@ export class Formatter {
61
61
 
62
62
  if (result.failed) return source
63
63
  if (isScaffoldTemplate(result)) return source
64
+ if (hasFormatterIgnoreDirective(result.value)) return source
64
65
 
65
66
  const resolvedOptions = resolveFormatOptions({ ...this.options, ...options })
66
67