@@ -21999,7 +21999,7 @@ val no_builtin_ppx_ml : bool ref
2199921999val no_builtin_ppx_mli : bool ref
2200022000val no_warn_ffi_type : bool ref
2200122001val no_warn_unused_bs_attribute : bool ref
22002-
22002+ val no_error_unused_bs_attribute : bool ref
2200322003(** check-div-by-zero option *)
2200422004val check_div_by_zero : bool ref
2200522005val get_check_div_by_zero : unit -> bool
@@ -22241,7 +22241,7 @@ let no_warn_ffi_type = ref false
2224122241
2224222242(** TODO: will flip the option when it is ready *)
2224322243let no_warn_unused_bs_attribute = ref false
22244-
22244+ let no_error_unused_bs_attribute = ref false
2224522245
2224622246let builtin_exceptions = "Caml_builtin_exceptions"
2224722247let exceptions = "Caml_exceptions"
@@ -22388,7 +22388,7 @@ type error =
2238822388 | Bs_package_not_found of string
2238922389 | Bs_main_not_exist of string
2239022390 | Bs_invalid_path of string
22391-
22391+ (** TODO: we need add location handling *)
2239222392exception Error of error
2239322393
2239422394let error err = raise (Error err)
@@ -25932,8 +25932,14 @@ let prerr_warning loc x =
2593225932 print_string_warning loc (to_string x)
2593325933
2593425934let warn_unused_attribute loc txt =
25935- print_string_warning loc ( Literals.unused_attribute ^ txt ^ " \n" );
25936- Format.pp_print_flush warning_formatter ()
25935+ if !Js_config.no_error_unused_bs_attribute then
25936+ begin
25937+ print_string_warning loc ( Literals.unused_attribute ^ txt ^ " \n" );
25938+ Format.pp_print_flush warning_formatter ()
25939+ end
25940+ else
25941+ Location.raise_errorf
25942+ ~loc "%s%s \n" Literals.unused_attribute txt
2593725943
2593825944end
2593925945module Bs_ast_invariant
@@ -106320,6 +106326,14 @@ let buckle_script_flags =
106320106326 Arg.String set_eval_string,
106321106327 " (experimental) Set the string to be evaluated, note this flag will be conflicted with -bs-main"
106322106328 )
106329+ ::("-bs-no-error-unused-attribute",
106330+ Arg.Set Js_config.no_error_unused_bs_attribute,
106331+ " No error when seeing unused attribute"
106332+ (* We introduce such flag mostly
106333+ for work around
106334+ in case some embarassing compiler bugs
106335+ *)
106336+ )
106323106337 ::
106324106338 (
106325106339 "-bs-sort-imports",
0 commit comments