周报@2023-03-27

又学到了,nginx add_header directive 使用中遇到的问题。如何关闭 WebStorm 变量类型提示。

add_header

http://nginx.org/en/docs/http/ngx_http_headers_module.html#add_header

Adds the specified field to a response header provided that the response code equals 200, 201 (1.3.10), 204, 206, 301, 302, 303, 304, 307 (1.1.16, 1.0.13), or 308 (1.13.0). Parameter value can contain variables.

There could be several add_header directives. These directives are inherited from the previous configuration level if and only if there are no add_header directives defined on the current level.

If the always parameter is specified (1.7.5), the header field will be added regardless of the response code.

nginx
1add_header 'Access-Control-Allow-Origin' * always;

WebStorm 的变量后面显示类型,如果类型很长很碍眼

如何关闭 WebStorm 变量类型提示?
点击 "Editor" 下的 "Inlay Hints",然后在右侧点击 Types,Typescript 取消 Variables and fields 复选框。