diff --git a/misc_docs/syntax/decorator_expression_warning.mdx b/misc_docs/syntax/decorator_expression_warning.mdx new file mode 100644 index 000000000..6c9476bf6 --- /dev/null +++ b/misc_docs/syntax/decorator_expression_warning.mdx @@ -0,0 +1,35 @@ +--- +id: "expression-warning-decorator" +keywords: ["warning", "decorator"] +name: "@warning" +summary: "This is the `@warning` decorator." +category: "decorators" +--- + +The `@warning` decorator is used to selectively enable or disable compiler warnings for _expressions_. + +See the `@@warning` decorator to control warnings for _modules_. + +### Example + + + +```res +// Disable warning 32 (unused value) +@warning("-32") +let result = Ok() +let result = Error() +``` + +```js +var result = { + TAG: /* Error */ 1, + _0: undefined, +}; +``` + + + +### References + +* [Build configuration warnings](/docs/manual/latest/build-configuration#warnings) \ No newline at end of file diff --git a/misc_docs/syntax/decorator_module_warning.mdx b/misc_docs/syntax/decorator_module_warning.mdx new file mode 100644 index 000000000..43bab945e --- /dev/null +++ b/misc_docs/syntax/decorator_module_warning.mdx @@ -0,0 +1,32 @@ +--- +id: "module-warning-decorator" +keywords: ["warning", "decorator"] +name: "@@warning" +summary: "This is the `@@warning` decorator." +category: "decorators" +--- + +The `@@warning` decorator is used to selectively enable or disable compiler warnings for _modules_. + +See the `@warning` decorator to control warnings for _expressions_. + +### Example + + + +```res +// Disable warning 44 +@@warning("-44") + +// Enable warning 44 and disable warning 102 +@@warning("+44-102") +``` + +```js +``` + + + +### References + +* [Build configuration warnings](/docs/manual/latest/build-configuration#warnings) \ No newline at end of file