{"id":301891,"date":"2020-04-15T09:00:17","date_gmt":"2020-04-15T09:00:17","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=301891"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=301891","title":{"rendered":"\u0427\u0438\u0441\u0442\u0438\u043c \u043a\u043e\u0434 \u0432 Angular. \u0413\u043e\u0442\u043e\u0432\u0438\u043c ESLint, codelyzer, stylelint, husky, lint-staged \u0438 Prettier"},"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\/company\/tinkoff\/blog\/497282\/\">\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435, \u0442\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b \u0435\u0449\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u044d\u0442\u0438 \u0432\u0435\u0449\u0438, \u0430 \u043a\u0442\u043e-\u0442\u043e \u0434\u0430\u0436\u0435 \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043f\u0440\u043e \u043d\u0438\u0445. \u0420\u0430\u0431\u043e\u0442\u0430\u044f \u043e\u0434\u0438\u043d, \u0432\u044b \u0441\u0430\u043c\u0438 \u0441\u0435\u0431\u0435 \u0445\u043e\u0437\u044f\u0438\u043d.<br \/>  \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0430\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435\u200a \u2014 \u200a\u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0440\u0435\u0437\u043a\u043e \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442 \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439, \u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u0442\u0438\u043b\u0435, \u0432 \u043a\u0430\u043a\u043e\u043c \u0443\u043c\u0435\u0435\u0442. \u0418 \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432\u044b \u0432\u0441\u0435 \u0436\u0435 \u0441\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0438 \u043e\u0431\u0441\u0443\u0434\u0438\u043b\u0438 \u043d\u0430 \u0441\u043b\u043e\u0432\u0430\u0445 codestyle \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438 \u0434\u0430\u0436\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0433\u0434\u0435-\u0442\u043e, \u044d\u0442\u043e, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u0438 \u0432\u043e\u0442 \u043f\u043e\u0447\u0435\u043c\u0443.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/y_\/n-\/0h\/y_n-0hadf_3oq7c6otl4nl4zas8.png\"><\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u0427\u0435\u043b\u043e\u0432\u0435\u043a \u200a\u043d\u0435 \u0440\u043e\u0431\u043e\u0442, \u0438 \u0435\u043c\u0443 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0448\u0438\u0431\u0430\u0442\u044c\u0441\u044f, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439\u200a. \u041f\u0438\u0448\u0438 \u043a\u043e\u0434 \u043a\u0430\u043a \u0434\u0443\u0448\u0435 \u0443\u0433\u043e\u0434\u043d\u043e, \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u0430\u043a-\u043d\u0438\u0431\u0443\u0434\u044c \u0434\u0430 \u0440\u0430\u0437\u0431\u0435\u0440\u0443\u0442\u0441\u044f. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u0442\u0430\u0440\u0430\u0435\u0442\u0435\u0441\u044c \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438 \u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0435 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0432\u043e\u0439 \u043a\u043e\u0434, \u043d\u043e \u0438 \u043a\u043e\u0434 \u043a\u043e\u043b\u043b\u0435\u0433, \u044d\u0442\u043e \u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0432\u044b\u044f\u0432\u0438\u0442\u044c 100% \u0432\u0441\u0435\u0445 \u043e\u0448\u0438\u0431\u043e\u043a.<br \/>  \u0414\u043b\u044f \u043f\u043e\u043c\u043e\u0449\u0438 \u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u200a\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u2014 \u043b\u0438\u043d\u0442\u0435\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u043d\u043e \u0438 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432\u0430\u043c\u0438 \u043a\u043e\u0434 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c\u0438. \u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435, \u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0438. \u0422\u0430\u043a\u0436\u0435, \u043f\u043e\u043c\u0438\u043c\u043e \u0441\u0430\u043c\u0438\u0445 \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432, \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430. \u0412 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 \u043b\u0438\u043d\u0442\u0435\u0440\u0430\u043c\u0438 \u043e\u043d\u0438 \u0434\u0430\u0434\u0443\u0442 \u0435\u0449\u0435 \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p>  <\/p>\n<h2 id=\"podgotovka\">\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h2>\n<p>  <\/p>\n<p>\u0421\u0440\u0430\u0437\u0443 \u043e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0438 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435, \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b. \u041d\u043e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 Angular-\u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u0433\u043e\u0442\u043e\u0432\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438.<br \/>  \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u0434\u0430\u043b\u0435\u0435, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043a Angular, \u043d\u043e \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Angular \u0438 \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">npm install -g @angular\/cli # \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d @angular\/cli ng new angular-linters-sample<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"tslint-deprecated\">TSLint (deprecated)<\/h2>\n<p>  <\/p>\n<p>\u041d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/cli.angular.io\/\">Angular CLI<\/a>, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f TSLint. \u0423\u0436\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 npm run lint, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e \u0432 CLI \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0431\u0438\u043b\u0434\u0435\u0440\u0430 ng lint, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043a\u043e\u0434\u0430 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 codestyle.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c: \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u043e\u0448\u0438\u0431\u043a\u0443 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043b\u0438\u043d\u0442\u0435\u0440 (\u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, \u043a\u0430\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0431\u044b\u043b\u0430 \u0432\u043d\u0435\u0441\u0435\u043d\u0430).<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/sl\/_c\/ei\/sl_ceicvqrkmqsdzot_hdn3pbac.png\"><br \/>  <em>TSLint: \u0417\u0430\u043f\u0443\u0441\u043a \u043b\u0438\u043d\u0442\u0435\u0440\u0430 \u0432 Angular-\u043f\u0440\u043e\u0435\u043a\u0442\u0435<\/em><\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043b\u0438\u043d\u0442\u0435\u0440 \u043d\u0430\u0448\u0435\u043b \u043e\u0448\u0438\u0431\u043a\u0443 \u0438 \u0434\u0430\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b <a href=\"https:\/\/angular.io\/guide\/styleguide#style-09-01\">\u0441\u0441\u044b\u043b\u043a\u0443<\/a> \u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c styleguide, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043d \u0434\u043b\u044f Angular-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432.<br \/>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441 TSLint \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f <a href=\"https:\/\/palantir.github.io\/tslint\/\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u0422\u0430\u043c \u0436\u0435 \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u0438\u043b \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 <a href=\"https:\/\/palantir.github.io\/tslint\/develop\/custom-rules\/\">\u0432\u0435\u0449\u0438<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 TSLint.<br \/>  \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u0413\u0438\u0442\u0445\u0430\u0431\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e TSLint \u043f\u043e\u043c\u0435\u0447\u0435\u043d \u043a\u0430\u043a deprecated, \u0442\u0430\u043a \u0447\u0442\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0435\u0433\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c ESLint (\u043e \u043d\u0435\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u0434\u0430\u043b\u0435\u0435).<\/p>\n<p>  <\/p>\n<h2 id=\"codelyzer\">Codelyzer<\/h2>\n<p>  <\/p>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e TSLint, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 TypeScript, \u0432 Angular-\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0438\u043c\u0435\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u043a Angular.<br \/>  \u0418 \u0442\u0430\u043a\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0435\u0441\u0442\u044c\u200a \u2014 \u200a<a href=\"https:\/\/www.npmjs.com\/package\/codelyzer\">codelyzer<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 Angular CLI. \u041f\u0440\u0430\u0432\u0438\u043b\u0430 codelyzer \u0442\u043e\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b npm run lint. \u042d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0437\u0430 \u0441\u0447\u0435\u0442 \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 tslint.json, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f TSLint \u0438 codelyzer \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e rulesDirectory.<\/p>\n<p>  <\/p>\n<h2 id=\"eslint\">ESLint<\/h2>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a TSLint <a href=\"https:\/\/github.com\/palantir\/tslint\/releases\/tag\/6.0.0\">\u0431\u044b\u043b \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d<\/a> \u043a\u0430\u043a deprecated, Angular-\u043a\u043e\u043c\u044c\u044e\u043d\u0438\u0442\u0438 \u043d\u0430\u0447\u0430\u043b\u043e \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 ESLint. \u0415\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0443\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438, \u0442\u043e \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0443\u0436\u0435 <a href=\"https:\/\/habr.com\/ru\/company\/dodopizzadev\/blog\/473648\/\">\u0431\u044b\u043b\u0430 \u0441\u0442\u0430\u0442\u044c\u044f<\/a>, \u0433\u0434\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043f\u043e\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f, \u043f\u043e\u0447\u0435\u043c\u0443 \u0441\u0442\u043e\u0438\u0442 \u043c\u0438\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<br \/>  \u041d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 (\u0432\u0435\u0440\u0441\u0438\u044f Angular 9.0.5) \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 ESLint \u0432 Angular \u0435\u0449\u0435 \u043d\u0435\u0442, \u043f\u043e \u044d\u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435 CLI \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 TSLint \u0438 codelyzer. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e codelyzer <a href=\"https:\/\/github.com\/mgechev\/codelyzer\/issues\/763\">\u043d\u0435 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c<\/a> \u0441 ESLint \u0438 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e\u0442 \u043d\u0430\u0447\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/github.com\/angular-eslint\/angular-eslint\">angular-eslint<\/a>: \u0442\u0443\u0442 \u0435\u0441\u0442\u044c builder \u0438 \u0432 \u043f\u043b\u0430\u043d\u0430\u0445 \u2014 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f schematic \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438.<br \/>  \u0422\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/github.com\/typescript-eslint\/tslint-to-eslint-config\">\u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/a> \u043e\u0442 ESLint \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/github.com\/typescript-eslint\/typescript-eslint\/tree\/master\/packages\/eslint-plugin#eslint-plugin-typescript\">eslint-plugin-typescript<\/a>.<br \/>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 Nx, \u0442\u043e \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 9.1 <a href=\"https:\/\/blog.nrwl.io\/dependency-graph-enhancements-eslint-plugin-buildable-library-dependencies-ngrx-9-and-more-in-e7b896c4fbca\">\u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f<\/a> \u043f\u043b\u0430\u0433\u0438\u043d @nrwl\/linter, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0439 ESLint.<br \/>  \u0415\u0449\u0435 \u0435\u0441\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/github.com\/TinkoffCreditSystems\/linters\">@tinkoff\/linters<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043d\u0430\u0431\u043e\u0440\u0430\u043c\u0438 \u043f\u0440\u0430\u0432\u0438\u043b \u043e\u0442 Tinkoff. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 ESLint, \u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u2014 TSLint.<br \/>  \u041e\u0434\u043d\u0430\u043a\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043e\u0442\u0432\u043b\u0435\u043a\u0430\u0442\u044c\u0441\u044f, \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u043d\u0430 ESLint, \u043f\u043e\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043e\u0431 \u044d\u0442\u043e\u043c.<\/p>\n<p>  <\/p>\n<h2 id=\"stylelint\">Stylelint<\/h2>\n<p>  <\/p>\n<p>\u0410 \u043a\u0430\u043a \u0436\u0435 \u0441\u0442\u0438\u043b\u0438? \u0418 \u0434\u043b\u044f \u0441\u0442\u0438\u043b\u0435\u0439 \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u0412\u0441\u0442\u0440\u0435\u0447\u0430\u0439\u0442\u0435 \u200a\u2014 \u200a<a href=\"https:\/\/stylelint.io\/\">stylelint<\/a>. \u0410\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u0433\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0438 \u0432 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u043f\u0440\u0430\u0432\u0438\u043b. \u0422\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c <a href=\"https:\/\/stylelint.io\/demo\">\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430<\/a> \u2014 \u0442\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0432\u0430\u043c \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u0430\u0432\u0438\u043b.<\/p>\n<p>  <\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0441\u0430\u043c stylelint, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u0430\u0432\u0438\u043b:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">npm install stylelint stylelint-config-standard --save-dev<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0432 \u0444\u0430\u0439\u043b\u0435 .stylelintrc (\u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/stylelint.io\/user-guide\/configuration\">\u0437\u0434\u0435\u0441\u044c<\/a>):<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">{  &quot;extends&quot;: &quot;stylelint-config-standard&quot;,  &quot;rules&quot;: {    &quot;at-rule-empty-line-before&quot;: null  } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u0432 package.json, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u0442\u0438\u043b\u0435\u0439:<\/p>\n<p>  <\/p>\n<pre><code class=\"json\">&quot;scripts&quot;: {  ...  &quot;lint-css&quot;: &quot;stylelint src\/**\/*.css&quot;  ... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0438 \u0441\u0440\u0430\u0437\u0443 \u043b\u043e\u0432\u0438\u043c \u043e\u0448\u0438\u0431\u043a\u0443, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 \u0444\u0430\u0439\u043b\u0435 app.component.css \u0441\u0442\u0438\u043b\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442, \u0438 \u044d\u0442\u043e \u043f\u043e\u0434\u043f\u0430\u0434\u0430\u0435\u0442 \u043f\u043e\u0434 \u043f\u0440\u0430\u0432\u0438\u043b\u043e no-empty-source, \u0447\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435 \u043d\u0438\u0436\u0435.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/2x\/7i\/7k\/2x7i7kxlx_lz_yksbkww6yr9oss.png\"><br \/>  <em>Stylelint: \u041f\u0435\u0440\u0432\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u043b\u0438\u043d\u0442\u0435\u0440\u0430 \u0441\u0442\u0438\u043b\u0435\u0439 \u0432 Angular-\u043f\u0440\u043e\u0435\u043a\u0442\u0435<\/em><\/p>\n<p>  <\/p>\n<h2 id=\"husky\">Husky<\/h2>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043b\u0438\u043d\u0442\u0435\u0440 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0435\u0440\u0435\u0434 \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u043c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0443\u0442\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0434\u0430 \u0438 \u0432\u043e\u043e\u0431\u0449\u0435\u200a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0431\u044b\u0442\u044c \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c. \u0427\u0442\u043e\u0431\u044b \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0430\u043a\u0435\u0442 <a href=\"https:\/\/github.com\/typicode\/husky\">husky<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/www.git-scm.com\/docs\/githooks\">Git Hooks<\/a>.<br \/>  \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0435\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u043d\u0438\u0431\u0443\u0434\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0434\u043e \u043a\u043e\u043c\u043c\u0438\u0442\u0430, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0445\u0443\u043a\u0430 pre-commit.<br \/>  \u041f\u043e\u043c\u0438\u043c\u043e \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0445\u0443\u043a\u0430 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0445\u0443\u043a\u0430 pre-push. \u041e\u0431\u044b\u0447\u043d\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0435\u0433\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432 \u043d\u0430 pre-commit \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u044b.<\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435. \u200a\u041a\u0430\u043a \u0438 \u0434\u043e\u0433\u043e\u0432\u0430\u0440\u0438\u0432\u0430\u043b\u0438\u0441\u044c, \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 npm run lint.<br \/>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c husky:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">npm install husky --save-dev<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0432 \u0444\u0430\u0439\u043b\u0435 .huskyrc (\u043c\u043e\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438 \u0432 package.json, \u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442):<\/p>\n<p>  <\/p>\n<pre><code class=\"json\">{  &quot;hooks&quot;: {    &quot;pre-commit&quot;: &quot;npm run lint&quot;  } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u043c\u043c\u0438\u0442 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u044b\u0432\u043e\u0434:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bg\/eb\/eu\/bgebeunyjdsnmivv4np-tr8tykc.png\"><br \/>  <em>Husky: \u0412\u044b\u0432\u043e\u0434 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u043f\u0440\u0438 \u043a\u043e\u043c\u043c\u0438\u0442\u0435<\/em><\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0430, \u043f\u0435\u0440\u0435\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043c\u043c\u0438\u0442\u0430 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 ng lint, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0430\u0441\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c lint, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u0432 package.json.<br \/>  \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c:<\/p>\n<p>  <\/p>\n<p>Husky \u2192 pre-commit hook \u2192 npm run lint \u2192 ng lint<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u0435\u0440\u043d\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443, \u043a\u043e\u043c\u043c\u0438\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u043d\u0435\u0434\u043e\u0447\u0435\u0442\u044b.<\/p>\n<p>  <\/p>\n<h2 id=\"lint-staged\">Lint-staged<\/h2>\n<p>  <\/p>\n<p>\u0412 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d husky, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0432\u0435\u0434\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0430\u043a\u0442\u0438\u0432\u043d\u043e, \u0438 \u043b\u0438\u043d\u0442\u0435\u0440 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u043e\u043c\u043c\u0438\u0442, \u0437\u0430\u0449\u0438\u0449\u0430\u044f \u043a\u043e\u0434 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 codestyle.<br \/>  \u041e\u0434\u043d\u0430\u043a\u043e, \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u044c, \u0447\u0442\u043e \u043b\u0438\u043d\u0442\u0435\u0440 \u0447\u0442\u043e-\u0442\u043e \u0434\u043e\u043b\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u043a\u043e\u0435-\u043a\u0442\u043e \u0434\u0430\u0436\u0435 \u0441\u0442\u0430\u043b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0442\u044c \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043b\u0438\u043d\u0442\u0435\u0440 (\u0432\u0435\u0434\u044c \u0432\u0441\u0435 \u0438 \u0442\u0430\u043a \u0443\u0436\u0435 \u0437\u043d\u0430\u044e\u0442 codestyle, \u0437\u0430\u0447\u0435\u043c \u0436\u0434\u0430\u0442\u044c!). \u041e\u0442\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043b\u0438\u043d\u0442\u0435\u0440, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c, \u0432 \u0447\u0435\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430.<br \/>  \u0410 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043b\u0438\u043d\u0442\u0435\u0440 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u043e\u0431\u0449\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u044b \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0422\u0430\u043a \u0447\u0442\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043b\u0438\u043d\u0442\u0435\u0440\u0430 \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u0431\u0443\u0434\u0435\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b. \u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e, \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u0444\u0430\u0439\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0438\u0442, \u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u200a \u2014\u200a \u0444\u0430\u0439\u043b\u044b \u0432 \u0441\u0442\u0430\u0442\u0443\u0441\u0435 staged (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e \u0441\u0442\u0430\u0442\u0443\u0441\u044b \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 git \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/git-scm.com\/book\/en\/v2\/Git-Basics-Recording-Changes-to-the-Repository\">\u0437\u0434\u0435\u0441\u044c<\/a>).<\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435.<br \/>  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c lint-staged:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">npm install lint-staged --save-dev<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0432 \u0444\u0430\u0439\u043b\u0435 .lintstagedrc (\u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/okonet\/lint-staged#configuration\">\u0437\u0434\u0435\u0441\u044c<\/a>). \u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c, \u0447\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u043b\u0438\u043d\u0442\u0435\u0440\u0430 \u043d\u0430 \u0444\u0430\u0439\u043b\u044b \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c js \u0438 ts, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u2014 \u043d\u0430 \u0444\u0430\u0439\u043b\u044b \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c css:<\/p>\n<p>  <\/p>\n<pre><code class=\"json\">{  &quot;*.{js,ts}&quot;: &quot;npm run lint&quot;,  &quot;*.css&quot;: &quot;npm run lint-css&quot; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e husky, \u0432\u0435\u0434\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0435\u043c\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0445\u0443\u043a \u043d\u0430 pre-commit. \u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f lint-staged, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0444\u0430\u0439\u043b\u043e\u0432, \u043d\u0435 \u0434\u0430\u0432\u0430\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043b\u0438\u043d\u0442\u0435\u0440 \u043d\u0430 \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u043f\u043e\u0434\u0440\u044f\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"json\">{  &quot;hooks&quot;: {    &quot;pre-commit&quot;: &quot;lint-staged&quot;  } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<p>Husky \u2192 pre-commit hook \u2192 lint-staged<br \/>  \u2192 tslint<br \/>  \u2192 stylelint<\/p>\n<p>  <\/p>\n<h2 id=\"prettier\">Prettier<\/h2>\n<p>  <\/p>\n<p><a href=\"https:\/\/prettier.io\/\">Prettier<\/a> \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0442\u043e, \u043e \u0447\u0435\u043c \u0431\u044b\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0440\u0430\u043d\u0435\u0435.<br \/>  \u041d\u043e \u0437\u0430\u0447\u0435\u043c \u0432\u043e\u043e\u0431\u0449\u0435 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0438 \u0442\u0430\u043a \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432?<\/p>\n<p>  <\/p>\n<p>\u0418\u0437 \u043f\u043b\u044e\u0441\u043e\u0432:<\/p>\n<p>  <\/p>\n<ul>\n<li>Prettier \u043c\u043e\u0436\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u043a\u043e\u0434 (auto fix). \u0414\u0430, \u0442\u043e\u0442 \u0436\u0435 TSLint \u0442\u043e\u0436\u0435 \u0443\u043c\u0435\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u0434, \u043d\u043e \u043d\u0435 \u0432\u0435\u0441\u044c. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u043e\u043c\u0435\u0442\u043a\u0443 Has Fixer \u0432 \u0435\u0433\u043e <a href=\"https:\/\/palantir.github.io\/tslint\/rules\/\">\u043f\u0440\u0430\u0432\u0438\u043b\u0430\u0445<\/a>. \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0438 stylelint: \u043e\u043d \u0443\u043c\u0435\u0435\u0442 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0442\u0438\u043b\u0438, \u0433\u0434\u0435 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0447\u0435\u0440\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u043b\u0430\u0433\u0430 &#8212;fix. \u0412 prettier \u0435\u0441\u0442\u044c \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0442\u0430\u043a \u0447\u0442\u043e \u0432\u0430\u0448 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043a \u0435\u0434\u0438\u043d\u043e\u043c\u0443 \u0441\u0442\u0438\u043b\u044e.<\/li>\n<li>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u201c\u0443\u043c\u043d\u043e\u0435\u201d \u0430\u0432\u0442\u043e\u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/jlongster.com\/A-Prettier-Formatter\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/li>\n<li>\u0423\u043c\u0435\u0435\u0442 <a href=\"https:\/\/prettier.io\/docs\/en\/integrating-with-linters.html\">\u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f<\/a> \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043b\u0438\u043d\u0442\u0435\u0440\u0430\u043c\u0438, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0441 ESLint, TSLint, stylelint.<\/li>\n<li>\u0423\u043c\u0435\u0435\u0442 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 IDE.<\/li>\n<li>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e <a href=\"https:\/\/prettier.io\/docs\/en\/index.html\">\u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432<\/a>.<\/li>\n<li>\u0420\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442\u0441\u044f \u0437\u0430 \u0441\u0447\u0435\u0442 <a href=\"https:\/\/prettier.io\/docs\/en\/plugins.html\">\u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432<\/a>.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0418\u0437 \u043c\u0438\u043d\u0443\u0441\u043e\u0432:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0418\u043d\u043e\u0433\u0434\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u043c \u0438 \u043d\u0430\u0434\u043e \u043f\u0440\u0438\u0432\u044b\u043a\u0430\u0442\u044c \u043a \u044d\u0442\u043e\u043c\u0443. \u041c\u043d\u0435 \u0438 \u0434\u0440\u0443\u0433\u0438\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0445\u0432\u0430\u0442\u0438\u043b\u043e \u043f\u0430\u0440\u044b \u043d\u0435\u0434\u0435\u043b\u044c, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0432\u044b\u043a\u043d\u0443\u0442\u044c \u0438 \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430.<\/li>\n<li>\u041d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f HTML.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c, \u043f\u043b\u044e\u0441\u043e\u0432 \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0435\u043c \u043c\u0438\u043d\u0443\u0441\u043e\u0432 \u0438 prettier \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0440\u043e\u043b\u044c \u0441\u0432\u044f\u0437\u0443\u044e\u0449\u0435\u0433\u043e \u0437\u0432\u0435\u043d\u0430, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044f \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u044f \u0432\u044b\u0448\u0435\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b. \u0422\u0430\u043a\u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043a\u043e\u0434, \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 \u043e\u0434\u043d\u043e\u043c \u0441\u0442\u0438\u043b\u0435, \u0443\u0434\u043e\u0431\u043d\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u2014 \u0443\u0436\u0435 \u043d\u0435 \u043e\u0436\u0438\u0434\u0430\u0435\u0448\u044c \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u201c\u0441\u044e\u0440\u043f\u0440\u0438\u0437\u043e\u0432\u201d \u043f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u0440\u0435\u0432\u044c\u044e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0435\u0441\u043b\u0438 \u0432 \u0432\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u0432\u044b \u0432\u0441\u0435 \u0435\u0449\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u043d\u0430 \u043d\u0435\u0433\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u2014 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435.<br \/>  \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c Prettier \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043d\u0430\u0431\u043e\u0440\u044b \u043f\u0440\u0430\u0432\u0438\u043b \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 TSLint \u0438 stylelint:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">npm install prettier tslint-config-prettier tslint-plugin-prettier stylelint-config-prettier stylelint-prettier --save-dev<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c <a href=\"https:\/\/alexjoverm.github.io\/2017\/06\/12\/Use-Prettier-with-TSLint-and-be-happy\/\">\u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f TSLint<\/a> \u0447\u0435\u0440\u0435\u0437 \u0444\u0430\u0439\u043b tslint.json:<\/p>\n<p>  <\/p>\n<pre><code class=\"json\">{  &quot;extends&quot;: [    &quot;tslint-config-prettier&quot;,    &quot;tslint-plugin-prettier&quot;,    &quot;codelyzer&quot;  ],  &quot;rules&quot;: {    &quot;prettier&quot;: true  } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u0430\u0436\u043d\u043e \u0443\u0442\u043e\u0447\u043d\u0438\u0442\u044c: \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 ESLint\/TSLint \u0438 Prettier \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u0440\u0435\u0448\u0430\u044e\u0442 \u0441\u0445\u043e\u0436\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439.<br \/>  \u042d\u0442\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0430, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u2014 \u0434\u043b\u044f \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0432 \u0440\u0443\u043a\u0438 Prettier.<br \/>  \u0414\u0430\u043b\u0435\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f stylelint \u0432 \u0444\u0430\u0439\u043b .stylelintrc:<\/p>\n<p>  <\/p>\n<pre><code class=\"json\">{  &quot;extends&quot;: [&quot;stylelint-prettier\/recommended&quot;] }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f Prettier \u0432 .prettierrc:<\/p>\n<p>  <\/p>\n<pre><code class=\"json\">{  &quot;trailingComma&quot;: &quot;es5&quot;,  &quot;tabWidth&quot;: 2,  &quot;semi&quot;: true,  &quot;singleQuote&quot;: true }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">npx tslint-config-prettier-check .\/tslint.json npx stylelint-config-prettier-check<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 prettier \u0432 package.json:<\/p>\n<p>  <\/p>\n<pre><code class=\"json\">&quot;scripts&quot;: {  ...  &quot;prettier&quot;: &quot;prettier --write src\/**\/*.{js,ts,css}&quot;,  ... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u0435\u043c \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433 lint-staged, \u0447\u0442\u043e\u0431\u044b Prettier \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0435\u0440\u0435\u0434 \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"json\">{  &quot;*.{js,json,md,html}&quot;: [    &quot;prettier --write&quot;  ],  &quot;*.css&quot;: [    &quot;prettier --write&quot;,    &quot;npm run lint-css&quot;  ],  &quot;*.ts&quot;: [    &quot;prettier --write&quot;,    &quot;npm run lint&quot;  ] }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a Prettier \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">npm run prettier<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"itogi\">\u0418\u0442\u043e\u0433\u0438<\/h2>\n<p>  <\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0432\u0435\u0449\u0438, \u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u044e\u0430\u043d\u0441\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u043f\u0443\u0441\u0442\u0438\u043b \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f.<br \/>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435, \u0432\u0435\u0434\u0435\u0442\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043d\u0430 Angular, \u043d\u043e \u0435\u0449\u0435 \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u043b\u0438\u043d\u0442\u0435\u0440\u044b \u2014 \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0438 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u0432\u0430\u0441. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0432\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 Angular, \u0442\u043e \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u043c\u0438 \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u043f\u043e\u0434 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u0434 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u043e\u0433\u043e \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/HunteX\/angular-linters-sample\">\u0432 \u044d\u0442\u043e\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/a>.<br \/>  \u0422\u0430\u043a\u0436\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 <a href=\"https:\/\/github.com\/TinkoffCreditSystems\/linters\">@tinkoff\/linters<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 \u043d\u0430\u0448\u0438\u043c\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043d\u0430\u0431\u043e\u0440\u0430\u043c\u0438 \u043f\u0440\u0430\u0432\u0438\u043b.<br \/>  \u0418 \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0441\u0442\u0430\u0440\u0442\u0430 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 <a href=\"https:\/\/github.com\/TinkoffCreditSystems\/angular-open-source-starter\">\u0432\u043e\u0442 \u044d\u0442\u043e\u0442<\/a> \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439, \u0433\u0434\u0435 \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u043f\u043e \u043b\u0438\u043d\u0442\u0435\u0440\u0430\u043c.<\/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\/company\/tinkoff\/blog\/497282\/\"> https:\/\/habr.com\/ru\/company\/tinkoff\/blog\/497282\/<\/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\/company\/tinkoff\/blog\/497282\/\">\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435, \u0442\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b \u0435\u0449\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u044d\u0442\u0438 \u0432\u0435\u0449\u0438, \u0430 \u043a\u0442\u043e-\u0442\u043e \u0434\u0430\u0436\u0435 \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043f\u0440\u043e \u043d\u0438\u0445. \u0420\u0430\u0431\u043e\u0442\u0430\u044f \u043e\u0434\u0438\u043d, \u0432\u044b \u0441\u0430\u043c\u0438 \u0441\u0435\u0431\u0435 \u0445\u043e\u0437\u044f\u0438\u043d.<br \/>  \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0430\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435\u200a \u2014 \u200a\u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0440\u0435\u0437\u043a\u043e \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442 \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439, \u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u0442\u0438\u043b\u0435, \u0432 \u043a\u0430\u043a\u043e\u043c \u0443\u043c\u0435\u0435\u0442. \u0418 \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432\u044b \u0432\u0441\u0435 \u0436\u0435 \u0441\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0438 \u043e\u0431\u0441\u0443\u0434\u0438\u043b\u0438 \u043d\u0430 \u0441\u043b\u043e\u0432\u0430\u0445 codestyle \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438 \u0434\u0430\u0436\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0433\u0434\u0435-\u0442\u043e, \u044d\u0442\u043e, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u0438 \u0432\u043e\u0442 \u043f\u043e\u0447\u0435\u043c\u0443.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/y_\/n-\/0h\/y_n-0hadf_3oq7c6otl4nl4zas8.png\"><\/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-301891","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/301891","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=301891"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/301891\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=301891"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=301891"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=301891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}