{"id":305246,"date":"2020-06-11T21:00:33","date_gmt":"2020-06-11T21:00:33","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=305246"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=305246","title":{"rendered":"\u0427\u0442\u043e \u043e\u0431\u0449\u0435\u0433\u043e \u043c\u0435\u0436\u0434\u0443 Putout \u0438 Rulegurd?"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/506234\/\">\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 <a href=\"https:\/\/habr.com\/en\/post\/481696\/\">\u0441\u0442\u0430\u0442\u044c\u044e<\/a> \u043f\u0440\u043e <a href=\"https:\/\/github.com\/quasilyte\/go-ruleguard\/\" rel=\"nofollow\">\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 Ruleguard<\/a> \u0438 \u0445\u043e\u0442\u0435\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a \u043d\u0435\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439, \u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0441\u0442\u0430\u0442\u044c\u044f.<\/p>\n<p>  <\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0447\u0442\u043e \u043f\u043e\u0445\u043e\u0436\u0438\u0435 \u0438\u0434\u0435\u0438 \u043c\u043e\u0433\u0443\u0442 \u0432 \u043e\u0434\u043d\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0438\u0439\u0442\u0438 \u0440\u0430\u0437\u043d\u044b\u043c \u043b\u044e\u0434\u044f\u043c, \u043f\u0438\u0448\u0443\u0449\u0438\u043c \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445. \u042f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u043d\u0430\u0434 <a href=\"https:\/\/habr.com\/en\/post\/504594\/\">\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c<\/a> <a href=\"https:\/\/github.com\/coderaiser\/putout\" rel=\"nofollow\">Putout<\/a>, \u0438 \u043e\u0431\u0440\u0430\u0442\u0438\u043b \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0432 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0445 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 <code>JavaScript<\/code> \u0438 <code>Go<\/code>, \u044f\u0437\u044b\u043a\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0437\u043d\u0430\u044e, \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0441\u0445\u043e\u0436\u0435\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432, \u043d\u0435 \u043c\u043e\u0433\u043b\u0430 \u043d\u0435 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0443 \u043c\u0435\u043d\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441.<\/p>\n<p>  <\/p>\n<p>\u0410 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0432\u0430\u0441 \u0436\u0434\u0435\u0442 \u043e\u043f\u0440\u043e\u0441 :).<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"vremya-zhizni\">\u0412\u0440\u0435\u043c\u044f \u0436\u0438\u0437\u043d\u0438<\/h2>\n<p>  <\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0445\u0440\u043e\u043d\u043e\u043b\u043e\u0433\u0438\u044e:<\/p>\n<p>  <\/p>\n<ul>\n<li>30.11.2018 \u2014 <a href=\"https:\/\/github.com\/coderaiser\/putout\/commit\/12d8fe164f2c991391596579c5a24d400a7d69f7\" rel=\"nofollow\">\u043f\u0435\u0440\u0432\u044b\u0439 \u043a\u043e\u043c\u043c\u0438\u0442 Putout<\/a> <\/li>\n<li>12.12.2019 \u2014 <a href=\"https:\/\/github.com\/quasilyte\/go-ruleguard\/commit\/28262423d199e704e3b345e2f535e65b693a3b7b\" rel=\"nofollow\">\u043f\u0435\u0440\u0432\u044b\u0439 \u043a\u043e\u043c\u043c\u0438\u0442 Ruleguard<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 Putout \u043d\u0430\u0447\u0430\u043b\u0430\u0441\u044c \u043d\u0430 \u0433\u043e\u0434 \u0440\u0430\u043d\u044c\u0448\u0435 Ruleguard, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f, \u043d\u0430\u0446\u0435\u043b\u0435\u043d\u044b \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u0445\u043e\u0436\u0435\u0441\u0442\u0438 \u0438 \u043e\u0442\u043b\u0438\u0447\u0438\u044f, \u043d\u043e \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0438 \u043e\u0431\u0438\u043b\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430.<\/p>\n<p>  <\/p>\n<h2 id=\"pravila\">\u041f\u0440\u0430\u0432\u0438\u043b\u0430<\/h2>\n<p>  <\/p>\n<p>\u0421\u0440\u0430\u0432\u043d\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <code>!!x<\/code> \u0434\u043e <code>x<\/code>.<br \/>  \u0414\u043b\u044f <code>ruleguard<\/code>, <a href=\"https:\/\/github.com\/quasilyte\/go-ruleguard\/blob\/master\/docs\/gorules.md\" rel=\"nofollow\">\u043a\u043e\u0434<\/a> \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"go\">package gorules  import &quot;github.com\/quasilyte\/go-ruleguard\/dsl\/fluent&quot;  func simplify(m fluent.Matcher) {     m.Match(`!!$x`)      .Suggest(`$x`)      .Report(`can simplify !!$x to $x`) }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410 \u0432\u043e\u0442 (\u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u044b\u0439 \u0438 \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439) \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 putout <a href=\"https:\/\/github.com\/coderaiser\/putout\/tree\/master\/packages\/plugin-remove-double-negations\" rel=\"nofollow\">remove-double-negations<\/a>:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">module.exports.report = () =&gt; 'can simplify !!x to x'; module.exports.replace = () =&gt; ({     '!!__x': '__x' });<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e <code>ruleguard<\/code>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <code>$x<\/code> \u0434\u043b\u044f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 (<em>\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f Report \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>$x<\/code><\/em>), \u0430 putout, \u0434\u043b\u044f \u0442\u043e\u0439 \u0436\u0435 \u0446\u0435\u043b\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u0432\u043e\u0439\u043d\u043e\u0435 \u043d\u0438\u0436\u043d\u0435\u0435 \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u0438\u0432\u0430\u043d\u0438\u0435 __x. \u041f\u043e\u0447\u0435\u043c\u0443 \u0432 putout \u043d\u0435 \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d \u0441\u0438\u043c\u0432\u043e\u043b <code>$<\/code>? \u041e\u0434\u043d\u0430 \u0438\u0437 \u043f\u0440\u0438\u0447\u0438\u043d \u044d\u0442\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0445, (\u0445\u043e\u0442\u044c \u0438 \u043d\u0435 \u0447\u0430\u0441\u0442\u043e) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0432 <a href=\"https:\/\/jquery.com\/\" rel=\"nofollow\">\u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445<\/a>, \u0430 \u0435\u0449\u0435 \u043f\u043e\u0445\u043e\u0436\u0435\u0441\u0442\u044c \u043d\u0430 \u043e\u0434\u0438\u043d \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0433\u0434\u0435 \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441 \u044d\u0442\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430 :), \u0430 \u0442\u0430\u043a \u0436\u0435 \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u0432\u043e\u0439\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u0438\u0432\u0430\u043d\u0438\u044f. <a href=\"https:\/\/github.com\/coderaiser\/putout\/tree\/master\/packages\/compare#supported-template-variables\" rel=\"nofollow\">\u0422\u0443\u0442<\/a> \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445.<\/p>\n<p>  <\/p>\n<p>\u0421\u0443\u0434\u044f \u043f\u043e \u0432\u0441\u0435\u043c\u0443, \u0430\u0432\u0442\u043e\u0440 ruleguard \u0442\u043e\u0436\u0435 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b &#8216;__&#8217;, \u043d\u043e <a href=\"https:\/\/github.com\/quasilyte\/go-ruleguard\/blob\/a29d6cc795181132f4d775e4396187ce5f93751b\/ruleguard\/typematch\/typematch.go#L74\" rel=\"nofollow\">\u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u0442\u0434\u0430\u043b \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u043a\u0443 \u0434\u043e\u043b\u043b\u0430\u0440\u0430<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u0435\u0435.<\/p>\n<p>  <\/p>\n<h2 id=\"rabota-s-ast\">\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 AST<\/h2>\n<p>  <\/p>\n<p><a href=\"https:\/\/habr.com\/en\/post\/439564\/\">\u0412\u043d\u0430\u0447\u0430\u043b\u0435<\/a> \u043f\u0440\u0430\u0432\u0438\u043b\u0430 <code>putout<\/code>, \u043f\u0438\u0441\u0430\u043b\u0438\u0441\u044c \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e <code>AST<\/code> \u043f\u0430\u0440\u0441\u0438\u043b\u043e\u0441\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043a\u0430\u0436\u0434\u044b\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/\/ \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0438\u0437 \u043d\u0430\u0439\u0434\u0435\u043d\u044b\u0445 \u0443\u0437\u043b\u043e\u0432 module.exports.report = () =&gt; 'Unexpected &quot;debugger&quot; statement';  \/\/ \u0438\u0449\u0435\u043c \u0443\u0437\u043b\u044b, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435\u0439 debugger \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 Visitor module.exports.find = (ast, {traverse}) =&gt; {     const places = [];      traverse(ast, {         DebuggerStatement(path) {             places.push(path);         }     });      return places; };  \/\/ \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u043a\u043e\u0434, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0439 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0448\u0430\u0433\u0435 module.exports.fix = (path) =&gt; {     path.remove(); };<\/code><\/pre>\n<p>  <\/p>\n<p><a href=\"https:\/\/habr.com\/en\/post\/439564\/\">\u041a\u0430\u043a \u0432\u0435\u0440\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u043b<\/a> <a href=\"https:\/\/habr.com\/en\/users\/alternator\/\" class=\"user_link\">Alternator<\/a>:<\/p>\n<p>  <\/p>\n<blockquote><p>\u041a\u0430\u0436\u0434\u044b\u0439 \u043f\u043b\u0430\u0433\u0438\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u0432\u043e\u0439 <code>traverse<\/code>, \u0447\u0442\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u0447\u0435\u043c \u043e\u0434\u0438\u043d \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 <code>traverse<\/code>, \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0439 \u044f\u0434\u0440\u043e\u043c.<\/p><\/blockquote>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043e\u0431\u0445\u043e\u0434 \u0432\u0441\u0435\u0433\u043e AST (\u043f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438) <a href=\"https:\/\/github.com\/coderaiser\/putout\/tree\/v8.17.0\/packages\/engine-runner\" rel=\"nofollow\">\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0435\u0434\u0438\u043d\u043e\u0436\u0434\u044b<\/a>, \u043f\u043e\u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e \u0437\u0430\u0445\u043e\u0434\u044f \u0432 \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u044b (\u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 <a href=\"https:\/\/github.com\/coderaiser\/putout#built-in-transforms\" rel=\"nofollow\">60-\u0442\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430\u043c<\/a> \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0437\u0430 \u0432\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u0441\u0430\u043c\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u0432\u0438\u0434\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">module.exports.report = () =&gt; 'Unexpected &quot;debugger&quot; statement'; module.exports.replace = () =&gt; ({     'debugger': '', });<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0432 <code>ruleguard<\/code>, \u0441\u0443\u0434\u044f \u043f\u043e \u0432\u0441\u0435\u043c\u0443, \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 <code>Match<\/code> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0445\u043e\u0434 \u0432\u0441\u0435\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430, \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430 \u043a\u043e\u0434\u0430, <a href=\"https:\/\/habr.com\/en\/users\/quasilyte\/\" class=\"user_link\">quasilyte<\/a>, \u044d\u0442\u043e \u0442\u0430\u043a, \u0438\u043b\u0438 \u044f \u043d\u0435 \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u043f\u043e\u043d\u0438\u043c\u0430\u044e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c?<\/p>\n<p>  <\/p>\n<p>\u0415\u043b\u0438 \u044d\u0442\u043e \u0442\u0430\u043a, \u0442\u043e:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0434\u0430, \u044d\u0442\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e<\/li>\n<li>\u044d\u0442\u043e \u043d\u0435 \u0434\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0447\u0430\u0449\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u0443\u0437\u043b\u044b, \u043a\u0430\u043a (\u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437) \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f, \u0433\u0434\u0435 \u043e\u043d\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u044b (\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u044b \u043b\u0438), \u0432 \u043a\u0430\u043a\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0432 \u043f\u043b\u0430\u0433\u0438\u043d\u0435 <a href=\"https:\/\/github.com\/coderaiser\/putout\/blob\/v8.17.0\/packages\/plugin-convert-for-in-to-for-of\" rel=\"nofollow\">convert-for-in-to-for-of<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"diff\">-for (const name in object) { -   if (object.hasOwnProperty(name)) { +for (const name of Object.keys(object)) {     console.log(a); -   } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">const {     generate,     operator, } = require('putout');  const {     contains,     getTemplateValues, } = operator;  module.exports.report = () =&gt; `for-of should be used instead of for-in`;  \/\/ \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0443\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \/\/ \u0432\u0430\u0436\u043d\u043e \u0447\u0442\u043e \u0431\u044b for-in \u0438\u043c\u0435\u043b `hasOwnProperty` \/\/ \u0438\u043d\u0430\u0447\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f for-of \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438\u043d\u0430\u0447\u0435 module.exports.match = () =&gt; ({     'for (__a in __b) __body': ({__a, __b, __body}) =&gt; {         const declaration = getTemplateValues(__a, 'var __a');         const {name} = declaration.__a;          return contains(__body, [             `if (${__b.name}.hasOwnProperty(${name})) __body`,         ]);     }, });  \/\/ \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0437\u0430\u043c\u0435\u043d\u0443, \u0435\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0448\u043b\u0430 \u0444\u0438\u043b\u044c\u0442\u0440 module.exports.replace = () =&gt; ({     'for (__a in __b) __body': ({__b, __body}) =&gt; {         const [first] = __body.body;         const condition = getTemplateValues(first, 'if (__b.hasOwnProperty(__a)) __body');         const {code} = generate(condition.__body);          return `for (const ${condition.__a.name} of Object.keys(${__b.name})) ${code}`;     }, });<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432 <code>Go<\/code> \u043d\u0435\u0442 \u0442\u0430\u043a\u0438\u0445 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 (\u0442\u0430\u043c \u0434\u0440\u0443\u0433\u0438\u0435 \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 :)), \u043e\u0434\u043d\u0430\u043a\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0431\u044b \u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0431 \u0443\u0437\u043b\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0436\u043d\u0435\u0439, \u0438 \u043c\u043d\u0435 \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043a\u0430\u043a \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>Match<\/code> \u0438\u0437 <code>ruleguard<\/code>. \u041d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/quasilyte\/go-ruleguard\/blob\/v0.1.1\/docs\/gorules.md#filters\" rel=\"nofollow\">\u0444\u0438\u043b\u044c\u0442\u0440\u044b<\/a>, \u043d\u043e \u043e\u043d\u0438 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u0442\u0438\u043f\u0430\u043c\u0438. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u043d\u044f\u043b, \u043a\u0430\u043a \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c, \u043b\u0438\u0431\u043e \u044d\u0442\u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b (\u043d\u0430 \u0447\u0442\u043e \u044f \u043d\u0430\u0434\u0435\u044e\u0441\u044c) \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0432 \u043d\u043e\u0432\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 Ruleguard.<\/p>\n<p>  <\/p>\n<h2 id=\"plaginy\">\u041f\u043b\u0430\u0433\u0438\u043d\u044b<\/h2>\n<p>  <\/p>\n<p><code>Putout<\/code> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 5 \u0432\u0438\u0434\u043e\u0432 \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432:<\/p>\n<p>  <\/p>\n<ul>\n<li>@putout\/plugin-name \u2014 core-\u043f\u043b\u0430\u0433\u0438\u043d\u044b \u0438\u0437 \u043f\u0430\u043f\u043a\u0438 <code>node_modules<\/code><\/li>\n<li><code>putout-plugin-name<\/code> \u2014 <code>userland<\/code>-\u043f\u043b\u0430\u0433\u0438\u043d\u044b \u0438\u0437 <code>node_modules<\/code><\/li>\n<li><code>~\/.putout<\/code> \u2014 <code>codemods<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432<\/li>\n<li>\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u043b\u0430\u0433\u0430 <code>--rulesdir<\/code>, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0438\u0437 \u043f\u0430\u043f\u043a\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/li>\n<li>\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 <code>-t, --transform<\/code> <\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 <code>ruleguard<\/code> <a href=\"https:\/\/habr.com\/en\/users\/quasilyte\/\" class=\"user_link\">quasilyte<\/a> \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<p>  <\/p>\n<blockquote><p>\u041f\u0440\u0430\u0432\u0438\u043b\u0430 ruleguard \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435, \u0438\u0437 <a href=\"https:\/\/github.com\/quasilyte\/go-ruleguard\/blob\/v0.1.1\/rules.go\" rel=\"nofollow\">\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e gorules \u0444\u0430\u0439\u043b\u0430<\/a>, \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u043a\u043e\u0434\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u043e\u0438\u0442 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f. \u042d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u0435\u0442 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438 ruleguard.<\/p><\/blockquote>\n<p>\u0418 \u0432 \u044d\u0442\u043e\u043c \u0435\u0441\u0442\u044c \u043f\u043b\u044e\u0441 \u0438 \u043c\u0438\u043d\u0443\u0441:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u043f\u043b\u044e\u0441 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0443\u0434\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0434\u043b\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u0434\u0430;<\/li>\n<li>\u043c\u0438\u043d\u0443\u0441 \u2014 \u0432 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 (\u0444\u0430\u0439\u043b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043a \u0444\u0430\u0439\u043b\u0443 \u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b, \u0438 \u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043a\u0430\u043a \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445)<\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"komandnaya-stroka\">\u041a\u043e\u043c\u0430\u043d\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430<\/h2>\n<p>  <\/p>\n<p><a href=\"https:\/\/habr.com\/en\/post\/505652\/\">Gogrep<\/a> (\u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u0441\u043d\u043e\u0432\u0430\u043d Ruleguard) \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0438\u043b \u043c\u0435\u043d\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 Putout, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">putout --transform 'module.exports = __a -&gt; const cheers = __a' index.js<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u0449\u0435\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e <code>module.exports = __a<\/code>, \u0433\u0434\u0435 <code>__a<\/code> \u2014 \u043b\u044e\u0431\u0430\u044f \u0432\u0430\u043b\u0438\u0434\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f JavaScript. \u0414\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0444\u043b\u0430\u0433 <code>fix<\/code>, \u0438 \u0442\u043e\u0433\u0434\u0430 \u043a\u043e\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">module.exports = {     hello: 'world', };<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u0432:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">const cheers = {     hello: 'world', };<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"posleslovie\">\u041f\u043e\u0441\u043b\u0435\u0441\u043b\u043e\u0432\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u044f \u0441\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435: \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 AST \u0441\u0430\u043c\u044b\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0438\u0437 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043f\u0443\u0442\u0435\u0439, \u0438 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u0434\u0435\u0438 \u0432 \u043c\u0430\u0441\u0441\u044b :). \u041d\u0430 <code>Go<\/code> \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u0438\u0441\u0430\u043b, \u043d\u043e \u0441\u043c\u043e\u0442\u0440\u044e, \u0447\u0442\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 <code>AST<\/code>, \u0435\u0441\u0442\u044c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u043f\u0440\u0438 \u0447\u0435\u043c, \u043a\u0430\u043a \u044f \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438.<\/p>\n<p>  <\/p>\n<p>\u0425\u043e\u0447\u0443 \u043f\u043e\u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0438\u0442\u044c \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f, \u043e\u0447\u0443\u0442\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u043d\u0430 \u044d\u0442\u0438\u0445 \u0441\u0442\u0440\u043e\u043a\u0430\u0445, <a href=\"https:\/\/habr.com\/en\/users\/quasilyte\/\" class=\"user_link\">quasilyte<\/a>, \u0437\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430, \u043a\u0430\u043a Ruleguard, \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u043d\u0430 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u0438 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430. \u0410 \u0435\u0449\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u043f\u0438\u0449\u0443 \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u044b\u0448\u043b\u0435\u043d\u0438\u0439, \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0438\u0442 \u043d\u0430 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0438\u0434\u0435\u0439, \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430.<\/p>\n<p>  <\/p>\n<p>\u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u043b\u044e\u0431\u044b\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c \u0441 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u043d\u0430 JavaScript (\u0438 Go, \u0435\u0441\u043b\u0438 <a href=\"https:\/\/habr.com\/en\/users\/quasilyte\/\" class=\"user_link\">quasilyte<\/a> \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0441\u044f \u043a \u0431\u0435\u0441\u0435\u0434\u0435).<\/p>\n<p>  <\/p>\n<p>\u0418, \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a, \u043e\u043f\u0440\u043e\u0441.<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/506234\/\"> https:\/\/habr.com\/ru\/post\/506234\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/506234\/\">\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 <a href=\"https:\/\/habr.com\/en\/post\/481696\/\">\u0441\u0442\u0430\u0442\u044c\u044e<\/a> \u043f\u0440\u043e <a href=\"https:\/\/github.com\/quasilyte\/go-ruleguard\/\" rel=\"nofollow\">\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 Ruleguard<\/a> \u0438 \u0445\u043e\u0442\u0435\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a \u043d\u0435\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439, \u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0441\u0442\u0430\u0442\u044c\u044f.<\/p>\n<p>  <\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0447\u0442\u043e \u043f\u043e\u0445\u043e\u0436\u0438\u0435 \u0438\u0434\u0435\u0438 \u043c\u043e\u0433\u0443\u0442 \u0432 \u043e\u0434\u043d\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0438\u0439\u0442\u0438 \u0440\u0430\u0437\u043d\u044b\u043c \u043b\u044e\u0434\u044f\u043c, \u043f\u0438\u0448\u0443\u0449\u0438\u043c \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445. \u042f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u043d\u0430\u0434 <a href=\"https:\/\/habr.com\/en\/post\/504594\/\">\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c<\/a> <a href=\"https:\/\/github.com\/coderaiser\/putout\" rel=\"nofollow\">Putout<\/a>, \u0438 \u043e\u0431\u0440\u0430\u0442\u0438\u043b \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0432 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0445 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 <code>JavaScript<\/code> \u0438 <code>Go<\/code>, \u044f\u0437\u044b\u043a\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0437\u043d\u0430\u044e, \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0441\u0445\u043e\u0436\u0435\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432, \u043d\u0435 \u043c\u043e\u0433\u043b\u0430 \u043d\u0435 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0443 \u043c\u0435\u043d\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441.<\/p>\n<p>  <\/p>\n<p>\u0410 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0432\u0430\u0441 \u0436\u0434\u0435\u0442 \u043e\u043f\u0440\u043e\u0441 :).<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-305246","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/305246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=305246"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/305246\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=305246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=305246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=305246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}