diff --git a/package.json b/package.json index 7387f882..b55786c2 100644 --- a/package.json +++ b/package.json @@ -124,6 +124,11 @@ "default": false, "markdownDescription": "Collapses multiple blank lines into a single blank line" }, + "bladeFormatter.format.noPhpSyntaxCheck": { + "type": "boolean", + "default": false, + "markdownDescription": "Disable PHP syntax check. Enabling this will prevent syntax error reporting even if you write invalid PHP syntax in the Directive." + }, "bladeFormatter.misc.dontShowNewVersionMessage": { "type": "boolean", "default": false, diff --git a/src/extension.ts b/src/extension.ts index 33198885..b1490426 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -98,6 +98,7 @@ export function activate(context: ExtensionContext) { sortTailwindcssClasses: extConfig.sortTailwindcssClasses, sortHtmlAttributes: extConfig.sortHtmlAttributes ?? 'none', noMultipleEmptyLines: extConfig.noMultipleEmptyLines, + noPhpSyntaxCheck: extConfig.noPhpSyntaxCheck, ...runtimeConfig, // override all settings by runtime config ...tailwindConfig, }; diff --git a/src/runtimeConfig.ts b/src/runtimeConfig.ts index 7e1b6e2c..4cbdae29 100644 --- a/src/runtimeConfig.ts +++ b/src/runtimeConfig.ts @@ -24,6 +24,7 @@ export interface RuntimeConfig { sortHtmlAttributes?: string; tailwindcssConfigPath?: string; noMultipleEmptyLines?: boolean; + noPhpSyntaxCheck?: boolean; } const configFileNames = [".bladeformatterrc.json", ".bladeformatterrc"]; @@ -58,6 +59,7 @@ export function readRuntimeConfig(filePath: string): RuntimeConfig | undefined { sortHtmlAttributes: { type: 'string' }, tailwindcssConfigPath: { type: 'string' }, noMultipleEmptyLines: { type: 'boolean' }, + noPhpSyntaxCheck: { type: 'boolean' }, }, additionalProperties: true, };