[{"data":1,"prerenderedAt":13978},["ShallowReactive",2],{"/environment/lint-staged-husky/":3,"article-/js/eslint/":2850,"article-/css/stylelint/":5363,"article-/php/phpcs/":7415},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"head":10,"created":25,"tags":29,"chapters":32,"thumb":34,"contact":35,"feedback":35,"lead":35,"list":35,"index":35,"sitemap":35,"featured":35,"body":36,"_type":2844,"_id":2845,"_source":2846,"_file":2847,"_stem":2848,"_extension":2849},"/environment/lint-staged-husky","environment",false,"","How to set up husky & lint-staged to limit bugs in your codebase?","Article describes how to setup lint-staged and husky in the project, forcing developers to push the code that is free of simple issues and coding smells.",{"title":11,"link":12,"meta":16},"How to set up husky & lint-staged to limit bugs in your codebase? | pragmate.dev",[13],{"rel":14,"href":15},"canonical","https://pragmate.dev/environment/lint-staged-husky/",[17,20,23,26],{"name":18,"content":19},"twitter:creator","@przemekhernik",{"name":21,"content":22},"author","Przemysław Hernik",{"name":24,"content":25},"article:published_time","2025-07-03",{"name":27,"content":28},"og:image","https://cdn.pragmate.dev/wp-content/uploads/2026/07/fc1a3e6d-d12a-41b0-90a3-2a6e2529b452.jpg",{"time":30,"level":31},"11 min","Easy",[33],"/environment/lint-staged-husky/","bug",true,{"type":37,"children":38,"toc":2825},"root",[39,46,53,57,61,68,73,86,91,100,103,146,151,155,159,162,168,173,694,699,968,980,983,989,1033,1038,1052,1057,1064,1125,1183,1250,1265,1306,1338,1372,1480,1500,1503,1509,1527,1624,1637,1640,1645,1650,1658,1662,1665,1671,1717,1736,1739,1745,1765,1894,1921,1972,1975,1981,1999,2131,2143,2146,2152,2157,2188,2203,2208,2326,2336,2419,2422,2428,2449,2478,2481,2487,2492,2495,2501,2519,2554,2557,2563,2583,2608,2627,2723,2749,2752,2758,2785,2794,2797,2819],{"type":40,"tag":41,"props":42,"children":45},"element","prose-video",{"thumbnail":43,"url":44},"https://cdn.pragmate.dev/wp-content/uploads/2025/11/c86ba896-4981-485f-8b01-52067aa38704.jpg","https://www.youtube-nocookie.com/embed/4WMwqaeBVRQ",[],{"type":40,"tag":47,"props":48,"children":49},"p",{},[50],{"type":51,"value":52},"text","In this article, we'll discuss how to setup lint-staged and husky in the project, forcing developers to push the code that is free of simple issues and coding smells.",{"type":40,"tag":54,"props":55,"children":56},"cta",{},[],{"type":40,"tag":58,"props":59,"children":60},"hr",{},[],{"type":40,"tag":62,"props":63,"children":65},"h2",{"id":64},"why-to-use-lint-staged-and-husky",[66],{"type":51,"value":67},"Why to use lint-staged and husky?",{"type":40,"tag":47,"props":69,"children":70},{},[71],{"type":51,"value":72},"In an ideal world, everyone on the team would have a unified environment that catches errors as code is written. In such a world, every team member would address these errors promptly since they'd already be flagged as well. Unfortunately, the reality often falls short of this ideal.",{"type":40,"tag":47,"props":74,"children":75},{},[76,78,84],{"type":51,"value":77},"There may be obvious reasons for this. One is the environment differences - something that works for one developer may cause unexpected problems for others. Another common thing is the attitude of some people who, even when they see errors with a clear indication of \"",{"type":40,"tag":79,"props":80,"children":81},"em",{},[82],{"type":51,"value":83},"here’s an error",{"type":51,"value":85},"\" don’t feel the need to take any action. Simple laziness plays a role here too.",{"type":40,"tag":47,"props":87,"children":88},{},[89],{"type":51,"value":90},"Even when the team consistently improves code quality, regularly discusses common coding smells, and tries to keep unified environments, the same problems may still occur no matter how hard the team tries to avoid them. So, instead of wasting time repeatedly discussing the same issues over and over, it can be more effective to enforce standards before code is pushed to the repository. This is where tools like lint-staged and husky come to the rescue.",{"type":40,"tag":47,"props":92,"children":93},{},[94],{"type":40,"tag":95,"props":96,"children":97},"strong",{},[98],{"type":51,"value":99},"Lint-staged and husky are tools that help ensure that code with errors or issues that breaks defined project standards can not be committed to the repository.",{"type":40,"tag":58,"props":101,"children":102},{},[],{"type":40,"tag":47,"props":104,"children":105},{},[106,108,117,119,126,128,135,137,144],{"type":51,"value":107},"Before starting, ensure you have tools like ",{"type":40,"tag":109,"props":110,"children":114},"a",{"href":111,"rel":112},"https://pragmate.dev/js/eslint/",[113],"nofollow",[115],{"type":51,"value":116},"ESLint",{"type":51,"value":118},", ",{"type":40,"tag":109,"props":120,"children":123},{"href":121,"rel":122},"https://pragmate.dev/css/stylelint/",[113],[124],{"type":51,"value":125},"Stylelint",{"type":51,"value":127}," or ",{"type":40,"tag":109,"props":129,"children":132},{"href":130,"rel":131},"https://pragmate.dev/php/phpcs/",[113],[133],{"type":51,"value":134},"PHPCS",{"type":51,"value":136}," set up in your project to verify coding standards, as we'll be working with husky and lint-staged for this purpose. If you're unsure what they are or how to set them up, please refer to ",{"type":40,"tag":109,"props":138,"children":141},{"href":139,"rel":140},"https://pragmate.dev/environment/linting/",[113],[142],{"type":51,"value":143},"the basic guides",{"type":51,"value":145}," to start.",{"type":40,"tag":147,"props":148,"children":150},"prose-tile",{"url":149},"/js/eslint/",[],{"type":40,"tag":147,"props":152,"children":154},{"url":153},"/css/stylelint/",[],{"type":40,"tag":147,"props":156,"children":158},{"url":157},"/php/phpcs/",[],{"type":40,"tag":58,"props":160,"children":161},{},[],{"type":40,"tag":62,"props":163,"children":165},{"id":164},"when-to-use-lint-staged-and-husky",[166],{"type":51,"value":167},"When to use lint-staged and husky?",{"type":40,"tag":47,"props":169,"children":170},{},[171],{"type":51,"value":172},"To illustrate the ideas behind these tools, let's intentionally add a few issues to the codebase. For styles, we'll use the incorrect selector, which should be the lowercase \"a.\" For scripts, we'll use double quotes instead of single ones, and for PHP, we'll add wrong spacing in brackets.",{"type":40,"tag":174,"props":175,"children":177},"ide",{":tabs":176},"[\"styles.scss\", \"scripts.js\", \"functions.php\"]",[178,240,288],{"type":40,"tag":179,"props":180,"children":187},"pre",{"className":181,"code":182,"filename":183,"highlights":184,"language":186,"meta":7,"style":7},"language-scss shiki shiki-themes one-dark-pro","A {\n  text-decoration: none;\n}\n","styles.scss",[185],1,"scss",[188],{"type":40,"tag":189,"props":190,"children":191},"code",{"__ignoreMap":7},[192,211,231],{"type":40,"tag":193,"props":194,"children":198},"span",{"class":195,"line":185},[196,197],"line","highlight",[199,205],{"type":40,"tag":193,"props":200,"children":202},{"style":201},"--shiki-default:#E06C75",[203],{"type":51,"value":204},"A",{"type":40,"tag":193,"props":206,"children":208},{"style":207},"--shiki-default:#ABB2BF",[209],{"type":51,"value":210}," {\n",{"type":40,"tag":193,"props":212,"children":214},{"class":196,"line":213},2,[215,220,226],{"type":40,"tag":193,"props":216,"children":217},{"style":207},[218],{"type":51,"value":219},"  text-decoration: ",{"type":40,"tag":193,"props":221,"children":223},{"style":222},"--shiki-default:#D19A66",[224],{"type":51,"value":225},"none",{"type":40,"tag":193,"props":227,"children":228},{"style":207},[229],{"type":51,"value":230},";\n",{"type":40,"tag":193,"props":232,"children":234},{"class":196,"line":233},3,[235],{"type":40,"tag":193,"props":236,"children":237},{"style":207},[238],{"type":51,"value":239},"}\n",{"type":40,"tag":179,"props":241,"children":247},{"className":242,"code":243,"filename":244,"highlights":245,"language":246,"meta":7,"style":7},"language-js shiki shiki-themes one-dark-pro","console.log(\"hello there\");\n","scripts.js",[185],"js",[248],{"type":40,"tag":189,"props":249,"children":250},{"__ignoreMap":7},[251],{"type":40,"tag":193,"props":252,"children":254},{"class":253,"line":185},[196,197],[255,261,266,272,277,283],{"type":40,"tag":193,"props":256,"children":258},{"style":257},"--shiki-default:#E5C07B",[259],{"type":51,"value":260},"console",{"type":40,"tag":193,"props":262,"children":263},{"style":207},[264],{"type":51,"value":265},".",{"type":40,"tag":193,"props":267,"children":269},{"style":268},"--shiki-default:#61AFEF",[270],{"type":51,"value":271},"log",{"type":40,"tag":193,"props":273,"children":274},{"style":207},[275],{"type":51,"value":276},"(",{"type":40,"tag":193,"props":278,"children":280},{"style":279},"--shiki-default:#98C379",[281],{"type":51,"value":282},"\"hello there\"",{"type":40,"tag":193,"props":284,"children":285},{"style":207},[286],{"type":51,"value":287},");\n",{"type":40,"tag":179,"props":289,"children":296},{"className":290,"code":291,"filename":292,"highlights":293,"language":295,"meta":7,"style":7},"language-php shiki shiki-themes one-dark-pro","define('FM_VERSION', '0.1.1');\ndefine('FM_ROOT', str_replace(ABSPATH, '/', dirname(__DIR__, 1)));\ndefine('FM_PATH', dirname(__DIR__, 1));\ndefine('FM_URI', home_url(FM_ROOT));\ndefine('FM_HMR_HOST', 'http://localhost:5173');\ndefine('FM_HMR_URI', FM_HMR_HOST . FM_ROOT);\ndefine('FM_ASSETS_PATH', FM_PATH . '/dist');\ndefine('FM_ASSETS_URI', FM_URI . '/dist');\n\ndefine( 'FM_TEST', 'test' );\n\nrequire_once FM_PATH . '/inc/bootstrap.php';\n","functions.php",[294],10,"php",[297],{"type":40,"tag":189,"props":298,"children":299},{"__ignoreMap":7},[300,332,399,444,475,505,541,580,618,627,658,666],{"type":40,"tag":193,"props":301,"children":302},{"class":196,"line":185},[303,309,313,318,323,328],{"type":40,"tag":193,"props":304,"children":306},{"style":305},"--shiki-default:#56B6C2",[307],{"type":51,"value":308},"define",{"type":40,"tag":193,"props":310,"children":311},{"style":207},[312],{"type":51,"value":276},{"type":40,"tag":193,"props":314,"children":315},{"style":279},[316],{"type":51,"value":317},"'FM_VERSION'",{"type":40,"tag":193,"props":319,"children":320},{"style":207},[321],{"type":51,"value":322},",",{"type":40,"tag":193,"props":324,"children":325},{"style":279},[326],{"type":51,"value":327}," '0.1.1'",{"type":40,"tag":193,"props":329,"children":330},{"style":207},[331],{"type":51,"value":287},{"type":40,"tag":193,"props":333,"children":334},{"class":196,"line":213},[335,339,343,348,352,357,362,367,371,376,380,385,389,394],{"type":40,"tag":193,"props":336,"children":337},{"style":305},[338],{"type":51,"value":308},{"type":40,"tag":193,"props":340,"children":341},{"style":207},[342],{"type":51,"value":276},{"type":40,"tag":193,"props":344,"children":345},{"style":279},[346],{"type":51,"value":347},"'FM_ROOT'",{"type":40,"tag":193,"props":349,"children":350},{"style":207},[351],{"type":51,"value":322},{"type":40,"tag":193,"props":353,"children":354},{"style":305},[355],{"type":51,"value":356}," str_replace",{"type":40,"tag":193,"props":358,"children":359},{"style":207},[360],{"type":51,"value":361},"(ABSPATH,",{"type":40,"tag":193,"props":363,"children":364},{"style":279},[365],{"type":51,"value":366}," '/'",{"type":40,"tag":193,"props":368,"children":369},{"style":207},[370],{"type":51,"value":322},{"type":40,"tag":193,"props":372,"children":373},{"style":305},[374],{"type":51,"value":375}," dirname",{"type":40,"tag":193,"props":377,"children":378},{"style":207},[379],{"type":51,"value":276},{"type":40,"tag":193,"props":381,"children":382},{"style":222},[383],{"type":51,"value":384},"__DIR__",{"type":40,"tag":193,"props":386,"children":387},{"style":207},[388],{"type":51,"value":322},{"type":40,"tag":193,"props":390,"children":391},{"style":222},[392],{"type":51,"value":393}," 1",{"type":40,"tag":193,"props":395,"children":396},{"style":207},[397],{"type":51,"value":398},")));\n",{"type":40,"tag":193,"props":400,"children":401},{"class":196,"line":233},[402,406,410,415,419,423,427,431,435,439],{"type":40,"tag":193,"props":403,"children":404},{"style":305},[405],{"type":51,"value":308},{"type":40,"tag":193,"props":407,"children":408},{"style":207},[409],{"type":51,"value":276},{"type":40,"tag":193,"props":411,"children":412},{"style":279},[413],{"type":51,"value":414},"'FM_PATH'",{"type":40,"tag":193,"props":416,"children":417},{"style":207},[418],{"type":51,"value":322},{"type":40,"tag":193,"props":420,"children":421},{"style":305},[422],{"type":51,"value":375},{"type":40,"tag":193,"props":424,"children":425},{"style":207},[426],{"type":51,"value":276},{"type":40,"tag":193,"props":428,"children":429},{"style":222},[430],{"type":51,"value":384},{"type":40,"tag":193,"props":432,"children":433},{"style":207},[434],{"type":51,"value":322},{"type":40,"tag":193,"props":436,"children":437},{"style":222},[438],{"type":51,"value":393},{"type":40,"tag":193,"props":440,"children":441},{"style":207},[442],{"type":51,"value":443},"));\n",{"type":40,"tag":193,"props":445,"children":447},{"class":196,"line":446},4,[448,452,456,461,465,470],{"type":40,"tag":193,"props":449,"children":450},{"style":305},[451],{"type":51,"value":308},{"type":40,"tag":193,"props":453,"children":454},{"style":207},[455],{"type":51,"value":276},{"type":40,"tag":193,"props":457,"children":458},{"style":279},[459],{"type":51,"value":460},"'FM_URI'",{"type":40,"tag":193,"props":462,"children":463},{"style":207},[464],{"type":51,"value":322},{"type":40,"tag":193,"props":466,"children":467},{"style":268},[468],{"type":51,"value":469}," home_url",{"type":40,"tag":193,"props":471,"children":472},{"style":207},[473],{"type":51,"value":474},"(FM_ROOT));\n",{"type":40,"tag":193,"props":476,"children":478},{"class":196,"line":477},5,[479,483,487,492,496,501],{"type":40,"tag":193,"props":480,"children":481},{"style":305},[482],{"type":51,"value":308},{"type":40,"tag":193,"props":484,"children":485},{"style":207},[486],{"type":51,"value":276},{"type":40,"tag":193,"props":488,"children":489},{"style":279},[490],{"type":51,"value":491},"'FM_HMR_HOST'",{"type":40,"tag":193,"props":493,"children":494},{"style":207},[495],{"type":51,"value":322},{"type":40,"tag":193,"props":497,"children":498},{"style":279},[499],{"type":51,"value":500}," 'http://localhost:5173'",{"type":40,"tag":193,"props":502,"children":503},{"style":207},[504],{"type":51,"value":287},{"type":40,"tag":193,"props":506,"children":508},{"class":196,"line":507},6,[509,513,517,522,526,531,536],{"type":40,"tag":193,"props":510,"children":511},{"style":305},[512],{"type":51,"value":308},{"type":40,"tag":193,"props":514,"children":515},{"style":207},[516],{"type":51,"value":276},{"type":40,"tag":193,"props":518,"children":519},{"style":279},[520],{"type":51,"value":521},"'FM_HMR_URI'",{"type":40,"tag":193,"props":523,"children":524},{"style":207},[525],{"type":51,"value":322},{"type":40,"tag":193,"props":527,"children":528},{"style":207},[529],{"type":51,"value":530}," FM_HMR_HOST",{"type":40,"tag":193,"props":532,"children":533},{"style":207},[534],{"type":51,"value":535}," .",{"type":40,"tag":193,"props":537,"children":538},{"style":207},[539],{"type":51,"value":540}," FM_ROOT);\n",{"type":40,"tag":193,"props":542,"children":544},{"class":196,"line":543},7,[545,549,553,558,562,567,571,576],{"type":40,"tag":193,"props":546,"children":547},{"style":305},[548],{"type":51,"value":308},{"type":40,"tag":193,"props":550,"children":551},{"style":207},[552],{"type":51,"value":276},{"type":40,"tag":193,"props":554,"children":555},{"style":279},[556],{"type":51,"value":557},"'FM_ASSETS_PATH'",{"type":40,"tag":193,"props":559,"children":560},{"style":207},[561],{"type":51,"value":322},{"type":40,"tag":193,"props":563,"children":564},{"style":207},[565],{"type":51,"value":566}," FM_PATH",{"type":40,"tag":193,"props":568,"children":569},{"style":207},[570],{"type":51,"value":535},{"type":40,"tag":193,"props":572,"children":573},{"style":279},[574],{"type":51,"value":575}," '/dist'",{"type":40,"tag":193,"props":577,"children":578},{"style":207},[579],{"type":51,"value":287},{"type":40,"tag":193,"props":581,"children":583},{"class":196,"line":582},8,[584,588,592,597,601,606,610,614],{"type":40,"tag":193,"props":585,"children":586},{"style":305},[587],{"type":51,"value":308},{"type":40,"tag":193,"props":589,"children":590},{"style":207},[591],{"type":51,"value":276},{"type":40,"tag":193,"props":593,"children":594},{"style":279},[595],{"type":51,"value":596},"'FM_ASSETS_URI'",{"type":40,"tag":193,"props":598,"children":599},{"style":207},[600],{"type":51,"value":322},{"type":40,"tag":193,"props":602,"children":603},{"style":207},[604],{"type":51,"value":605}," FM_URI",{"type":40,"tag":193,"props":607,"children":608},{"style":207},[609],{"type":51,"value":535},{"type":40,"tag":193,"props":611,"children":612},{"style":279},[613],{"type":51,"value":575},{"type":40,"tag":193,"props":615,"children":616},{"style":207},[617],{"type":51,"value":287},{"type":40,"tag":193,"props":619,"children":621},{"class":196,"line":620},9,[622],{"type":40,"tag":193,"props":623,"children":624},{"emptyLinePlaceholder":35},[625],{"type":51,"value":626},"\n",{"type":40,"tag":193,"props":628,"children":630},{"class":629,"line":294},[196,197],[631,635,639,644,648,653],{"type":40,"tag":193,"props":632,"children":633},{"style":305},[634],{"type":51,"value":308},{"type":40,"tag":193,"props":636,"children":637},{"style":207},[638],{"type":51,"value":276},{"type":40,"tag":193,"props":640,"children":641},{"style":279},[642],{"type":51,"value":643}," 'FM_TEST'",{"type":40,"tag":193,"props":645,"children":646},{"style":207},[647],{"type":51,"value":322},{"type":40,"tag":193,"props":649,"children":650},{"style":279},[651],{"type":51,"value":652}," 'test'",{"type":40,"tag":193,"props":654,"children":655},{"style":207},[656],{"type":51,"value":657}," );\n",{"type":40,"tag":193,"props":659,"children":661},{"class":196,"line":660},11,[662],{"type":40,"tag":193,"props":663,"children":664},{"emptyLinePlaceholder":35},[665],{"type":51,"value":626},{"type":40,"tag":193,"props":667,"children":669},{"class":196,"line":668},12,[670,676,681,685,690],{"type":40,"tag":193,"props":671,"children":673},{"style":672},"--shiki-default:#C678DD",[674],{"type":51,"value":675},"require_once",{"type":40,"tag":193,"props":677,"children":678},{"style":207},[679],{"type":51,"value":680}," FM_PATH ",{"type":40,"tag":193,"props":682,"children":683},{"style":207},[684],{"type":51,"value":265},{"type":40,"tag":193,"props":686,"children":687},{"style":279},[688],{"type":51,"value":689}," '/inc/bootstrap.php'",{"type":40,"tag":193,"props":691,"children":692},{"style":207},[693],{"type":51,"value":230},{"type":40,"tag":47,"props":695,"children":696},{},[697],{"type":51,"value":698},"Linting tools, when set correctly, should indicate issues within the codebase that need to be addressed, as is the case for us. Issues are identified correctly, turning on the red flag.",{"type":40,"tag":174,"props":700,"children":701},{":tabs":176},[702,782,859],{"type":40,"tag":179,"props":703,"children":708},{"className":704,"code":705,"filename":183,"highlights":706,"language":707,"meta":7,"style":7},"language-txt shiki shiki-themes one-dark-pro","yarn stylelint resources/styles/styles.scss\n\nresources/styles/styles.scss\n  94:1  ✖  Expected \"A\" to be \"a\"  selector-type-case\n\n✖ 1 problem (1 error, 0 warnings)\n  1 error potentially fixable with the \"--fix\" option.\n\nerror Command failed with exit code 2.\n",[446],"txt",[709],{"type":40,"tag":189,"props":710,"children":711},{"__ignoreMap":7},[712,720,727,735,744,751,759,767,774],{"type":40,"tag":193,"props":713,"children":714},{"class":196,"line":185},[715],{"type":40,"tag":193,"props":716,"children":717},{},[718],{"type":51,"value":719},"yarn stylelint resources/styles/styles.scss\n",{"type":40,"tag":193,"props":721,"children":722},{"class":196,"line":213},[723],{"type":40,"tag":193,"props":724,"children":725},{"emptyLinePlaceholder":35},[726],{"type":51,"value":626},{"type":40,"tag":193,"props":728,"children":729},{"class":196,"line":233},[730],{"type":40,"tag":193,"props":731,"children":732},{},[733],{"type":51,"value":734},"resources/styles/styles.scss\n",{"type":40,"tag":193,"props":736,"children":738},{"class":737,"line":446},[196,197],[739],{"type":40,"tag":193,"props":740,"children":741},{},[742],{"type":51,"value":743},"  94:1  ✖  Expected \"A\" to be \"a\"  selector-type-case\n",{"type":40,"tag":193,"props":745,"children":746},{"class":196,"line":477},[747],{"type":40,"tag":193,"props":748,"children":749},{"emptyLinePlaceholder":35},[750],{"type":51,"value":626},{"type":40,"tag":193,"props":752,"children":753},{"class":196,"line":507},[754],{"type":40,"tag":193,"props":755,"children":756},{},[757],{"type":51,"value":758},"✖ 1 problem (1 error, 0 warnings)\n",{"type":40,"tag":193,"props":760,"children":761},{"class":196,"line":543},[762],{"type":40,"tag":193,"props":763,"children":764},{},[765],{"type":51,"value":766},"  1 error potentially fixable with the \"--fix\" option.\n",{"type":40,"tag":193,"props":768,"children":769},{"class":196,"line":582},[770],{"type":40,"tag":193,"props":771,"children":772},{"emptyLinePlaceholder":35},[773],{"type":51,"value":626},{"type":40,"tag":193,"props":775,"children":776},{"class":196,"line":620},[777],{"type":40,"tag":193,"props":778,"children":779},{},[780],{"type":51,"value":781},"error Command failed with exit code 2.\n",{"type":40,"tag":179,"props":783,"children":786},{"className":704,"code":784,"filename":244,"highlights":785,"language":707,"meta":7,"style":7},"yarn eslint resources/scripts/scripts.js\n\n/Users/przemyslawhernik/Sites/fm.tentyp.dev/wp-content/themes/footmate/resources/scripts/scripts.js\n  1:13  error  Strings must use singlequote  quotes\n\n✖ 1 problem (1 error, 0 warnings)\n  1 error and 0 warnings potentially fixable with the `--fix` option.\n\nerror Command failed with exit code 1.\n",[446],[787],{"type":40,"tag":189,"props":788,"children":789},{"__ignoreMap":7},[790,798,805,813,822,829,836,844,851],{"type":40,"tag":193,"props":791,"children":792},{"class":196,"line":185},[793],{"type":40,"tag":193,"props":794,"children":795},{},[796],{"type":51,"value":797},"yarn eslint resources/scripts/scripts.js\n",{"type":40,"tag":193,"props":799,"children":800},{"class":196,"line":213},[801],{"type":40,"tag":193,"props":802,"children":803},{"emptyLinePlaceholder":35},[804],{"type":51,"value":626},{"type":40,"tag":193,"props":806,"children":807},{"class":196,"line":233},[808],{"type":40,"tag":193,"props":809,"children":810},{},[811],{"type":51,"value":812},"/Users/przemyslawhernik/Sites/fm.tentyp.dev/wp-content/themes/footmate/resources/scripts/scripts.js\n",{"type":40,"tag":193,"props":814,"children":816},{"class":815,"line":446},[196,197],[817],{"type":40,"tag":193,"props":818,"children":819},{},[820],{"type":51,"value":821},"  1:13  error  Strings must use singlequote  quotes\n",{"type":40,"tag":193,"props":823,"children":824},{"class":196,"line":477},[825],{"type":40,"tag":193,"props":826,"children":827},{"emptyLinePlaceholder":35},[828],{"type":51,"value":626},{"type":40,"tag":193,"props":830,"children":831},{"class":196,"line":507},[832],{"type":40,"tag":193,"props":833,"children":834},{},[835],{"type":51,"value":758},{"type":40,"tag":193,"props":837,"children":838},{"class":196,"line":543},[839],{"type":40,"tag":193,"props":840,"children":841},{},[842],{"type":51,"value":843},"  1 error and 0 warnings potentially fixable with the `--fix` option.\n",{"type":40,"tag":193,"props":845,"children":846},{"class":196,"line":582},[847],{"type":40,"tag":193,"props":848,"children":849},{"emptyLinePlaceholder":35},[850],{"type":51,"value":626},{"type":40,"tag":193,"props":852,"children":853},{"class":196,"line":620},[854],{"type":40,"tag":193,"props":855,"children":856},{},[857],{"type":51,"value":858},"error Command failed with exit code 1.\n",{"type":40,"tag":179,"props":860,"children":863},{"className":704,"code":861,"filename":292,"highlights":862,"language":707,"meta":7,"style":7},"phpcs resources/functions.php\n\nFILE: /Users/przemyslawhernik/Sites/fm.tentyp.dev/wp-content/themes/footmate/resources/functions.php\n-------------------------------------------------------------------------------------------------------------------------------------------------------------\nFOUND 2 ERRORS AFFECTING 1 LINE\n-------------------------------------------------------------------------------------------------------------------------------------------------------------\n12 | ERROR | [x] Space after opening parenthesis of function call prohibited (PSR2.Methods.FunctionCallSignature.SpaceAfterOpenBracket)\n12 | ERROR | [x] Expected 0 spaces before closing parenthesis; 1 found (PSR2.Methods.FunctionCallSignature.SpaceBeforeCloseBracket)\n-------------------------------------------------------------------------------------------------------------------------------------------------------------\nPHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n-------------------------------------------------------------------------------------------------------------------------------------------------------------\n\nTime: 89ms; Memory: 10MB\n",[294],[864],{"type":40,"tag":189,"props":865,"children":866},{"__ignoreMap":7},[867,875,882,890,898,906,913,921,929,936,945,952,959],{"type":40,"tag":193,"props":868,"children":869},{"class":196,"line":185},[870],{"type":40,"tag":193,"props":871,"children":872},{},[873],{"type":51,"value":874},"phpcs resources/functions.php\n",{"type":40,"tag":193,"props":876,"children":877},{"class":196,"line":213},[878],{"type":40,"tag":193,"props":879,"children":880},{"emptyLinePlaceholder":35},[881],{"type":51,"value":626},{"type":40,"tag":193,"props":883,"children":884},{"class":196,"line":233},[885],{"type":40,"tag":193,"props":886,"children":887},{},[888],{"type":51,"value":889},"FILE: /Users/przemyslawhernik/Sites/fm.tentyp.dev/wp-content/themes/footmate/resources/functions.php\n",{"type":40,"tag":193,"props":891,"children":892},{"class":196,"line":446},[893],{"type":40,"tag":193,"props":894,"children":895},{},[896],{"type":51,"value":897},"-------------------------------------------------------------------------------------------------------------------------------------------------------------\n",{"type":40,"tag":193,"props":899,"children":900},{"class":196,"line":477},[901],{"type":40,"tag":193,"props":902,"children":903},{},[904],{"type":51,"value":905},"FOUND 2 ERRORS AFFECTING 1 LINE\n",{"type":40,"tag":193,"props":907,"children":908},{"class":196,"line":507},[909],{"type":40,"tag":193,"props":910,"children":911},{},[912],{"type":51,"value":897},{"type":40,"tag":193,"props":914,"children":915},{"class":196,"line":543},[916],{"type":40,"tag":193,"props":917,"children":918},{},[919],{"type":51,"value":920},"12 | ERROR | [x] Space after opening parenthesis of function call prohibited (PSR2.Methods.FunctionCallSignature.SpaceAfterOpenBracket)\n",{"type":40,"tag":193,"props":922,"children":923},{"class":196,"line":582},[924],{"type":40,"tag":193,"props":925,"children":926},{},[927],{"type":51,"value":928},"12 | ERROR | [x] Expected 0 spaces before closing parenthesis; 1 found (PSR2.Methods.FunctionCallSignature.SpaceBeforeCloseBracket)\n",{"type":40,"tag":193,"props":930,"children":931},{"class":196,"line":620},[932],{"type":40,"tag":193,"props":933,"children":934},{},[935],{"type":51,"value":897},{"type":40,"tag":193,"props":937,"children":939},{"class":938,"line":294},[196,197],[940],{"type":40,"tag":193,"props":941,"children":942},{},[943],{"type":51,"value":944},"PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n",{"type":40,"tag":193,"props":946,"children":947},{"class":196,"line":660},[948],{"type":40,"tag":193,"props":949,"children":950},{},[951],{"type":51,"value":897},{"type":40,"tag":193,"props":953,"children":954},{"class":196,"line":668},[955],{"type":40,"tag":193,"props":956,"children":957},{"emptyLinePlaceholder":35},[958],{"type":51,"value":626},{"type":40,"tag":193,"props":960,"children":962},{"class":196,"line":961},13,[963],{"type":40,"tag":193,"props":964,"children":965},{},[966],{"type":51,"value":967},"Time: 89ms; Memory: 10MB\n",{"type":40,"tag":47,"props":969,"children":970},{},[971,973,978],{"type":51,"value":972},"Without tools like husky and Lint-staged, we might take shortcuts and push incorrect code to the repository. This is what we aim to avoid in this guide. We plan to ",{"type":40,"tag":95,"props":974,"children":975},{},[976],{"type":51,"value":977},"use these tools when we want to ensure that simple fixes are implemented before pushing to the repository",{"type":51,"value":979},", which often takes just seconds, rather than rushing and dealing with bugs later.",{"type":40,"tag":58,"props":981,"children":982},{},[],{"type":40,"tag":62,"props":984,"children":986},{"id":985},"whats-husky-and-how-to-use-it",[987],{"type":51,"value":988},"What’s husky and how to use it?",{"type":40,"tag":47,"props":990,"children":991},{},[992,999,1001,1006,1008,1014,1016,1023,1025,1031],{"type":40,"tag":109,"props":993,"children":996},{"href":994,"rel":995},"https://typicode.github.io/husky/",[113],[997],{"type":51,"value":998},"husky",{"type":51,"value":1000}," is a tool that ",{"type":40,"tag":95,"props":1002,"children":1003},{},[1004],{"type":51,"value":1005},"helps to run tasks when specific events occur in a repository",{"type":51,"value":1007},", like a ",{"type":40,"tag":189,"props":1009,"children":1011},{"className":1010},[],[1012],{"type":51,"value":1013},"pre-commit",{"type":51,"value":1015},", which is triggered before a commit is done. It uses ",{"type":40,"tag":109,"props":1017,"children":1020},{"href":1018,"rel":1019},"https://git-scm.com/docs/githooks#_hooks",[113],[1021],{"type":51,"value":1022},"git hooks",{"type":51,"value":1024},", allowing for instance to check if the code that is going to be pushed to the repository, complies with ",{"type":40,"tag":109,"props":1026,"children":1028},{"href":139,"rel":1027},[113],[1029],{"type":51,"value":1030},"defined project standards",{"type":51,"value":1032}," and blocks the submission if it does not.",{"type":40,"tag":47,"props":1034,"children":1035},{},[1036],{"type":51,"value":1037},"What else can you do with husky? If you're feeling playful, you could create and trigger a Slack API integration that shares memes with your colleagues with every commit. If you’re aiming for something more ambitious, you can write a simple AI utility that generates commit messages for you. The sky's the limit, and everything is in your hands.",{"type":40,"tag":47,"props":1039,"children":1040},{},[1041,1043,1050],{"type":51,"value":1042},"Simply check ",{"type":40,"tag":109,"props":1044,"children":1047},{"href":1045,"rel":1046},"https://git-scm.com/docs/githooks",[113],[1048],{"type":51,"value":1049},"what hooks you can use",{"type":51,"value":1051},", and build your own process tailored to your needs.",{"type":40,"tag":1053,"props":1054,"children":1056},"spacer",{"height":1055},75,[],{"type":40,"tag":1058,"props":1059,"children":1061},"h3",{"id":1060},"how-to-install-husky",[1062],{"type":51,"value":1063},"How to install husky?",{"type":40,"tag":47,"props":1065,"children":1066},{},[1067,1069,1075,1077,1082,1084,1090,1092,1099,1101,1106,1108,1115,1117,1123],{"type":51,"value":1068},"Start by installing the tool with ",{"type":40,"tag":189,"props":1070,"children":1072},{"className":1071},[],[1073],{"type":51,"value":1074},"yarn add husky --dev",{"type":51,"value":1076}," and ",{"type":40,"tag":95,"props":1078,"children":1079},{},[1080],{"type":51,"value":1081},"run the initialization process",{"type":51,"value":1083}," with ",{"type":40,"tag":189,"props":1085,"children":1087},{"className":1086},[],[1088],{"type":51,"value":1089},"yarn husky init",{"type":51,"value":1091}," ",{"type":40,"tag":109,"props":1093,"children":1096},{"href":1094,"rel":1095},"https://typicode.github.io/husky/get-started.html#husky-init-recommended",[113],[1097],{"type":51,"value":1098},"command",{"type":51,"value":1100},". It will create a ",{"type":40,"tag":189,"props":1102,"children":1104},{"className":1103},[],[1105],{"type":51,"value":1013},{"type":51,"value":1107}," ",{"type":40,"tag":109,"props":1109,"children":1112},{"href":1110,"rel":1111},"https://typicode.github.io/husky/how-to.html#adding-a-new-hook",[113],[1113],{"type":51,"value":1114},"file",{"type":51,"value":1116}," inside the ",{"type":40,"tag":189,"props":1118,"children":1120},{"className":1119},[],[1121],{"type":51,"value":1122},".husky",{"type":51,"value":1124}," directory of your project, which can be used to define what should happen before making a commit.",{"type":40,"tag":179,"props":1126,"children":1129},{"className":704,"code":1127,"highlights":1128,"language":707,"meta":7,"style":7},"footmate\n└─── .husky\n│   │   pre-commit\n└─── app\n└─── inc\n└─── resources\n",[213,233],[1130],{"type":40,"tag":189,"props":1131,"children":1132},{"__ignoreMap":7},[1133,1141,1150,1159,1167,1175],{"type":40,"tag":193,"props":1134,"children":1135},{"class":196,"line":185},[1136],{"type":40,"tag":193,"props":1137,"children":1138},{},[1139],{"type":51,"value":1140},"footmate\n",{"type":40,"tag":193,"props":1142,"children":1144},{"class":1143,"line":213},[196,197],[1145],{"type":40,"tag":193,"props":1146,"children":1147},{},[1148],{"type":51,"value":1149},"└─── .husky\n",{"type":40,"tag":193,"props":1151,"children":1153},{"class":1152,"line":233},[196,197],[1154],{"type":40,"tag":193,"props":1155,"children":1156},{},[1157],{"type":51,"value":1158},"│   │   pre-commit\n",{"type":40,"tag":193,"props":1160,"children":1161},{"class":196,"line":446},[1162],{"type":40,"tag":193,"props":1163,"children":1164},{},[1165],{"type":51,"value":1166},"└─── app\n",{"type":40,"tag":193,"props":1168,"children":1169},{"class":196,"line":477},[1170],{"type":40,"tag":193,"props":1171,"children":1172},{},[1173],{"type":51,"value":1174},"└─── inc\n",{"type":40,"tag":193,"props":1176,"children":1177},{"class":196,"line":507},[1178],{"type":40,"tag":193,"props":1179,"children":1180},{},[1181],{"type":51,"value":1182},"└─── resources\n",{"type":40,"tag":47,"props":1184,"children":1185},{},[1186,1215,1217,1224,1226,1232,1234,1238,1240,1244,1245,1249],{"type":40,"tag":95,"props":1187,"children":1188},{},[1189,1191,1198,1200,1205,1206,1213],{"type":51,"value":1190},"Open ",{"type":40,"tag":109,"props":1192,"children":1195},{"href":1193,"rel":1194},"https://github.com/vitewp/vitewp/blob/master/wp-content/themes/footmate/.husky/pre-commit",[113],[1196],{"type":51,"value":1197},"this file",{"type":51,"value":1199}," and add the command to run when the ",{"type":40,"tag":189,"props":1201,"children":1203},{"className":1202},[],[1204],{"type":51,"value":1013},{"type":51,"value":1091},{"type":40,"tag":109,"props":1207,"children":1210},{"href":1208,"rel":1209},"https://git-scm.com/docs/githooks#_pre_commit",[113],[1211],{"type":51,"value":1212},"hook",{"type":51,"value":1214}," is invoked in the repository.",{"type":51,"value":1216}," We're going to run the ",{"type":40,"tag":109,"props":1218,"children":1221},{"href":1219,"rel":1220},"https://github.com/vitewp/vitewp/blob/master/wp-content/themes/footmate/package.json#L9",[113],[1222],{"type":51,"value":1223},"linting task",{"type":51,"value":1225}," defined in the ",{"type":40,"tag":189,"props":1227,"children":1229},{"className":1228},[],[1230],{"type":51,"value":1231},"package.json",{"type":51,"value":1233}," that checks the codebase compliance with defined coding standards with ",{"type":40,"tag":109,"props":1235,"children":1236},{"href":157},[1237],{"type":51,"value":134},{"type":51,"value":1239},", ",{"type":40,"tag":109,"props":1241,"children":1242},{"href":149},[1243],{"type":51,"value":116},{"type":51,"value":1076},{"type":40,"tag":109,"props":1246,"children":1247},{"href":153},[1248],{"type":51,"value":125},{"type":51,"value":265},{"type":40,"tag":179,"props":1251,"children":1254},{"className":704,"code":1252,"filename":1253,"language":707,"meta":7,"style":7},"yarn lint\n",".husky/pre-commit",[1255],{"type":40,"tag":189,"props":1256,"children":1257},{"__ignoreMap":7},[1258],{"type":40,"tag":193,"props":1259,"children":1260},{"class":196,"line":185},[1261],{"type":40,"tag":193,"props":1262,"children":1263},{},[1264],{"type":51,"value":1252},{"type":40,"tag":47,"props":1266,"children":1267},{},[1268,1270,1276,1278,1284,1286],{"type":51,"value":1269},"You can use ",{"type":40,"tag":109,"props":1271,"children":1273},{"href":1018,"rel":1272},[113],[1274],{"type":51,"value":1275},"other hooks",{"type":51,"value":1277},", such as a ",{"type":40,"tag":189,"props":1279,"children":1281},{"className":1280},[],[1282],{"type":51,"value":1283},"pre-push",{"type":51,"value":1285}," to run a task before pushing code to the remote repository. ",{"type":40,"tag":95,"props":1287,"children":1288},{},[1289,1291,1297,1299,1304],{"type":51,"value":1290},"To add a new task to be triggered by a specific hook, ",{"type":40,"tag":109,"props":1292,"children":1294},{"href":1110,"rel":1293},[113],[1295],{"type":51,"value":1296},"use the command below",{"type":51,"value":1298},", or manually create a new file with the name of the hook in the ",{"type":40,"tag":189,"props":1300,"children":1302},{"className":1301},[],[1303],{"type":51,"value":1122},{"type":51,"value":1305}," directory.",{"type":40,"tag":179,"props":1307,"children":1311},{"className":1308,"code":1309,"language":1310,"meta":7,"style":7},"language-bash shiki shiki-themes one-dark-pro","echo \"yarn lint\" > .husky/pre-push\n","bash",[1312],{"type":40,"tag":189,"props":1313,"children":1314},{"__ignoreMap":7},[1315],{"type":40,"tag":193,"props":1316,"children":1317},{"class":196,"line":185},[1318,1323,1328,1333],{"type":40,"tag":193,"props":1319,"children":1320},{"style":305},[1321],{"type":51,"value":1322},"echo",{"type":40,"tag":193,"props":1324,"children":1325},{"style":279},[1326],{"type":51,"value":1327}," \"yarn lint\"",{"type":40,"tag":193,"props":1329,"children":1330},{"style":207},[1331],{"type":51,"value":1332}," > ",{"type":40,"tag":193,"props":1334,"children":1335},{"style":279},[1336],{"type":51,"value":1337},".husky/pre-push\n",{"type":40,"tag":47,"props":1339,"children":1340},{},[1341,1343,1356,1358,1363,1365,1371],{"type":51,"value":1342},"The ",{"type":40,"tag":95,"props":1344,"children":1345},{},[1346,1348,1354],{"type":51,"value":1347},"initialization process will also modify the ",{"type":40,"tag":189,"props":1349,"children":1351},{"className":1350},[],[1352],{"type":51,"value":1353},"prepare",{"type":51,"value":1355}," script",{"type":51,"value":1357}," in the project’s ",{"type":40,"tag":189,"props":1359,"children":1361},{"className":1360},[],[1362],{"type":51,"value":1231},{"type":51,"value":1364}," file to automatically refresh GIT hooks whenever dependencies are installed, ensuring they are updated in each user's environment. If you feel the tool doesn't work, try to run ",{"type":40,"tag":189,"props":1366,"children":1368},{"className":1367},[],[1369],{"type":51,"value":1370},"yarn install",{"type":51,"value":265},{"type":40,"tag":179,"props":1373,"children":1378},{"className":1374,"code":1375,"filename":1231,"highlights":1376,"language":1377,"meta":7,"style":7},"language-json shiki shiki-themes one-dark-pro","{\n  \"scripts\": {\n    \"lint\": \"stylelint **/*.scss && eslint . && phpcs\",\n    \"format\": \"stylelint **/*.scss --fix && eslint . --fix && phpcbf\",\n    \"prepare\": \"husky\"\n  },\n}\n",[477],"json",[1379],{"type":40,"tag":189,"props":1380,"children":1381},{"__ignoreMap":7},[1382,1390,1403,1426,1447,1465,1473],{"type":40,"tag":193,"props":1383,"children":1384},{"class":196,"line":185},[1385],{"type":40,"tag":193,"props":1386,"children":1387},{"style":207},[1388],{"type":51,"value":1389},"{\n",{"type":40,"tag":193,"props":1391,"children":1392},{"class":196,"line":213},[1393,1398],{"type":40,"tag":193,"props":1394,"children":1395},{"style":201},[1396],{"type":51,"value":1397},"  \"scripts\"",{"type":40,"tag":193,"props":1399,"children":1400},{"style":207},[1401],{"type":51,"value":1402},": {\n",{"type":40,"tag":193,"props":1404,"children":1405},{"class":196,"line":233},[1406,1411,1416,1421],{"type":40,"tag":193,"props":1407,"children":1408},{"style":201},[1409],{"type":51,"value":1410},"    \"lint\"",{"type":40,"tag":193,"props":1412,"children":1413},{"style":207},[1414],{"type":51,"value":1415},": ",{"type":40,"tag":193,"props":1417,"children":1418},{"style":279},[1419],{"type":51,"value":1420},"\"stylelint **/*.scss && eslint . && phpcs\"",{"type":40,"tag":193,"props":1422,"children":1423},{"style":207},[1424],{"type":51,"value":1425},",\n",{"type":40,"tag":193,"props":1427,"children":1428},{"class":196,"line":446},[1429,1434,1438,1443],{"type":40,"tag":193,"props":1430,"children":1431},{"style":201},[1432],{"type":51,"value":1433},"    \"format\"",{"type":40,"tag":193,"props":1435,"children":1436},{"style":207},[1437],{"type":51,"value":1415},{"type":40,"tag":193,"props":1439,"children":1440},{"style":279},[1441],{"type":51,"value":1442},"\"stylelint **/*.scss --fix && eslint . --fix && phpcbf\"",{"type":40,"tag":193,"props":1444,"children":1445},{"style":207},[1446],{"type":51,"value":1425},{"type":40,"tag":193,"props":1448,"children":1450},{"class":1449,"line":477},[196,197],[1451,1456,1460],{"type":40,"tag":193,"props":1452,"children":1453},{"style":201},[1454],{"type":51,"value":1455},"    \"prepare\"",{"type":40,"tag":193,"props":1457,"children":1458},{"style":207},[1459],{"type":51,"value":1415},{"type":40,"tag":193,"props":1461,"children":1462},{"style":279},[1463],{"type":51,"value":1464},"\"husky\"\n",{"type":40,"tag":193,"props":1466,"children":1467},{"class":196,"line":507},[1468],{"type":40,"tag":193,"props":1469,"children":1470},{"style":207},[1471],{"type":51,"value":1472},"  },\n",{"type":40,"tag":193,"props":1474,"children":1475},{"class":196,"line":543},[1476],{"type":40,"tag":193,"props":1477,"children":1478},{"style":207},[1479],{"type":51,"value":239},{"type":40,"tag":47,"props":1481,"children":1482},{},[1483,1485,1491,1493,1499],{"type":51,"value":1484},"⚠️ If your .husky directory isn't located in the repository's root, like in my case, when it's placed in ",{"type":40,"tag":189,"props":1486,"children":1488},{"className":1487},[],[1489],{"type":51,"value":1490},"/wp-content/themes/footmate",{"type":51,"value":1492},", you'll need to follow some ",{"type":40,"tag":109,"props":1494,"children":1496},{"href":1495},"#how-to-install-husky-outside-root-directory",[1497],{"type":51,"value":1498},"extra steps",{"type":51,"value":265},{"type":40,"tag":1053,"props":1501,"children":1502},{"height":1055},[],{"type":40,"tag":1058,"props":1504,"children":1506},{"id":1505},"how-to-use-husky",[1507],{"type":51,"value":1508},"How to use husky?",{"type":40,"tag":47,"props":1510,"children":1511},{},[1512,1517,1519,1525],{"type":40,"tag":95,"props":1513,"children":1514},{},[1515],{"type":51,"value":1516},"Stage some incorrect files and try to make a commit.",{"type":51,"value":1518}," The tool should automatically execute the ",{"type":40,"tag":189,"props":1520,"children":1522},{"className":1521},[],[1523],{"type":51,"value":1524},"yarn lint",{"type":51,"value":1526}," command before the commit and prevent it if errors are detected.",{"type":40,"tag":179,"props":1528,"children":1531},{"className":704,"code":1529,"highlights":1530,"language":707,"meta":7,"style":7},"git add .\ngit commit -m \"test commit\"\n\n$ stylelint **/*.scss && eslint . && phpcs\n\nresources/styles/styles.scss\n  1:1  ✖  Expected \"A\" to be \"a\"  selector-type-case\n\n✖ 1 problem (1 error, 0 warnings)\n  1 error potentially fixable with the \"--fix\" option.\n\nerror Command failed with exit code 2.\n",[668],[1532],{"type":40,"tag":189,"props":1533,"children":1534},{"__ignoreMap":7},[1535,1543,1551,1558,1566,1573,1580,1588,1595,1602,1609,1616],{"type":40,"tag":193,"props":1536,"children":1537},{"class":196,"line":185},[1538],{"type":40,"tag":193,"props":1539,"children":1540},{},[1541],{"type":51,"value":1542},"git add .\n",{"type":40,"tag":193,"props":1544,"children":1545},{"class":196,"line":213},[1546],{"type":40,"tag":193,"props":1547,"children":1548},{},[1549],{"type":51,"value":1550},"git commit -m \"test commit\"\n",{"type":40,"tag":193,"props":1552,"children":1553},{"class":196,"line":233},[1554],{"type":40,"tag":193,"props":1555,"children":1556},{"emptyLinePlaceholder":35},[1557],{"type":51,"value":626},{"type":40,"tag":193,"props":1559,"children":1560},{"class":196,"line":446},[1561],{"type":40,"tag":193,"props":1562,"children":1563},{},[1564],{"type":51,"value":1565},"$ stylelint **/*.scss && eslint . && phpcs\n",{"type":40,"tag":193,"props":1567,"children":1568},{"class":196,"line":477},[1569],{"type":40,"tag":193,"props":1570,"children":1571},{"emptyLinePlaceholder":35},[1572],{"type":51,"value":626},{"type":40,"tag":193,"props":1574,"children":1575},{"class":196,"line":507},[1576],{"type":40,"tag":193,"props":1577,"children":1578},{},[1579],{"type":51,"value":734},{"type":40,"tag":193,"props":1581,"children":1582},{"class":196,"line":543},[1583],{"type":40,"tag":193,"props":1584,"children":1585},{},[1586],{"type":51,"value":1587},"  1:1  ✖  Expected \"A\" to be \"a\"  selector-type-case\n",{"type":40,"tag":193,"props":1589,"children":1590},{"class":196,"line":582},[1591],{"type":40,"tag":193,"props":1592,"children":1593},{"emptyLinePlaceholder":35},[1594],{"type":51,"value":626},{"type":40,"tag":193,"props":1596,"children":1597},{"class":196,"line":620},[1598],{"type":40,"tag":193,"props":1599,"children":1600},{},[1601],{"type":51,"value":758},{"type":40,"tag":193,"props":1603,"children":1604},{"class":196,"line":294},[1605],{"type":40,"tag":193,"props":1606,"children":1607},{},[1608],{"type":51,"value":766},{"type":40,"tag":193,"props":1610,"children":1611},{"class":196,"line":660},[1612],{"type":40,"tag":193,"props":1613,"children":1614},{"emptyLinePlaceholder":35},[1615],{"type":51,"value":626},{"type":40,"tag":193,"props":1617,"children":1619},{"class":1618,"line":668},[196,197],[1620],{"type":40,"tag":193,"props":1621,"children":1622},{},[1623],{"type":51,"value":781},{"type":40,"tag":47,"props":1625,"children":1626},{},[1627,1629,1635],{"type":51,"value":1628},"Pushing code with ",{"type":40,"tag":109,"props":1630,"children":1632},{"href":1631},"#when-to-use-lint-staged-and-husky",[1633],{"type":51,"value":1634},"intentionally created problems",{"type":51,"value":1636}," triggers an error, preventing the user from performing the commit. This is what we wanted to achieve.",{"type":40,"tag":58,"props":1638,"children":1639},{},[],{"type":40,"tag":47,"props":1641,"children":1642},{},[1643],{"type":51,"value":1644},"Hi Guys! This article is part of a larger initiative I've been recently putting my heart into 👇",{"type":40,"tag":47,"props":1646,"children":1647},{},[1648],{"type":51,"value":1649},"I've been working on something I’m really proud of - a new eBook all about code linting and formatting in web development. It’s filled with practical tips to help you set up the project environment so your code stays clean, consistent, and free of those annoying little errors.",{"type":40,"tag":47,"props":1651,"children":1652},{},[1653],{"type":40,"tag":95,"props":1654,"children":1655},{},[1656],{"type":51,"value":1657},"The plan is to sell it for $15, but if you're on my newsletter, you’ll get almost 70% discount. Just drop your email below, and you’ll get it for just $5 when it’s ready 🙌",{"type":40,"tag":1659,"props":1660,"children":1661},"newsletter",{},[],{"type":40,"tag":58,"props":1663,"children":1664},{},[],{"type":40,"tag":62,"props":1666,"children":1668},{"id":1667},"whats-lint-staged-and-how-to-use-it",[1669],{"type":51,"value":1670},"What’s lint-staged and how to use it?",{"type":40,"tag":47,"props":1672,"children":1673},{},[1674,1681,1683,1690,1692,1697,1699,1706,1708,1715],{"type":40,"tag":109,"props":1675,"children":1678},{"href":1676,"rel":1677},"https://github.com/lint-staged/lint-staged",[113],[1679],{"type":51,"value":1680},"lint-staged",{"type":51,"value":1682}," is a tool that allows firing actions on staged files in a ",{"type":40,"tag":109,"props":1684,"children":1687},{"href":1685,"rel":1686},"https://git-scm.com/about/staging-area",[113],[1688],{"type":51,"value":1689},"git repository",{"type":51,"value":1691},". ",{"type":40,"tag":95,"props":1693,"children":1694},{},[1695],{"type":51,"value":1696},"It iterates through the files that are going to be comitted and runs specified tasks based on their types.",{"type":51,"value":1698}," For instance, it can be used to ",{"type":40,"tag":109,"props":1700,"children":1703},{"href":1701,"rel":1702},"https://pragmate.dev/environment/linting/#what-are-the-coding-standards:~:text=and%20maintain%20consistency.-,Formatters%3A,-Automatically%20tidy%20up",[113],[1704],{"type":51,"value":1705},"fix formatting issues",{"type":51,"value":1707}," and perform ",{"type":40,"tag":109,"props":1709,"children":1712},{"href":1710,"rel":1711},"https://pragmate.dev/environment/linting/#what-are-the-coding-standards:~:text=linters%20and%20formatters%3A-,Linters%3A,-Analyze%20the%20code",[113],[1713],{"type":51,"value":1714},"syntax checks",{"type":51,"value":1716}," on every JavaScript file that is going to be committed, and block process when errors occurrs.",{"type":40,"tag":47,"props":1718,"children":1719},{},[1720,1722,1727,1729,1734],{"type":51,"value":1721},"Why should you use this tool when you can simply run such a check with ",{"type":40,"tag":109,"props":1723,"children":1725},{"href":1724},"#how-to-use-husky",[1726],{"type":51,"value":998},{"type":51,"value":1728},"? Depending on the complexity of your project, running a full codebase check could take a minutes. ",{"type":40,"tag":95,"props":1730,"children":1731},{},[1732],{"type":51,"value":1733},"lint-staged runs actions only on staged files",{"type":51,"value":1735},", skipping others that might just be drafts, reducing verification time to seconds. It checks only what's added to GIT stage, and that's difference.",{"type":40,"tag":1053,"props":1737,"children":1738},{"height":1055},[],{"type":40,"tag":1058,"props":1740,"children":1742},{"id":1741},"how-to-install-lint-staged",[1743],{"type":51,"value":1744},"How to install lint-staged?",{"type":40,"tag":47,"props":1746,"children":1747},{},[1748,1749,1755,1757,1763],{"type":51,"value":1068},{"type":40,"tag":189,"props":1750,"children":1752},{"className":1751},[],[1753],{"type":51,"value":1754},"yarn add lint-staged --dev",{"type":51,"value":1756},", and create a ",{"type":40,"tag":189,"props":1758,"children":1760},{"className":1759},[],[1761],{"type":51,"value":1762},".lintstagedrc",{"type":51,"value":1764}," file to configure the actions you want to apply to each type of file in the staging area.",{"type":40,"tag":179,"props":1766,"children":1768},{"className":1374,"code":1767,"filename":1762,"language":1377,"meta":7,"style":7},"{\n  \"*.js\": [\n    \"eslint --fix\",\n    \"eslint\"\n  ],\n  \"*.scss\": [\n    \"stylelint --fix\",\n    \"stylelint\"\n  ],\n  \"*.php\": [\n    \"vendor/bin/phpcs\"\n  ]\n}\n",[1769],{"type":40,"tag":189,"props":1770,"children":1771},{"__ignoreMap":7},[1772,1779,1792,1804,1812,1820,1832,1844,1852,1859,1871,1879,1887],{"type":40,"tag":193,"props":1773,"children":1774},{"class":196,"line":185},[1775],{"type":40,"tag":193,"props":1776,"children":1777},{"style":207},[1778],{"type":51,"value":1389},{"type":40,"tag":193,"props":1780,"children":1781},{"class":196,"line":213},[1782,1787],{"type":40,"tag":193,"props":1783,"children":1784},{"style":201},[1785],{"type":51,"value":1786},"  \"*.js\"",{"type":40,"tag":193,"props":1788,"children":1789},{"style":207},[1790],{"type":51,"value":1791},": [\n",{"type":40,"tag":193,"props":1793,"children":1794},{"class":196,"line":233},[1795,1800],{"type":40,"tag":193,"props":1796,"children":1797},{"style":279},[1798],{"type":51,"value":1799},"    \"eslint --fix\"",{"type":40,"tag":193,"props":1801,"children":1802},{"style":207},[1803],{"type":51,"value":1425},{"type":40,"tag":193,"props":1805,"children":1806},{"class":196,"line":446},[1807],{"type":40,"tag":193,"props":1808,"children":1809},{"style":279},[1810],{"type":51,"value":1811},"    \"eslint\"\n",{"type":40,"tag":193,"props":1813,"children":1814},{"class":196,"line":477},[1815],{"type":40,"tag":193,"props":1816,"children":1817},{"style":207},[1818],{"type":51,"value":1819},"  ],\n",{"type":40,"tag":193,"props":1821,"children":1822},{"class":196,"line":507},[1823,1828],{"type":40,"tag":193,"props":1824,"children":1825},{"style":201},[1826],{"type":51,"value":1827},"  \"*.scss\"",{"type":40,"tag":193,"props":1829,"children":1830},{"style":207},[1831],{"type":51,"value":1791},{"type":40,"tag":193,"props":1833,"children":1834},{"class":196,"line":543},[1835,1840],{"type":40,"tag":193,"props":1836,"children":1837},{"style":279},[1838],{"type":51,"value":1839},"    \"stylelint --fix\"",{"type":40,"tag":193,"props":1841,"children":1842},{"style":207},[1843],{"type":51,"value":1425},{"type":40,"tag":193,"props":1845,"children":1846},{"class":196,"line":582},[1847],{"type":40,"tag":193,"props":1848,"children":1849},{"style":279},[1850],{"type":51,"value":1851},"    \"stylelint\"\n",{"type":40,"tag":193,"props":1853,"children":1854},{"class":196,"line":620},[1855],{"type":40,"tag":193,"props":1856,"children":1857},{"style":207},[1858],{"type":51,"value":1819},{"type":40,"tag":193,"props":1860,"children":1861},{"class":196,"line":294},[1862,1867],{"type":40,"tag":193,"props":1863,"children":1864},{"style":201},[1865],{"type":51,"value":1866},"  \"*.php\"",{"type":40,"tag":193,"props":1868,"children":1869},{"style":207},[1870],{"type":51,"value":1791},{"type":40,"tag":193,"props":1872,"children":1873},{"class":196,"line":660},[1874],{"type":40,"tag":193,"props":1875,"children":1876},{"style":279},[1877],{"type":51,"value":1878},"    \"vendor/bin/phpcs\"\n",{"type":40,"tag":193,"props":1880,"children":1881},{"class":196,"line":668},[1882],{"type":40,"tag":193,"props":1883,"children":1884},{"style":207},[1885],{"type":51,"value":1886},"  ]\n",{"type":40,"tag":193,"props":1888,"children":1889},{"class":196,"line":961},[1890],{"type":40,"tag":193,"props":1891,"children":1892},{"style":207},[1893],{"type":51,"value":239},{"type":40,"tag":47,"props":1895,"children":1896},{},[1897,1899,1904,1906,1911,1913,1920],{"type":51,"value":1898},"The setup, for each defined type, first ",{"type":40,"tag":95,"props":1900,"children":1901},{},[1902],{"type":51,"value":1903},"addresses any issues that can be automatically fixed",{"type":51,"value":1905},", reducing your need for manual effort, then ",{"type":40,"tag":95,"props":1907,"children":1908},{},[1909],{"type":51,"value":1910},"reviews the outcomes to identify remaining issues",{"type":51,"value":1912}," that may require manual resolution. The only difference is ",{"type":40,"tag":1914,"props":1915,"children":1917},"button",{"type":1914,"dataModal":1916},"vcIAaGbNlf",[1918],{"type":51,"value":1919},"for PHP",{"type":51,"value":265},{"type":40,"tag":1922,"props":1923,"children":1924},"prose-modal",{"id":1916},[1925],{"type":40,"tag":47,"props":1926,"children":1927},{},[1928,1930,1937,1939,1945,1947,1952,1954,1961,1963,1970],{"type":51,"value":1929},"⚠️ For PHP files, the tool only uses ",{"type":40,"tag":109,"props":1931,"children":1934},{"href":1932,"rel":1933},"https://pragmate.dev/php/phpcs/#how-to-use-php-code-sniffer",[113],[1935],{"type":51,"value":1936},"phpcs",{"type":51,"value":1938}," to review the code and doesn't use ",{"type":40,"tag":109,"props":1940,"children":1942},{"href":1932,"rel":1941},[113],[1943],{"type":51,"value":1944},"phpcbf",{"type":51,"value":1946}," for automatic fixes. It's because ",{"type":40,"tag":189,"props":1948,"children":1950},{"className":1949},[],[1951],{"type":51,"value":1944},{"type":51,"value":1953}," currently has ",{"type":40,"tag":109,"props":1955,"children":1958},{"href":1956,"rel":1957},"https://github.com/squizlabs/PHP_CodeSniffer/issues/3057",[113],[1959],{"type":51,"value":1960},"compatibility issues",{"type":51,"value":1962}," and returns codes that suggest issues even when the code is correct. It should be handled in ",{"type":40,"tag":109,"props":1964,"children":1967},{"href":1965,"rel":1966},"https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/184",[113],[1968],{"type":51,"value":1969},"PHPCS v4",{"type":51,"value":1971}," version.",{"type":40,"tag":1053,"props":1973,"children":1974},{"height":1055},[],{"type":40,"tag":1058,"props":1976,"children":1978},{"id":1977},"how-to-use-lint-staged",[1979],{"type":51,"value":1980},"How to use lint-staged?",{"type":40,"tag":47,"props":1982,"children":1983},{},[1984,1997],{"type":40,"tag":95,"props":1985,"children":1986},{},[1987,1989,1995],{"type":51,"value":1988},"Stage some files and run ",{"type":40,"tag":189,"props":1990,"children":1992},{"className":1991},[],[1993],{"type":51,"value":1994},"yarn lint-staged",{"type":51,"value":1996}," command in the terminal.",{"type":51,"value":1998}," If there are any issues, the process will terminate and show errors that should be handled before proceeding further.",{"type":40,"tag":179,"props":2000,"children":2003},{"className":704,"code":2001,"highlights":2002,"language":707,"meta":7,"style":7},"yarn lint-staged\n\n$ /Users/przemyslawhernik/Sites/fm.tentyp.dev/wp-content/themes/footmate/node_modules/.bin/lint-staged\n✔ Backed up original state in git stash (df692fc)\n⚠ Running tasks for staged files...\n  ❯ .lintstagedrc — 3 files\n    ❯ *.js — 1 file\n      ✖ eslint [KILLED]\n    ❯ *.scss — 1 file\n      ✖ stylelint [KILLED]\n    ❯ *.php — 1 file\n      ✖ phpcs [FAILED]\n↓ Skipped because of errors from tasks.\n✔ Reverting to original state because of errors...\n✔ Cleaning up temporary files...\n",[582,294,668],[2004],{"type":40,"tag":189,"props":2005,"children":2006},{"__ignoreMap":7},[2007,2015,2022,2030,2038,2046,2054,2062,2071,2079,2088,2096,2105,2113,2122],{"type":40,"tag":193,"props":2008,"children":2009},{"class":196,"line":185},[2010],{"type":40,"tag":193,"props":2011,"children":2012},{},[2013],{"type":51,"value":2014},"yarn lint-staged\n",{"type":40,"tag":193,"props":2016,"children":2017},{"class":196,"line":213},[2018],{"type":40,"tag":193,"props":2019,"children":2020},{"emptyLinePlaceholder":35},[2021],{"type":51,"value":626},{"type":40,"tag":193,"props":2023,"children":2024},{"class":196,"line":233},[2025],{"type":40,"tag":193,"props":2026,"children":2027},{},[2028],{"type":51,"value":2029},"$ /Users/przemyslawhernik/Sites/fm.tentyp.dev/wp-content/themes/footmate/node_modules/.bin/lint-staged\n",{"type":40,"tag":193,"props":2031,"children":2032},{"class":196,"line":446},[2033],{"type":40,"tag":193,"props":2034,"children":2035},{},[2036],{"type":51,"value":2037},"✔ Backed up original state in git stash (df692fc)\n",{"type":40,"tag":193,"props":2039,"children":2040},{"class":196,"line":477},[2041],{"type":40,"tag":193,"props":2042,"children":2043},{},[2044],{"type":51,"value":2045},"⚠ Running tasks for staged files...\n",{"type":40,"tag":193,"props":2047,"children":2048},{"class":196,"line":507},[2049],{"type":40,"tag":193,"props":2050,"children":2051},{},[2052],{"type":51,"value":2053},"  ❯ .lintstagedrc — 3 files\n",{"type":40,"tag":193,"props":2055,"children":2056},{"class":196,"line":543},[2057],{"type":40,"tag":193,"props":2058,"children":2059},{},[2060],{"type":51,"value":2061},"    ❯ *.js — 1 file\n",{"type":40,"tag":193,"props":2063,"children":2065},{"class":2064,"line":582},[196,197],[2066],{"type":40,"tag":193,"props":2067,"children":2068},{},[2069],{"type":51,"value":2070},"      ✖ eslint [KILLED]\n",{"type":40,"tag":193,"props":2072,"children":2073},{"class":196,"line":620},[2074],{"type":40,"tag":193,"props":2075,"children":2076},{},[2077],{"type":51,"value":2078},"    ❯ *.scss — 1 file\n",{"type":40,"tag":193,"props":2080,"children":2082},{"class":2081,"line":294},[196,197],[2083],{"type":40,"tag":193,"props":2084,"children":2085},{},[2086],{"type":51,"value":2087},"      ✖ stylelint [KILLED]\n",{"type":40,"tag":193,"props":2089,"children":2090},{"class":196,"line":660},[2091],{"type":40,"tag":193,"props":2092,"children":2093},{},[2094],{"type":51,"value":2095},"    ❯ *.php — 1 file\n",{"type":40,"tag":193,"props":2097,"children":2099},{"class":2098,"line":668},[196,197],[2100],{"type":40,"tag":193,"props":2101,"children":2102},{},[2103],{"type":51,"value":2104},"      ✖ phpcs [FAILED]\n",{"type":40,"tag":193,"props":2106,"children":2107},{"class":196,"line":961},[2108],{"type":40,"tag":193,"props":2109,"children":2110},{},[2111],{"type":51,"value":2112},"↓ Skipped because of errors from tasks.\n",{"type":40,"tag":193,"props":2114,"children":2116},{"class":196,"line":2115},14,[2117],{"type":40,"tag":193,"props":2118,"children":2119},{},[2120],{"type":51,"value":2121},"✔ Reverting to original state because of errors...\n",{"type":40,"tag":193,"props":2123,"children":2125},{"class":196,"line":2124},15,[2126],{"type":40,"tag":193,"props":2127,"children":2128},{},[2129],{"type":51,"value":2130},"✔ Cleaning up temporary files...\n",{"type":40,"tag":47,"props":2132,"children":2133},{},[2134,2136,2141],{"type":51,"value":2135},"The command has verified all staged files and run linting checks. While it works, there's a catch. In this example, ",{"type":40,"tag":189,"props":2137,"children":2139},{"className":2138},[],[2140],{"type":51,"value":1994},{"type":51,"value":2142}," was fired manually, raising the usual concerns, like forgetting about this step. That’s where husky helps.",{"type":40,"tag":58,"props":2144,"children":2145},{},[],{"type":40,"tag":62,"props":2147,"children":2149},{"id":2148},"how-to-use-husky-with-lint-staged",[2150],{"type":51,"value":2151},"How to use husky with lint-staged?",{"type":40,"tag":47,"props":2153,"children":2154},{},[2155],{"type":51,"value":2156},"For optimal results, it's crucial to integrate husky and lint-staged together. This way, you won't forget to check the staged files for compliance with the defined coding standards, since it will be handled automatically by husky before you make a commit.",{"type":40,"tag":47,"props":2158,"children":2159},{},[2160,2162,2167,2169,2174,2176,2181,2183],{"type":51,"value":2161},"Modify the ",{"type":40,"tag":189,"props":2163,"children":2165},{"className":2164},[],[2166],{"type":51,"value":1253},{"type":51,"value":2168}," file and switch from ",{"type":40,"tag":189,"props":2170,"children":2172},{"className":2171},[],[2173],{"type":51,"value":1524},{"type":51,"value":2175}," to ",{"type":40,"tag":189,"props":2177,"children":2179},{"className":2178},[],[2180],{"type":51,"value":1994},{"type":51,"value":2182}," command there. ",{"type":40,"tag":95,"props":2184,"children":2185},{},[2186],{"type":51,"value":2187},"This will tell husky to run the linting process only on staged files, rather than the entire codebase, cutting down the time spent on verification.",{"type":40,"tag":179,"props":2189,"children":2191},{"className":704,"code":2014,"filename":1253,"highlights":2190,"language":707,"meta":7,"style":7},[185],[2192],{"type":40,"tag":189,"props":2193,"children":2194},{"__ignoreMap":7},[2195],{"type":40,"tag":193,"props":2196,"children":2198},{"class":2197,"line":185},[196,197],[2199],{"type":40,"tag":193,"props":2200,"children":2201},{},[2202],{"type":51,"value":2014},{"type":40,"tag":47,"props":2204,"children":2205},{},[2206],{"type":51,"value":2207},"Add the files that contain erors to the stage and try to make a commit to see if it works.",{"type":40,"tag":179,"props":2209,"children":2212},{"className":704,"code":2210,"highlights":2211,"language":707,"meta":7,"style":7},"git add .\n\n✗ git commit -m \"test commit\"\n✔ Backed up original state in git stash (38dea9d)\n⚠ Running tasks for staged files...\n  ❯ .lintstagedrc — 3 files\n    ❯ *.js — 1 file\n      ✖ eslint [KILLED]\n    ❯ *.scss — 1 file\n      ✖ stylelint [KILLED]\n    ❯ *.php — 1 file\n      ✖ phpcs [FAILED]\n↓ Skipped because of errors from tasks.\n✔ Reverting to original state because of errors...\n✔ Cleaning up temporary files...\n",[543,620,660],[2213],{"type":40,"tag":189,"props":2214,"children":2215},{"__ignoreMap":7},[2216,2223,2230,2238,2246,2253,2260,2268,2275,2283,2290,2298,2305,2312,2319],{"type":40,"tag":193,"props":2217,"children":2218},{"class":196,"line":185},[2219],{"type":40,"tag":193,"props":2220,"children":2221},{},[2222],{"type":51,"value":1542},{"type":40,"tag":193,"props":2224,"children":2225},{"class":196,"line":213},[2226],{"type":40,"tag":193,"props":2227,"children":2228},{"emptyLinePlaceholder":35},[2229],{"type":51,"value":626},{"type":40,"tag":193,"props":2231,"children":2232},{"class":196,"line":233},[2233],{"type":40,"tag":193,"props":2234,"children":2235},{},[2236],{"type":51,"value":2237},"✗ git commit -m \"test commit\"\n",{"type":40,"tag":193,"props":2239,"children":2240},{"class":196,"line":446},[2241],{"type":40,"tag":193,"props":2242,"children":2243},{},[2244],{"type":51,"value":2245},"✔ Backed up original state in git stash (38dea9d)\n",{"type":40,"tag":193,"props":2247,"children":2248},{"class":196,"line":477},[2249],{"type":40,"tag":193,"props":2250,"children":2251},{},[2252],{"type":51,"value":2045},{"type":40,"tag":193,"props":2254,"children":2255},{"class":196,"line":507},[2256],{"type":40,"tag":193,"props":2257,"children":2258},{},[2259],{"type":51,"value":2053},{"type":40,"tag":193,"props":2261,"children":2263},{"class":2262,"line":543},[196,197],[2264],{"type":40,"tag":193,"props":2265,"children":2266},{},[2267],{"type":51,"value":2061},{"type":40,"tag":193,"props":2269,"children":2270},{"class":196,"line":582},[2271],{"type":40,"tag":193,"props":2272,"children":2273},{},[2274],{"type":51,"value":2070},{"type":40,"tag":193,"props":2276,"children":2278},{"class":2277,"line":620},[196,197],[2279],{"type":40,"tag":193,"props":2280,"children":2281},{},[2282],{"type":51,"value":2078},{"type":40,"tag":193,"props":2284,"children":2285},{"class":196,"line":294},[2286],{"type":40,"tag":193,"props":2287,"children":2288},{},[2289],{"type":51,"value":2087},{"type":40,"tag":193,"props":2291,"children":2293},{"class":2292,"line":660},[196,197],[2294],{"type":40,"tag":193,"props":2295,"children":2296},{},[2297],{"type":51,"value":2095},{"type":40,"tag":193,"props":2299,"children":2300},{"class":196,"line":668},[2301],{"type":40,"tag":193,"props":2302,"children":2303},{},[2304],{"type":51,"value":2104},{"type":40,"tag":193,"props":2306,"children":2307},{"class":196,"line":961},[2308],{"type":40,"tag":193,"props":2309,"children":2310},{},[2311],{"type":51,"value":2112},{"type":40,"tag":193,"props":2313,"children":2314},{"class":196,"line":2115},[2315],{"type":40,"tag":193,"props":2316,"children":2317},{},[2318],{"type":51,"value":2121},{"type":40,"tag":193,"props":2320,"children":2321},{"class":196,"line":2124},[2322],{"type":40,"tag":193,"props":2323,"children":2324},{},[2325],{"type":51,"value":2130},{"type":40,"tag":47,"props":2327,"children":2328},{},[2329,2331],{"type":51,"value":2330},"It works! Before approving the commit, this tool fixes simple issues and highlight those that need manual resolution. Once these are resolved, the commit will be approved and the updated code pushed to the repository. ",{"type":40,"tag":95,"props":2332,"children":2333},{},[2334],{"type":51,"value":2335},"Otherwise, the tool will block a commit ensuring the code with problems won't be pushed to the repository.",{"type":40,"tag":179,"props":2337,"children":2339},{"className":704,"code":2338,"language":707,"meta":7,"style":7},"git commit -m \"test commit\"\n\n✔ Backed up original state in git stash (fd439bb)\n✔ Running tasks for staged files...\n✔ Applying modifications from tasks...\n✔ Cleaning up temporary files...\n✨  Done in 1.36s.\n\n[feature/theme-updates cec3ae1] test commit\n 2 files changed, 5 insertions(+)\n",[2340],{"type":40,"tag":189,"props":2341,"children":2342},{"__ignoreMap":7},[2343,2350,2357,2365,2373,2381,2388,2396,2403,2411],{"type":40,"tag":193,"props":2344,"children":2345},{"class":196,"line":185},[2346],{"type":40,"tag":193,"props":2347,"children":2348},{},[2349],{"type":51,"value":1550},{"type":40,"tag":193,"props":2351,"children":2352},{"class":196,"line":213},[2353],{"type":40,"tag":193,"props":2354,"children":2355},{"emptyLinePlaceholder":35},[2356],{"type":51,"value":626},{"type":40,"tag":193,"props":2358,"children":2359},{"class":196,"line":233},[2360],{"type":40,"tag":193,"props":2361,"children":2362},{},[2363],{"type":51,"value":2364},"✔ Backed up original state in git stash (fd439bb)\n",{"type":40,"tag":193,"props":2366,"children":2367},{"class":196,"line":446},[2368],{"type":40,"tag":193,"props":2369,"children":2370},{},[2371],{"type":51,"value":2372},"✔ Running tasks for staged files...\n",{"type":40,"tag":193,"props":2374,"children":2375},{"class":196,"line":477},[2376],{"type":40,"tag":193,"props":2377,"children":2378},{},[2379],{"type":51,"value":2380},"✔ Applying modifications from tasks...\n",{"type":40,"tag":193,"props":2382,"children":2383},{"class":196,"line":507},[2384],{"type":40,"tag":193,"props":2385,"children":2386},{},[2387],{"type":51,"value":2130},{"type":40,"tag":193,"props":2389,"children":2390},{"class":196,"line":543},[2391],{"type":40,"tag":193,"props":2392,"children":2393},{},[2394],{"type":51,"value":2395},"✨  Done in 1.36s.\n",{"type":40,"tag":193,"props":2397,"children":2398},{"class":196,"line":582},[2399],{"type":40,"tag":193,"props":2400,"children":2401},{"emptyLinePlaceholder":35},[2402],{"type":51,"value":626},{"type":40,"tag":193,"props":2404,"children":2405},{"class":196,"line":620},[2406],{"type":40,"tag":193,"props":2407,"children":2408},{},[2409],{"type":51,"value":2410},"[feature/theme-updates cec3ae1] test commit\n",{"type":40,"tag":193,"props":2412,"children":2413},{"class":196,"line":294},[2414],{"type":40,"tag":193,"props":2415,"children":2416},{},[2417],{"type":51,"value":2418}," 2 files changed, 5 insertions(+)\n",{"type":40,"tag":58,"props":2420,"children":2421},{},[],{"type":40,"tag":62,"props":2423,"children":2425},{"id":2424},"how-husky-lint-staged-improve-workflow-at-coditive-team",[2426],{"type":51,"value":2427},"How husky & lint-staged improve workflow at Coditive team?",{"type":40,"tag":47,"props":2429,"children":2430},{},[2431,2433,2440,2442,2447],{"type":51,"value":2432},"After integrating this tool into ",{"type":40,"tag":109,"props":2434,"children":2437},{"href":2435,"rel":2436},"https://coditive.com/?utm_source=www&utm_medium=content&utm_campaign=pragmate_dev",[113],[2438],{"type":51,"value":2439},"coditive",{"type":51,"value":2441}," workflow, ",{"type":40,"tag":95,"props":2443,"children":2444},{},[2445],{"type":51,"value":2446},"we effectively eliminated simple, repeatable issues, significantly easing the team's workload",{"type":51,"value":2448},", particularly during pull requests. This allows the team to focus on more critical tasks and return to code review without spending time addressing minor problems. That was a huge improvement.",{"type":40,"tag":47,"props":2450,"children":2451},{},[2452,2454,2460,2461,2467,2468,2473,2477],{"type":51,"value":2453},"An important takeaway from our experience is that catching errors as you write minimizes the irritation of fixing issues when you're ready to commit changes. That's why it's beneficial to integrate your project's linters directly within your code editor. Here are some guides for the most popular tools we rely on: ",{"type":40,"tag":109,"props":2455,"children":2458},{"href":2456,"rel":2457},"https://pragmate.dev/php/phpcs/#how-to-use-php-code-sniffer-with-vs-code",[113],[2459],{"type":51,"value":134},{"type":51,"value":1239},{"type":40,"tag":109,"props":2462,"children":2465},{"href":2463,"rel":2464},"https://pragmate.dev/js/eslint/#how-to-integrate-eslint-with-vs-code",[113],[2466],{"type":51,"value":116},{"type":51,"value":1239},{"type":40,"tag":109,"props":2469,"children":2471},{"href":121,"rel":2470},[113],[2472],{"type":51,"value":125},{"type":40,"tag":109,"props":2474,"children":2476},{"href":2463,"rel":2475},[113],[],{"type":51,"value":265},{"type":40,"tag":58,"props":2479,"children":2480},{},[],{"type":40,"tag":62,"props":2482,"children":2484},{"id":2483},"tips-tricks-about-husky-lint-staged",[2485],{"type":51,"value":2486},"Tips & tricks about husky & lint-staged",{"type":40,"tag":47,"props":2488,"children":2489},{},[2490],{"type":51,"value":2491},"Below you can find some useful tips and tricks when working with husky and lint-staged.",{"type":40,"tag":1053,"props":2493,"children":2494},{"height":1055},[],{"type":40,"tag":1058,"props":2496,"children":2498},{"id":2497},"how-to-skip-code-checks-in-commit",[2499],{"type":51,"value":2500},"How to skip code checks in commit?",{"type":40,"tag":47,"props":2502,"children":2503},{},[2504,2506],{"type":51,"value":2505},"Sometimes, you might find yourself needing to push code that isn’t quite right. Maybe you’re in a hurry and can’t afford to delay your changes. Thankfully, there's a way to do this without changing your entire setup. ",{"type":40,"tag":95,"props":2507,"children":2508},{},[2509,2511,2517],{"type":51,"value":2510},"By using the ",{"type":40,"tag":189,"props":2512,"children":2514},{"className":2513},[],[2515],{"type":51,"value":2516},"--no-verify",{"type":51,"value":2518}," flag during a commit, you can bypass any git hooks, preventing code checks from running.",{"type":40,"tag":179,"props":2520,"children":2522},{"className":1308,"code":2521,"language":1310,"meta":7,"style":7},"git commit -m \"commit message\" --no-verify\n",[2523],{"type":40,"tag":189,"props":2524,"children":2525},{"__ignoreMap":7},[2526],{"type":40,"tag":193,"props":2527,"children":2528},{"class":196,"line":185},[2529,2534,2539,2544,2549],{"type":40,"tag":193,"props":2530,"children":2531},{"style":268},[2532],{"type":51,"value":2533},"git",{"type":40,"tag":193,"props":2535,"children":2536},{"style":279},[2537],{"type":51,"value":2538}," commit",{"type":40,"tag":193,"props":2540,"children":2541},{"style":222},[2542],{"type":51,"value":2543}," -m",{"type":40,"tag":193,"props":2545,"children":2546},{"style":279},[2547],{"type":51,"value":2548}," \"commit message\"",{"type":40,"tag":193,"props":2550,"children":2551},{"style":222},[2552],{"type":51,"value":2553}," --no-verify\n",{"type":40,"tag":1053,"props":2555,"children":2556},{"height":1055},[],{"type":40,"tag":1058,"props":2558,"children":2560},{"id":2559},"how-to-install-husky-outside-rroot-directory",[2561],{"type":51,"value":2562},"How to install husky outside Rroot directory?",{"type":40,"tag":47,"props":2564,"children":2565},{},[2566,2568,2573,2575,2581],{"type":51,"value":2567},"First, you need to change the working directory before running the tasks defined in the hooks. Simply modify the ",{"type":40,"tag":189,"props":2569,"children":2571},{"className":2570},[],[2572],{"type":51,"value":1253},{"type":51,"value":2574}," file and switch the directory with the ",{"type":40,"tag":189,"props":2576,"children":2578},{"className":2577},[],[2579],{"type":51,"value":2580},"cd",{"type":51,"value":2582}," command.",{"type":40,"tag":179,"props":2584,"children":2588},{"className":704,"code":2585,"filename":2586,"highlights":2587,"language":707,"meta":7,"style":7},"cd wp-content/themes/footmate\nyarn lint\n","/wp-content/themes/footmate/.husky/pre-commit",[185],[2589],{"type":40,"tag":189,"props":2590,"children":2591},{"__ignoreMap":7},[2592,2601],{"type":40,"tag":193,"props":2593,"children":2595},{"class":2594,"line":185},[196,197],[2596],{"type":40,"tag":193,"props":2597,"children":2598},{},[2599],{"type":51,"value":2600},"cd wp-content/themes/footmate\n",{"type":40,"tag":193,"props":2602,"children":2603},{"class":196,"line":213},[2604],{"type":40,"tag":193,"props":2605,"children":2606},{},[2607],{"type":51,"value":1252},{"type":40,"tag":47,"props":2609,"children":2610},{},[2611,2613,2618,2620,2625],{"type":51,"value":2612},"Second, we need to adjust the ",{"type":40,"tag":189,"props":2614,"children":2616},{"className":2615},[],[2617],{"type":51,"value":1353},{"type":51,"value":2619}," script in the ",{"type":40,"tag":189,"props":2621,"children":2623},{"className":2622},[],[2624],{"type":51,"value":1231},{"type":51,"value":2626}," file, which we created earlier, to initialize the GIT hooks with actions defined in a custom, non-root directory.",{"type":40,"tag":179,"props":2628,"children":2632},{"className":1374,"code":2629,"filename":2630,"highlights":2631,"language":1377,"meta":7,"style":7},"{\n  \"scripts\": {\n    \"lint\": \"stylelint **/*.scss && eslint . && phpcs\",\n    \"format\": \"stylelint **/*.scss --fix && eslint . --fix && phpcbf\",\n    \"prepare\": \"cd ../../.. && husky wp-content/themes/footmate/.husky\"\n  },\n}\n","/wp-content/themes/footmate/package.json",[477],[2633],{"type":40,"tag":189,"props":2634,"children":2635},{"__ignoreMap":7},[2636,2643,2654,2673,2692,2709,2716],{"type":40,"tag":193,"props":2637,"children":2638},{"class":196,"line":185},[2639],{"type":40,"tag":193,"props":2640,"children":2641},{"style":207},[2642],{"type":51,"value":1389},{"type":40,"tag":193,"props":2644,"children":2645},{"class":196,"line":213},[2646,2650],{"type":40,"tag":193,"props":2647,"children":2648},{"style":201},[2649],{"type":51,"value":1397},{"type":40,"tag":193,"props":2651,"children":2652},{"style":207},[2653],{"type":51,"value":1402},{"type":40,"tag":193,"props":2655,"children":2656},{"class":196,"line":233},[2657,2661,2665,2669],{"type":40,"tag":193,"props":2658,"children":2659},{"style":201},[2660],{"type":51,"value":1410},{"type":40,"tag":193,"props":2662,"children":2663},{"style":207},[2664],{"type":51,"value":1415},{"type":40,"tag":193,"props":2666,"children":2667},{"style":279},[2668],{"type":51,"value":1420},{"type":40,"tag":193,"props":2670,"children":2671},{"style":207},[2672],{"type":51,"value":1425},{"type":40,"tag":193,"props":2674,"children":2675},{"class":196,"line":446},[2676,2680,2684,2688],{"type":40,"tag":193,"props":2677,"children":2678},{"style":201},[2679],{"type":51,"value":1433},{"type":40,"tag":193,"props":2681,"children":2682},{"style":207},[2683],{"type":51,"value":1415},{"type":40,"tag":193,"props":2685,"children":2686},{"style":279},[2687],{"type":51,"value":1442},{"type":40,"tag":193,"props":2689,"children":2690},{"style":207},[2691],{"type":51,"value":1425},{"type":40,"tag":193,"props":2693,"children":2695},{"class":2694,"line":477},[196,197],[2696,2700,2704],{"type":40,"tag":193,"props":2697,"children":2698},{"style":201},[2699],{"type":51,"value":1455},{"type":40,"tag":193,"props":2701,"children":2702},{"style":207},[2703],{"type":51,"value":1415},{"type":40,"tag":193,"props":2705,"children":2706},{"style":279},[2707],{"type":51,"value":2708},"\"cd ../../.. && husky wp-content/themes/footmate/.husky\"\n",{"type":40,"tag":193,"props":2710,"children":2711},{"class":196,"line":507},[2712],{"type":40,"tag":193,"props":2713,"children":2714},{"style":207},[2715],{"type":51,"value":1472},{"type":40,"tag":193,"props":2717,"children":2718},{"class":196,"line":543},[2719],{"type":40,"tag":193,"props":2720,"children":2721},{"style":207},[2722],{"type":51,"value":239},{"type":40,"tag":47,"props":2724,"children":2725},{},[2726,2728,2733,2735,2740,2742,2747],{"type":51,"value":2727},"GIT hooks are triggered from the repository's root, so in the ",{"type":40,"tag":189,"props":2729,"children":2731},{"className":2730},[],[2732],{"type":51,"value":1353},{"type":51,"value":2734}," script, we need to first navigate to the root and run ",{"type":40,"tag":189,"props":2736,"children":2738},{"className":2737},[],[2739],{"type":51,"value":998},{"type":51,"value":2741},", specifying the custom directory. After changes, run the ",{"type":40,"tag":189,"props":2743,"children":2745},{"className":2744},[],[2746],{"type":51,"value":1370},{"type":51,"value":2748}," script to ensure the updates are reflected in the GIT hooks.",{"type":40,"tag":1053,"props":2750,"children":2751},{"height":1055},[],{"type":40,"tag":1058,"props":2753,"children":2755},{"id":2754},"lefthook-a-promising-alternative",[2756],{"type":51,"value":2757},"Lefthook: A promising alternative",{"type":40,"tag":47,"props":2759,"children":2760},{},[2761,2763,2768,2769,2774,2776,2783],{"type":51,"value":2762},"While writing this article, I came across a promising alternative to ",{"type":40,"tag":109,"props":2764,"children":2766},{"href":994,"rel":2765},[113],[2767],{"type":51,"value":998},{"type":51,"value":1076},{"type":40,"tag":109,"props":2770,"children":2772},{"href":1676,"rel":2771},[113],[2773],{"type":51,"value":1680},{"type":51,"value":2775}," called ",{"type":40,"tag":109,"props":2777,"children":2780},{"href":2778,"rel":2779},"https://github.com/evilmartians/lefthook",[113],[2781],{"type":51,"value":2782},"Lefthook",{"type":51,"value":2784},". It combines the advantages and core functionalities of both tools, minimizing project dependencies. This is worth giving a try, and I plan to explore it further.",{"type":40,"tag":47,"props":2786,"children":2787},{},[2788],{"type":40,"tag":2789,"props":2790,"children":2793},"img",{"alt":2791,"src":2792},"Image","https://cdn.pragmate.dev/wp-content/uploads/2025/03/fb6860f7-8421-48ef-a425-b7e235ae1a3d.png",[],{"type":40,"tag":58,"props":2795,"children":2796},{},[],{"type":40,"tag":47,"props":2798,"children":2799},{},[2800,2802,2809,2811,2817],{"type":51,"value":2801},"Thank you so much for joining me in today ❤️ Your support means a lot to me, and it keeps me motivated to create more content. If you enjoyed this video, please consider ",{"type":40,"tag":109,"props":2803,"children":2806},{"href":2804,"rel":2805},"https://www.youtube.com/@pragmatedev?sub_confirmation=1",[113],[2807],{"type":51,"value":2808},"subscribing to the channel",{"type":51,"value":2810}," and giving it a thumbs-up - it really helps spread the word. And if you need developers who truly care about quality and delivering great results, visit my company’s site: ",{"type":40,"tag":109,"props":2812,"children":2814},{"href":2435,"rel":2813},[113],[2815],{"type":51,"value":2816},"coditive.com",{"type":51,"value":2818}," or contact me with the form below. Thanks again and see you next time!",{"type":40,"tag":2820,"props":2821,"children":2822},"style",{},[2823],{"type":51,"value":2824},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":7,"searchDepth":213,"depth":213,"links":2826},[2827,2828,2829,2833,2837,2838,2839],{"id":64,"depth":213,"text":67},{"id":164,"depth":213,"text":167},{"id":985,"depth":213,"text":988,"children":2830},[2831,2832],{"id":1060,"depth":233,"text":1063},{"id":1505,"depth":233,"text":1508},{"id":1667,"depth":213,"text":1670,"children":2834},[2835,2836],{"id":1741,"depth":233,"text":1744},{"id":1977,"depth":233,"text":1980},{"id":2148,"depth":213,"text":2151},{"id":2424,"depth":213,"text":2427},{"id":2483,"depth":213,"text":2486,"children":2840},[2841,2842,2843],{"id":2497,"depth":233,"text":2500},{"id":2559,"depth":233,"text":2562},{"id":2754,"depth":233,"text":2757},"markdown","content:environment:lint-staged-husky.md","content","environment/lint-staged-husky.md","environment/lint-staged-husky","md",{"_path":2851,"_dir":246,"_draft":6,"_partial":6,"_locale":7,"title":2852,"description":2853,"head":2854,"tags":2865,"links":2867,"chapters":2870,"created":2862,"thumb":189,"body":2872,"_type":2844,"_id":5360,"_source":2846,"_file":5361,"_stem":5362,"_extension":2849},"/js/eslint","ESLint: Setting Up From Start to Finish","In this article, I'll discuss ESLint, the tool that ensures your JavaScript code remains consistent and clean. I'll guide you through setting it up, customizing its behavior, and integrating it with Prettier and VS Code. ",{"title":2855,"link":2856,"meta":2858},"ESLint: Setting Up From Start to Finish | pragmate.dev",[2857],{"rel":14,"href":111},[2859,2860,2861,2863],{"name":18,"content":19},{"name":21,"content":22},{"name":24,"content":2862},"2024-06-06",{"name":27,"content":2864},"https://cdn.pragmate.dev/wp-content/uploads/2024/06/a5ade8cc-cd63-4bdf-ac24-f1e0745fc2fc.jpg",{"time":2866,"level":31},"10 min",{"github":2868,"solution":2869},"https://github.com/pragmatedev/vilare/pull/21/files","#how-to-use-eslint",[149,2871],"/js/eslint-standards/",{"type":37,"children":2873,"toc":5351},[2874,2878,2888,2893,2896,2899,2905,2915,2940,2954,3138,3141,3147,3161,3439,3468,3724,3742,3810,3820,3832,3952,3955,3961,4012,4129,4148,4474,4477,4483,4509,4692,4705,4708,4712,4716,4723,4726,4729,4735,4771,4774,4777,4783,4797,4804,4817,4820,4826,4836,4956,4968,4975,5012,5319,5322,5347],{"type":40,"tag":41,"props":2875,"children":2877},{"thumbnail":2864,"url":2876},"https://www.youtube-nocookie.com/embed/uOcJqRGAWAA",[],{"type":40,"tag":47,"props":2879,"children":2880},{},[2881,2883],{"type":51,"value":2882},"ESLint is a powerful tool designed to keep your JavaScript code clean, error-free, and consistent. Its value of ESLint lies in its ability to enhance code quality, readability, and maintainability. ",{"type":40,"tag":95,"props":2884,"children":2885},{},[2886],{"type":51,"value":2887},"By catching errors early and promoting best project's practices, ESLint can save you time and help maintain high standards in your JavaScript development.",{"type":40,"tag":47,"props":2889,"children":2890},{},[2891],{"type":51,"value":2892},"In this article, I'll discuss ESLint, the tool that ensures your JavaScript code remains consistent and clean. I'll guide you through setting it up, customizing its behavior, and integrating it with Prettier and VS Code.",{"type":40,"tag":54,"props":2894,"children":2895},{},[],{"type":40,"tag":58,"props":2897,"children":2898},{},[],{"type":40,"tag":62,"props":2900,"children":2902},{"id":2901},"how-to-install-eslint",[2903],{"type":51,"value":2904},"How to Install ESLint?",{"type":40,"tag":47,"props":2906,"children":2907},{},[2908,2913],{"type":40,"tag":95,"props":2909,"children":2910},{},[2911],{"type":51,"value":2912},"You can install and configure ESLint by running the following command",{"type":51,"value":2914}," that fires the setup process and prompts you with a few questions about the required config.",{"type":40,"tag":179,"props":2916,"children":2918},{"className":1308,"code":2917,"language":1310,"meta":7,"style":7},"npm init @eslint/config@latest\n",[2919],{"type":40,"tag":189,"props":2920,"children":2921},{"__ignoreMap":7},[2922],{"type":40,"tag":193,"props":2923,"children":2924},{"class":196,"line":185},[2925,2930,2935],{"type":40,"tag":193,"props":2926,"children":2927},{"style":268},[2928],{"type":51,"value":2929},"npm",{"type":40,"tag":193,"props":2931,"children":2932},{"style":279},[2933],{"type":51,"value":2934}," init",{"type":40,"tag":193,"props":2936,"children":2937},{"style":279},[2938],{"type":51,"value":2939}," @eslint/config@latest\n",{"type":40,"tag":47,"props":2941,"children":2942},{},[2943,2945,2952],{"type":51,"value":2944},"We are developing a classic browser app using ESM modules (you might want to ",{"type":40,"tag":109,"props":2946,"children":2949},{"href":2947,"rel":2948},"https://pragmate.dev/wordpress/vite/integration/",[113],[2950],{"type":51,"value":2951},"check out our Vite setup guide",{"type":51,"value":2953},") so we select those options and the tool will install the required packages and create a basic configuration file which looks like here.",{"type":40,"tag":179,"props":2955,"children":2958},{"className":242,"code":2956,"filename":2957,"language":246,"meta":7,"style":7},"import globals from \"globals\";\nimport standard from \"@eslint/js\";\n\nexport default [\n  standard.configs.recommended,\n  {\n    languageOptions: {\n      globals: globals.browser\n    },\n  },\n];\n\n","eslint.config.js",[2959],{"type":40,"tag":189,"props":2960,"children":2961},{"__ignoreMap":7},[2962,2989,3014,3021,3039,3069,3077,3089,3115,3123,3130],{"type":40,"tag":193,"props":2963,"children":2964},{"class":196,"line":185},[2965,2970,2975,2980,2985],{"type":40,"tag":193,"props":2966,"children":2967},{"style":672},[2968],{"type":51,"value":2969},"import",{"type":40,"tag":193,"props":2971,"children":2972},{"style":201},[2973],{"type":51,"value":2974}," globals",{"type":40,"tag":193,"props":2976,"children":2977},{"style":672},[2978],{"type":51,"value":2979}," from",{"type":40,"tag":193,"props":2981,"children":2982},{"style":279},[2983],{"type":51,"value":2984}," \"globals\"",{"type":40,"tag":193,"props":2986,"children":2987},{"style":207},[2988],{"type":51,"value":230},{"type":40,"tag":193,"props":2990,"children":2991},{"class":196,"line":213},[2992,2996,3001,3005,3010],{"type":40,"tag":193,"props":2993,"children":2994},{"style":672},[2995],{"type":51,"value":2969},{"type":40,"tag":193,"props":2997,"children":2998},{"style":201},[2999],{"type":51,"value":3000}," standard",{"type":40,"tag":193,"props":3002,"children":3003},{"style":672},[3004],{"type":51,"value":2979},{"type":40,"tag":193,"props":3006,"children":3007},{"style":279},[3008],{"type":51,"value":3009}," \"@eslint/js\"",{"type":40,"tag":193,"props":3011,"children":3012},{"style":207},[3013],{"type":51,"value":230},{"type":40,"tag":193,"props":3015,"children":3016},{"class":196,"line":233},[3017],{"type":40,"tag":193,"props":3018,"children":3019},{"emptyLinePlaceholder":35},[3020],{"type":51,"value":626},{"type":40,"tag":193,"props":3022,"children":3023},{"class":196,"line":446},[3024,3029,3034],{"type":40,"tag":193,"props":3025,"children":3026},{"style":672},[3027],{"type":51,"value":3028},"export",{"type":40,"tag":193,"props":3030,"children":3031},{"style":672},[3032],{"type":51,"value":3033}," default",{"type":40,"tag":193,"props":3035,"children":3036},{"style":207},[3037],{"type":51,"value":3038}," [\n",{"type":40,"tag":193,"props":3040,"children":3041},{"class":196,"line":477},[3042,3047,3051,3056,3060,3065],{"type":40,"tag":193,"props":3043,"children":3044},{"style":257},[3045],{"type":51,"value":3046},"  standard",{"type":40,"tag":193,"props":3048,"children":3049},{"style":207},[3050],{"type":51,"value":265},{"type":40,"tag":193,"props":3052,"children":3053},{"style":257},[3054],{"type":51,"value":3055},"configs",{"type":40,"tag":193,"props":3057,"children":3058},{"style":207},[3059],{"type":51,"value":265},{"type":40,"tag":193,"props":3061,"children":3062},{"style":201},[3063],{"type":51,"value":3064},"recommended",{"type":40,"tag":193,"props":3066,"children":3067},{"style":207},[3068],{"type":51,"value":1425},{"type":40,"tag":193,"props":3070,"children":3071},{"class":196,"line":507},[3072],{"type":40,"tag":193,"props":3073,"children":3074},{"style":207},[3075],{"type":51,"value":3076},"  {\n",{"type":40,"tag":193,"props":3078,"children":3079},{"class":196,"line":543},[3080,3085],{"type":40,"tag":193,"props":3081,"children":3082},{"style":201},[3083],{"type":51,"value":3084},"    languageOptions",{"type":40,"tag":193,"props":3086,"children":3087},{"style":207},[3088],{"type":51,"value":1402},{"type":40,"tag":193,"props":3090,"children":3091},{"class":196,"line":582},[3092,3097,3101,3106,3110],{"type":40,"tag":193,"props":3093,"children":3094},{"style":201},[3095],{"type":51,"value":3096},"      globals",{"type":40,"tag":193,"props":3098,"children":3099},{"style":207},[3100],{"type":51,"value":1415},{"type":40,"tag":193,"props":3102,"children":3103},{"style":257},[3104],{"type":51,"value":3105},"globals",{"type":40,"tag":193,"props":3107,"children":3108},{"style":207},[3109],{"type":51,"value":265},{"type":40,"tag":193,"props":3111,"children":3112},{"style":201},[3113],{"type":51,"value":3114},"browser\n",{"type":40,"tag":193,"props":3116,"children":3117},{"class":196,"line":620},[3118],{"type":40,"tag":193,"props":3119,"children":3120},{"style":207},[3121],{"type":51,"value":3122},"    },\n",{"type":40,"tag":193,"props":3124,"children":3125},{"class":196,"line":294},[3126],{"type":40,"tag":193,"props":3127,"children":3128},{"style":207},[3129],{"type":51,"value":1472},{"type":40,"tag":193,"props":3131,"children":3132},{"class":196,"line":660},[3133],{"type":40,"tag":193,"props":3134,"children":3135},{"style":207},[3136],{"type":51,"value":3137},"];\n",{"type":40,"tag":58,"props":3139,"children":3140},{},[],{"type":40,"tag":62,"props":3142,"children":3144},{"id":3143},"how-to-use-eslint",[3145],{"type":51,"value":3146},"How to Use ESLint?",{"type":40,"tag":47,"props":3148,"children":3149},{},[3150,3152,3159],{"type":51,"value":3151},"By default, ESLint applies ",{"type":40,"tag":109,"props":3153,"children":3156},{"href":3154,"rel":3155},"https://eslint.org/docs/latest/rules/",[113],[3157],{"type":51,"value":3158},"its recommended rules",{"type":51,"value":3160}," to check the code for violations, so let’s choose a few of these rules to break and see how the tool flags the issues.",{"type":40,"tag":174,"props":3162,"children":3164},{":tabs":3163},"[\"block.js\", \"eslint.config.js\"]",[3165,3246],{"type":40,"tag":179,"props":3166,"children":3169},{"className":242,"code":3167,"filename":3168,"language":246,"meta":7,"style":7},"class Test {\n  constructor() {\n    if (false) debugger\n  }\n}\n","block.js",[3170],{"type":40,"tag":189,"props":3171,"children":3172},{"__ignoreMap":7},[3173,3190,3203,3231,3239],{"type":40,"tag":193,"props":3174,"children":3175},{"class":196,"line":185},[3176,3181,3186],{"type":40,"tag":193,"props":3177,"children":3178},{"style":672},[3179],{"type":51,"value":3180},"class",{"type":40,"tag":193,"props":3182,"children":3183},{"style":257},[3184],{"type":51,"value":3185}," Test",{"type":40,"tag":193,"props":3187,"children":3188},{"style":207},[3189],{"type":51,"value":210},{"type":40,"tag":193,"props":3191,"children":3192},{"class":196,"line":213},[3193,3198],{"type":40,"tag":193,"props":3194,"children":3195},{"style":672},[3196],{"type":51,"value":3197},"  constructor",{"type":40,"tag":193,"props":3199,"children":3200},{"style":207},[3201],{"type":51,"value":3202},"() {\n",{"type":40,"tag":193,"props":3204,"children":3205},{"class":196,"line":233},[3206,3211,3216,3221,3226],{"type":40,"tag":193,"props":3207,"children":3208},{"style":672},[3209],{"type":51,"value":3210},"    if",{"type":40,"tag":193,"props":3212,"children":3213},{"style":207},[3214],{"type":51,"value":3215}," (",{"type":40,"tag":193,"props":3217,"children":3218},{"style":222},[3219],{"type":51,"value":3220},"false",{"type":40,"tag":193,"props":3222,"children":3223},{"style":207},[3224],{"type":51,"value":3225},") ",{"type":40,"tag":193,"props":3227,"children":3228},{"style":672},[3229],{"type":51,"value":3230},"debugger\n",{"type":40,"tag":193,"props":3232,"children":3233},{"class":196,"line":446},[3234],{"type":40,"tag":193,"props":3235,"children":3236},{"style":207},[3237],{"type":51,"value":3238},"  }\n",{"type":40,"tag":193,"props":3240,"children":3241},{"class":196,"line":477},[3242],{"type":40,"tag":193,"props":3243,"children":3244},{"style":207},[3245],{"type":51,"value":239},{"type":40,"tag":179,"props":3247,"children":3249},{"className":242,"code":3248,"filename":2957,"language":246,"meta":7,"style":7},"import standard from \"@eslint/js\";\n\nexport default [\n  standard.configs.recommended,\n  {\n    ignores: [\n      'dist',\n      'vendor',\n      'node_modules'\n    ],\n    rules: {\n      curly: 'error',\n    }\n  },\n];\n",[3250],{"type":40,"tag":189,"props":3251,"children":3252},{"__ignoreMap":7},[3253,3276,3283,3298,3325,3332,3344,3356,3368,3376,3384,3396,3417,3425,3432],{"type":40,"tag":193,"props":3254,"children":3255},{"class":196,"line":185},[3256,3260,3264,3268,3272],{"type":40,"tag":193,"props":3257,"children":3258},{"style":672},[3259],{"type":51,"value":2969},{"type":40,"tag":193,"props":3261,"children":3262},{"style":201},[3263],{"type":51,"value":3000},{"type":40,"tag":193,"props":3265,"children":3266},{"style":672},[3267],{"type":51,"value":2979},{"type":40,"tag":193,"props":3269,"children":3270},{"style":279},[3271],{"type":51,"value":3009},{"type":40,"tag":193,"props":3273,"children":3274},{"style":207},[3275],{"type":51,"value":230},{"type":40,"tag":193,"props":3277,"children":3278},{"class":196,"line":213},[3279],{"type":40,"tag":193,"props":3280,"children":3281},{"emptyLinePlaceholder":35},[3282],{"type":51,"value":626},{"type":40,"tag":193,"props":3284,"children":3285},{"class":196,"line":233},[3286,3290,3294],{"type":40,"tag":193,"props":3287,"children":3288},{"style":672},[3289],{"type":51,"value":3028},{"type":40,"tag":193,"props":3291,"children":3292},{"style":672},[3293],{"type":51,"value":3033},{"type":40,"tag":193,"props":3295,"children":3296},{"style":207},[3297],{"type":51,"value":3038},{"type":40,"tag":193,"props":3299,"children":3300},{"class":196,"line":446},[3301,3305,3309,3313,3317,3321],{"type":40,"tag":193,"props":3302,"children":3303},{"style":257},[3304],{"type":51,"value":3046},{"type":40,"tag":193,"props":3306,"children":3307},{"style":207},[3308],{"type":51,"value":265},{"type":40,"tag":193,"props":3310,"children":3311},{"style":257},[3312],{"type":51,"value":3055},{"type":40,"tag":193,"props":3314,"children":3315},{"style":207},[3316],{"type":51,"value":265},{"type":40,"tag":193,"props":3318,"children":3319},{"style":201},[3320],{"type":51,"value":3064},{"type":40,"tag":193,"props":3322,"children":3323},{"style":207},[3324],{"type":51,"value":1425},{"type":40,"tag":193,"props":3326,"children":3327},{"class":196,"line":477},[3328],{"type":40,"tag":193,"props":3329,"children":3330},{"style":207},[3331],{"type":51,"value":3076},{"type":40,"tag":193,"props":3333,"children":3334},{"class":196,"line":507},[3335,3340],{"type":40,"tag":193,"props":3336,"children":3337},{"style":201},[3338],{"type":51,"value":3339},"    ignores",{"type":40,"tag":193,"props":3341,"children":3342},{"style":207},[3343],{"type":51,"value":1791},{"type":40,"tag":193,"props":3345,"children":3346},{"class":196,"line":543},[3347,3352],{"type":40,"tag":193,"props":3348,"children":3349},{"style":279},[3350],{"type":51,"value":3351},"      'dist'",{"type":40,"tag":193,"props":3353,"children":3354},{"style":207},[3355],{"type":51,"value":1425},{"type":40,"tag":193,"props":3357,"children":3358},{"class":196,"line":582},[3359,3364],{"type":40,"tag":193,"props":3360,"children":3361},{"style":279},[3362],{"type":51,"value":3363},"      'vendor'",{"type":40,"tag":193,"props":3365,"children":3366},{"style":207},[3367],{"type":51,"value":1425},{"type":40,"tag":193,"props":3369,"children":3370},{"class":196,"line":620},[3371],{"type":40,"tag":193,"props":3372,"children":3373},{"style":279},[3374],{"type":51,"value":3375},"      'node_modules'\n",{"type":40,"tag":193,"props":3377,"children":3378},{"class":196,"line":294},[3379],{"type":40,"tag":193,"props":3380,"children":3381},{"style":207},[3382],{"type":51,"value":3383},"    ],\n",{"type":40,"tag":193,"props":3385,"children":3386},{"class":196,"line":660},[3387,3392],{"type":40,"tag":193,"props":3388,"children":3389},{"style":201},[3390],{"type":51,"value":3391},"    rules",{"type":40,"tag":193,"props":3393,"children":3394},{"style":207},[3395],{"type":51,"value":1402},{"type":40,"tag":193,"props":3397,"children":3398},{"class":196,"line":668},[3399,3404,3408,3413],{"type":40,"tag":193,"props":3400,"children":3401},{"style":201},[3402],{"type":51,"value":3403},"      curly",{"type":40,"tag":193,"props":3405,"children":3406},{"style":207},[3407],{"type":51,"value":1415},{"type":40,"tag":193,"props":3409,"children":3410},{"style":279},[3411],{"type":51,"value":3412},"'error'",{"type":40,"tag":193,"props":3414,"children":3415},{"style":207},[3416],{"type":51,"value":1425},{"type":40,"tag":193,"props":3418,"children":3419},{"class":196,"line":961},[3420],{"type":40,"tag":193,"props":3421,"children":3422},{"style":207},[3423],{"type":51,"value":3424},"    }\n",{"type":40,"tag":193,"props":3426,"children":3427},{"class":196,"line":2115},[3428],{"type":40,"tag":193,"props":3429,"children":3430},{"style":207},[3431],{"type":51,"value":1472},{"type":40,"tag":193,"props":3433,"children":3434},{"class":196,"line":2124},[3435],{"type":40,"tag":193,"props":3436,"children":3437},{"style":207},[3438],{"type":51,"value":3137},{"type":40,"tag":47,"props":3440,"children":3441},{},[3442,3453,3454,3460,3461,3466],{"type":40,"tag":95,"props":3443,"children":3444},{},[3445,3447],{"type":51,"value":3446},"You can check the code for violations by running the ",{"type":40,"tag":189,"props":3448,"children":3450},{"className":3449},[],[3451],{"type":51,"value":3452},"eslint",{"type":51,"value":1091},{"type":40,"tag":109,"props":3455,"children":3458},{"href":3456,"rel":3457},"https://eslint.org/docs/latest/use/command-line-interface",[113],[3459],{"type":51,"value":1098},{"type":51,"value":1091},{"type":40,"tag":95,"props":3462,"children":3463},{},[3464],{"type":51,"value":3465},"and specifying a file, directory, or glob pattern to check.",{"type":51,"value":3467}," If you skip this, the tool will search all the JS files relative to the current directory. We can use one of the following commands:",{"type":40,"tag":174,"props":3469,"children":3471},{":tabs":3470},"[\"File\", \"Glob\", \"All\"]",[3472,3561,3643],{"type":40,"tag":179,"props":3473,"children":3479},{"className":3474,"code":3475,"filename":3476,"highlights":3477,"language":3478,"meta":7,"style":7},"language-diff shiki shiki-themes one-dark-pro","yarn eslint resources/scripts/blocks.js\n\n/footmate.pro/wp-content/themes/footmate/resources/scripts/blocks.js\n  1:7   error  'Test' is defined but never used  no-unused-vars\n  3:9   error  Unexpected constant condition     no-constant-condition\n  3:16  error  Expected { after 'if' condition   curly\n  3:16  error  Unexpected 'debugger' statement   no-debugger\n\n✖ 4 problems (4 errors, 0 warnings)\n  1 error and 0 warnings potentially fixable with the `--fix` option.\n","File",[185],"diff",[3480],{"type":40,"tag":189,"props":3481,"children":3482},{"__ignoreMap":7},[3483,3492,3499,3507,3515,3523,3531,3539,3546,3554],{"type":40,"tag":193,"props":3484,"children":3486},{"class":3485,"line":185},[196,197],[3487],{"type":40,"tag":193,"props":3488,"children":3489},{"style":207},[3490],{"type":51,"value":3491},"yarn eslint resources/scripts/blocks.js\n",{"type":40,"tag":193,"props":3493,"children":3494},{"class":196,"line":213},[3495],{"type":40,"tag":193,"props":3496,"children":3497},{"emptyLinePlaceholder":35},[3498],{"type":51,"value":626},{"type":40,"tag":193,"props":3500,"children":3501},{"class":196,"line":233},[3502],{"type":40,"tag":193,"props":3503,"children":3504},{"style":207},[3505],{"type":51,"value":3506},"/footmate.pro/wp-content/themes/footmate/resources/scripts/blocks.js\n",{"type":40,"tag":193,"props":3508,"children":3509},{"class":196,"line":446},[3510],{"type":40,"tag":193,"props":3511,"children":3512},{"style":207},[3513],{"type":51,"value":3514},"  1:7   error  'Test' is defined but never used  no-unused-vars\n",{"type":40,"tag":193,"props":3516,"children":3517},{"class":196,"line":477},[3518],{"type":40,"tag":193,"props":3519,"children":3520},{"style":207},[3521],{"type":51,"value":3522},"  3:9   error  Unexpected constant condition     no-constant-condition\n",{"type":40,"tag":193,"props":3524,"children":3525},{"class":196,"line":507},[3526],{"type":40,"tag":193,"props":3527,"children":3528},{"style":207},[3529],{"type":51,"value":3530},"  3:16  error  Expected { after 'if' condition   curly\n",{"type":40,"tag":193,"props":3532,"children":3533},{"class":196,"line":543},[3534],{"type":40,"tag":193,"props":3535,"children":3536},{"style":207},[3537],{"type":51,"value":3538},"  3:16  error  Unexpected 'debugger' statement   no-debugger\n",{"type":40,"tag":193,"props":3540,"children":3541},{"class":196,"line":582},[3542],{"type":40,"tag":193,"props":3543,"children":3544},{"emptyLinePlaceholder":35},[3545],{"type":51,"value":626},{"type":40,"tag":193,"props":3547,"children":3548},{"class":196,"line":620},[3549],{"type":40,"tag":193,"props":3550,"children":3551},{"style":207},[3552],{"type":51,"value":3553},"✖ 4 problems (4 errors, 0 warnings)\n",{"type":40,"tag":193,"props":3555,"children":3556},{"class":196,"line":294},[3557],{"type":40,"tag":193,"props":3558,"children":3559},{"style":207},[3560],{"type":51,"value":843},{"type":40,"tag":179,"props":3562,"children":3566},{"className":3474,"code":3563,"filename":3564,"highlights":3565,"language":3478,"meta":7,"style":7},"yarn eslint resources/**/*.js\n\n/footmate.pro/wp-content/themes/footmate/resources/scripts/blocks.js\n  1:7   error  'Test' is defined but never used  no-unused-vars\n  3:9   error  Unexpected constant condition     no-constant-condition\n  3:16  error  Expected { after 'if' condition   curly\n  3:16  error  Unexpected 'debugger' statement   no-debugger\n\n✖ 4 problems (6 errors, 0 warnings)\n  1 error and 0 warnings potentially fixable with the `--fix` option.\n","Glob",[185],[3567],{"type":40,"tag":189,"props":3568,"children":3569},{"__ignoreMap":7},[3570,3579,3586,3593,3600,3607,3614,3621,3628,3636],{"type":40,"tag":193,"props":3571,"children":3573},{"class":3572,"line":185},[196,197],[3574],{"type":40,"tag":193,"props":3575,"children":3576},{"style":207},[3577],{"type":51,"value":3578},"yarn eslint resources/**/*.js\n",{"type":40,"tag":193,"props":3580,"children":3581},{"class":196,"line":213},[3582],{"type":40,"tag":193,"props":3583,"children":3584},{"emptyLinePlaceholder":35},[3585],{"type":51,"value":626},{"type":40,"tag":193,"props":3587,"children":3588},{"class":196,"line":233},[3589],{"type":40,"tag":193,"props":3590,"children":3591},{"style":207},[3592],{"type":51,"value":3506},{"type":40,"tag":193,"props":3594,"children":3595},{"class":196,"line":446},[3596],{"type":40,"tag":193,"props":3597,"children":3598},{"style":207},[3599],{"type":51,"value":3514},{"type":40,"tag":193,"props":3601,"children":3602},{"class":196,"line":477},[3603],{"type":40,"tag":193,"props":3604,"children":3605},{"style":207},[3606],{"type":51,"value":3522},{"type":40,"tag":193,"props":3608,"children":3609},{"class":196,"line":507},[3610],{"type":40,"tag":193,"props":3611,"children":3612},{"style":207},[3613],{"type":51,"value":3530},{"type":40,"tag":193,"props":3615,"children":3616},{"class":196,"line":543},[3617],{"type":40,"tag":193,"props":3618,"children":3619},{"style":207},[3620],{"type":51,"value":3538},{"type":40,"tag":193,"props":3622,"children":3623},{"class":196,"line":582},[3624],{"type":40,"tag":193,"props":3625,"children":3626},{"emptyLinePlaceholder":35},[3627],{"type":51,"value":626},{"type":40,"tag":193,"props":3629,"children":3630},{"class":196,"line":620},[3631],{"type":40,"tag":193,"props":3632,"children":3633},{"style":207},[3634],{"type":51,"value":3635},"✖ 4 problems (6 errors, 0 warnings)\n",{"type":40,"tag":193,"props":3637,"children":3638},{"class":196,"line":294},[3639],{"type":40,"tag":193,"props":3640,"children":3641},{"style":207},[3642],{"type":51,"value":843},{"type":40,"tag":179,"props":3644,"children":3648},{"className":3474,"code":3645,"filename":3646,"highlights":3647,"language":3478,"meta":7,"style":7},"yarn eslint\n\n/footmate.pro/wp-content/themes/footmate/resources/scripts/blocks.js\n  1:7   error  'Test' is defined but never used  no-unused-vars\n  3:9   error  Unexpected constant condition     no-constant-condition\n  3:16  error  Expected { after 'if' condition   curly\n  3:16  error  Unexpected 'debugger' statement   no-debugger\n\n✖ 4 problems (4 errors, 0 warnings)\n  1 error and 0 warnings potentially fixable with the `--fix` option.\n","All",[185],[3649],{"type":40,"tag":189,"props":3650,"children":3651},{"__ignoreMap":7},[3652,3661,3668,3675,3682,3689,3696,3703,3710,3717],{"type":40,"tag":193,"props":3653,"children":3655},{"class":3654,"line":185},[196,197],[3656],{"type":40,"tag":193,"props":3657,"children":3658},{"style":207},[3659],{"type":51,"value":3660},"yarn eslint\n",{"type":40,"tag":193,"props":3662,"children":3663},{"class":196,"line":213},[3664],{"type":40,"tag":193,"props":3665,"children":3666},{"emptyLinePlaceholder":35},[3667],{"type":51,"value":626},{"type":40,"tag":193,"props":3669,"children":3670},{"class":196,"line":233},[3671],{"type":40,"tag":193,"props":3672,"children":3673},{"style":207},[3674],{"type":51,"value":3506},{"type":40,"tag":193,"props":3676,"children":3677},{"class":196,"line":446},[3678],{"type":40,"tag":193,"props":3679,"children":3680},{"style":207},[3681],{"type":51,"value":3514},{"type":40,"tag":193,"props":3683,"children":3684},{"class":196,"line":477},[3685],{"type":40,"tag":193,"props":3686,"children":3687},{"style":207},[3688],{"type":51,"value":3522},{"type":40,"tag":193,"props":3690,"children":3691},{"class":196,"line":507},[3692],{"type":40,"tag":193,"props":3693,"children":3694},{"style":207},[3695],{"type":51,"value":3530},{"type":40,"tag":193,"props":3697,"children":3698},{"class":196,"line":543},[3699],{"type":40,"tag":193,"props":3700,"children":3701},{"style":207},[3702],{"type":51,"value":3538},{"type":40,"tag":193,"props":3704,"children":3705},{"class":196,"line":582},[3706],{"type":40,"tag":193,"props":3707,"children":3708},{"emptyLinePlaceholder":35},[3709],{"type":51,"value":626},{"type":40,"tag":193,"props":3711,"children":3712},{"class":196,"line":620},[3713],{"type":40,"tag":193,"props":3714,"children":3715},{"style":207},[3716],{"type":51,"value":3553},{"type":40,"tag":193,"props":3718,"children":3719},{"class":196,"line":294},[3720],{"type":40,"tag":193,"props":3721,"children":3722},{"style":207},[3723],{"type":51,"value":843},{"type":40,"tag":47,"props":3725,"children":3726},{},[3727,3729],{"type":51,"value":3728},"The tool correctly identifies the rule violations that we intentionally created. While most of the issues it finds in this case need to be addressed manually, there is one that can be automatically fixed. ",{"type":40,"tag":95,"props":3730,"children":3731},{},[3732,3734,3740],{"type":51,"value":3733},"To apply this automatic correction and reduce your work, you can use a similar command as before but also add the ",{"type":40,"tag":189,"props":3735,"children":3737},{"className":3736},[],[3738],{"type":51,"value":3739},"--fix",{"type":51,"value":3741}," flag.",{"type":40,"tag":179,"props":3743,"children":3746},{"className":3474,"code":3744,"highlights":3745,"language":3478,"meta":7,"style":7},"yarn eslint --fix\n\n/footmate.pro/wp-content/themes/footmate/resources/scripts/blocks.js\n  1:7   error  'Test' is defined but never used  no-unused-vars\n  3:9   error  Unexpected constant condition     no-constant-condition\n  3:17  error  Unexpected 'debugger' statement   no-debugger\n\n✖ 3 problems (3 errors, 0 warnings)\n",[185],[3747],{"type":40,"tag":189,"props":3748,"children":3749},{"__ignoreMap":7},[3750,3759,3766,3773,3780,3787,3795,3802],{"type":40,"tag":193,"props":3751,"children":3753},{"class":3752,"line":185},[196,197],[3754],{"type":40,"tag":193,"props":3755,"children":3756},{"style":207},[3757],{"type":51,"value":3758},"yarn eslint --fix\n",{"type":40,"tag":193,"props":3760,"children":3761},{"class":196,"line":213},[3762],{"type":40,"tag":193,"props":3763,"children":3764},{"emptyLinePlaceholder":35},[3765],{"type":51,"value":626},{"type":40,"tag":193,"props":3767,"children":3768},{"class":196,"line":233},[3769],{"type":40,"tag":193,"props":3770,"children":3771},{"style":207},[3772],{"type":51,"value":3506},{"type":40,"tag":193,"props":3774,"children":3775},{"class":196,"line":446},[3776],{"type":40,"tag":193,"props":3777,"children":3778},{"style":207},[3779],{"type":51,"value":3514},{"type":40,"tag":193,"props":3781,"children":3782},{"class":196,"line":477},[3783],{"type":40,"tag":193,"props":3784,"children":3785},{"style":207},[3786],{"type":51,"value":3522},{"type":40,"tag":193,"props":3788,"children":3789},{"class":196,"line":507},[3790],{"type":40,"tag":193,"props":3791,"children":3792},{"style":207},[3793],{"type":51,"value":3794},"  3:17  error  Unexpected 'debugger' statement   no-debugger\n",{"type":40,"tag":193,"props":3796,"children":3797},{"class":196,"line":543},[3798],{"type":40,"tag":193,"props":3799,"children":3800},{"emptyLinePlaceholder":35},[3801],{"type":51,"value":626},{"type":40,"tag":193,"props":3803,"children":3804},{"class":196,"line":582},[3805],{"type":40,"tag":193,"props":3806,"children":3807},{"style":207},[3808],{"type":51,"value":3809},"✖ 3 problems (3 errors, 0 warnings)\n",{"type":40,"tag":47,"props":3811,"children":3812},{},[3813,3818],{"type":40,"tag":95,"props":3814,"children":3815},{},[3816],{"type":51,"value":3817},"Now, you'll need to address the remaining issues manually.",{"type":51,"value":3819}," Once these corrections are made, and you run the linter again, you should no longer see any problems.",{"type":40,"tag":47,"props":3821,"children":3822},{},[3823,3825,3830],{"type":51,"value":3824},"You can also add a script to the ",{"type":40,"tag":189,"props":3826,"children":3828},{"className":3827},[],[3829],{"type":51,"value":1231},{"type":51,"value":3831}," to run ESLint with other linters together with a single command. That's a standard approach in our codebase.",{"type":40,"tag":179,"props":3833,"children":3836},{"className":1374,"code":3834,"filename":1231,"highlights":3835,"language":1377,"meta":7,"style":7},"{\n  \"scripts\": {\n    \"build\": \"vite build\",\n    \"dev\": \"vite\",\n    \"lint\": \"prettier . --check && stylelint resources/**/*.scss && eslint\",\n    \"format\": \"prettier . --write && stylelint resources/**/*.scss --fix && eslint --fix\"\n  },\n}\n",[477,507],[3837],{"type":40,"tag":189,"props":3838,"children":3839},{"__ignoreMap":7},[3840,3847,3858,3879,3900,3921,3938,3945],{"type":40,"tag":193,"props":3841,"children":3842},{"class":196,"line":185},[3843],{"type":40,"tag":193,"props":3844,"children":3845},{"style":207},[3846],{"type":51,"value":1389},{"type":40,"tag":193,"props":3848,"children":3849},{"class":196,"line":213},[3850,3854],{"type":40,"tag":193,"props":3851,"children":3852},{"style":201},[3853],{"type":51,"value":1397},{"type":40,"tag":193,"props":3855,"children":3856},{"style":207},[3857],{"type":51,"value":1402},{"type":40,"tag":193,"props":3859,"children":3860},{"class":196,"line":233},[3861,3866,3870,3875],{"type":40,"tag":193,"props":3862,"children":3863},{"style":201},[3864],{"type":51,"value":3865},"    \"build\"",{"type":40,"tag":193,"props":3867,"children":3868},{"style":207},[3869],{"type":51,"value":1415},{"type":40,"tag":193,"props":3871,"children":3872},{"style":279},[3873],{"type":51,"value":3874},"\"vite build\"",{"type":40,"tag":193,"props":3876,"children":3877},{"style":207},[3878],{"type":51,"value":1425},{"type":40,"tag":193,"props":3880,"children":3881},{"class":196,"line":446},[3882,3887,3891,3896],{"type":40,"tag":193,"props":3883,"children":3884},{"style":201},[3885],{"type":51,"value":3886},"    \"dev\"",{"type":40,"tag":193,"props":3888,"children":3889},{"style":207},[3890],{"type":51,"value":1415},{"type":40,"tag":193,"props":3892,"children":3893},{"style":279},[3894],{"type":51,"value":3895},"\"vite\"",{"type":40,"tag":193,"props":3897,"children":3898},{"style":207},[3899],{"type":51,"value":1425},{"type":40,"tag":193,"props":3901,"children":3903},{"class":3902,"line":477},[196,197],[3904,3908,3912,3917],{"type":40,"tag":193,"props":3905,"children":3906},{"style":201},[3907],{"type":51,"value":1410},{"type":40,"tag":193,"props":3909,"children":3910},{"style":207},[3911],{"type":51,"value":1415},{"type":40,"tag":193,"props":3913,"children":3914},{"style":279},[3915],{"type":51,"value":3916},"\"prettier . --check && stylelint resources/**/*.scss && eslint\"",{"type":40,"tag":193,"props":3918,"children":3919},{"style":207},[3920],{"type":51,"value":1425},{"type":40,"tag":193,"props":3922,"children":3924},{"class":3923,"line":507},[196,197],[3925,3929,3933],{"type":40,"tag":193,"props":3926,"children":3927},{"style":201},[3928],{"type":51,"value":1433},{"type":40,"tag":193,"props":3930,"children":3931},{"style":207},[3932],{"type":51,"value":1415},{"type":40,"tag":193,"props":3934,"children":3935},{"style":279},[3936],{"type":51,"value":3937},"\"prettier . --write && stylelint resources/**/*.scss --fix && eslint --fix\"\n",{"type":40,"tag":193,"props":3939,"children":3940},{"class":196,"line":543},[3941],{"type":40,"tag":193,"props":3942,"children":3943},{"style":207},[3944],{"type":51,"value":1472},{"type":40,"tag":193,"props":3946,"children":3947},{"class":196,"line":582},[3948],{"type":40,"tag":193,"props":3949,"children":3950},{"style":207},[3951],{"type":51,"value":239},{"type":40,"tag":58,"props":3953,"children":3954},{},[],{"type":40,"tag":62,"props":3956,"children":3958},{"id":3957},"how-to-ignore-errors-in-eslint",[3959],{"type":51,"value":3960},"How to Ignore Errors in ESLint?",{"type":40,"tag":47,"props":3962,"children":3963},{},[3964,3966,3979,3981,3987,3988,3994,3996,4002,4004,4011],{"type":51,"value":3965},"You have several options for skipping code checks in your project, which should, of course, be used with caution! ",{"type":40,"tag":95,"props":3967,"children":3968},{},[3969,3971,3977],{"type":51,"value":3970},"If you want to ignore entire directories, you can utilize the ",{"type":40,"tag":189,"props":3972,"children":3974},{"className":3973},[],[3975],{"type":51,"value":3976},"ignores",{"type":51,"value":3978}," key in your config file and specify them there.",{"type":51,"value":3980}," We don’t want to check the output files and external code, so we exclude the ",{"type":40,"tag":189,"props":3982,"children":3984},{"className":3983},[],[3985],{"type":51,"value":3986},"dist",{"type":51,"value":1239},{"type":40,"tag":189,"props":3989,"children":3991},{"className":3990},[],[3992],{"type":51,"value":3993},"vendor",{"type":51,"value":3995},", and ",{"type":40,"tag":189,"props":3997,"children":3999},{"className":3998},[],[4000],{"type":51,"value":4001},"node_modules",{"type":51,"value":4003}," directories. If you need to handle more advanced scenarios, just ",{"type":40,"tag":109,"props":4005,"children":4008},{"href":4006,"rel":4007},"https://eslint.org/docs/latest/use/configure/ignore",[113],[4009],{"type":51,"value":4010},"check out the docs",{"type":51,"value":265},{"type":40,"tag":179,"props":4013,"children":4015},{"className":242,"code":4014,"filename":2957,"language":246,"meta":7,"style":7},"export default [\n  standard.configs.recommended,\n  {\n    ignores: [\n      'dist',\n      'vendor',\n      'node_modules'\n    ],\n  },\n];\n",[4016],{"type":40,"tag":189,"props":4017,"children":4018},{"__ignoreMap":7},[4019,4034,4061,4068,4079,4090,4101,4108,4115,4122],{"type":40,"tag":193,"props":4020,"children":4021},{"class":196,"line":185},[4022,4026,4030],{"type":40,"tag":193,"props":4023,"children":4024},{"style":672},[4025],{"type":51,"value":3028},{"type":40,"tag":193,"props":4027,"children":4028},{"style":672},[4029],{"type":51,"value":3033},{"type":40,"tag":193,"props":4031,"children":4032},{"style":207},[4033],{"type":51,"value":3038},{"type":40,"tag":193,"props":4035,"children":4036},{"class":196,"line":213},[4037,4041,4045,4049,4053,4057],{"type":40,"tag":193,"props":4038,"children":4039},{"style":257},[4040],{"type":51,"value":3046},{"type":40,"tag":193,"props":4042,"children":4043},{"style":207},[4044],{"type":51,"value":265},{"type":40,"tag":193,"props":4046,"children":4047},{"style":257},[4048],{"type":51,"value":3055},{"type":40,"tag":193,"props":4050,"children":4051},{"style":207},[4052],{"type":51,"value":265},{"type":40,"tag":193,"props":4054,"children":4055},{"style":201},[4056],{"type":51,"value":3064},{"type":40,"tag":193,"props":4058,"children":4059},{"style":207},[4060],{"type":51,"value":1425},{"type":40,"tag":193,"props":4062,"children":4063},{"class":196,"line":233},[4064],{"type":40,"tag":193,"props":4065,"children":4066},{"style":207},[4067],{"type":51,"value":3076},{"type":40,"tag":193,"props":4069,"children":4070},{"class":196,"line":446},[4071,4075],{"type":40,"tag":193,"props":4072,"children":4073},{"style":201},[4074],{"type":51,"value":3339},{"type":40,"tag":193,"props":4076,"children":4077},{"style":207},[4078],{"type":51,"value":1791},{"type":40,"tag":193,"props":4080,"children":4081},{"class":196,"line":477},[4082,4086],{"type":40,"tag":193,"props":4083,"children":4084},{"style":279},[4085],{"type":51,"value":3351},{"type":40,"tag":193,"props":4087,"children":4088},{"style":207},[4089],{"type":51,"value":1425},{"type":40,"tag":193,"props":4091,"children":4092},{"class":196,"line":507},[4093,4097],{"type":40,"tag":193,"props":4094,"children":4095},{"style":279},[4096],{"type":51,"value":3363},{"type":40,"tag":193,"props":4098,"children":4099},{"style":207},[4100],{"type":51,"value":1425},{"type":40,"tag":193,"props":4102,"children":4103},{"class":196,"line":543},[4104],{"type":40,"tag":193,"props":4105,"children":4106},{"style":279},[4107],{"type":51,"value":3375},{"type":40,"tag":193,"props":4109,"children":4110},{"class":196,"line":582},[4111],{"type":40,"tag":193,"props":4112,"children":4113},{"style":207},[4114],{"type":51,"value":3383},{"type":40,"tag":193,"props":4116,"children":4117},{"class":196,"line":620},[4118],{"type":40,"tag":193,"props":4119,"children":4120},{"style":207},[4121],{"type":51,"value":1472},{"type":40,"tag":193,"props":4123,"children":4124},{"class":196,"line":294},[4125],{"type":40,"tag":193,"props":4126,"children":4127},{"style":207},[4128],{"type":51,"value":3137},{"type":40,"tag":47,"props":4130,"children":4131},{},[4132,4137,4139,4146],{"type":40,"tag":95,"props":4133,"children":4134},{},[4135],{"type":51,"value":4136},"You can also disable checks for specific parts of your code using a common approach for linters, which involves using comments.",{"type":51,"value":4138}," For more detailed guidance and additional examples, just ",{"type":40,"tag":109,"props":4140,"children":4143},{"href":4141,"rel":4142},"https://eslint.org/docs/latest/use/configure/rules#disabling-rules",[113],[4144],{"type":51,"value":4145},"check out the official documentation",{"type":51,"value":4147},"!",{"type":40,"tag":174,"props":4149,"children":4151},{":tabs":4150},"[\"Block\", \"Line\", \"Next Line\", \"File\"]",[4152,4240,4317,4396],{"type":40,"tag":179,"props":4153,"children":4156},{"className":242,"code":4154,"filename":4155,"language":246,"meta":7,"style":7},"class Test {\n  /* eslint-disable */\n  constructor() {\n    if (false) debugger\n  }\n  /* eslint-enable */\n}\n","Block",[4157],{"type":40,"tag":189,"props":4158,"children":4159},{"__ignoreMap":7},[4160,4175,4184,4195,4218,4225,4233],{"type":40,"tag":193,"props":4161,"children":4162},{"class":196,"line":185},[4163,4167,4171],{"type":40,"tag":193,"props":4164,"children":4165},{"style":672},[4166],{"type":51,"value":3180},{"type":40,"tag":193,"props":4168,"children":4169},{"style":257},[4170],{"type":51,"value":3185},{"type":40,"tag":193,"props":4172,"children":4173},{"style":207},[4174],{"type":51,"value":210},{"type":40,"tag":193,"props":4176,"children":4177},{"class":196,"line":213},[4178],{"type":40,"tag":193,"props":4179,"children":4181},{"style":4180},"--shiki-default:#7F848E;--shiki-default-font-style:italic",[4182],{"type":51,"value":4183},"  /* eslint-disable */\n",{"type":40,"tag":193,"props":4185,"children":4186},{"class":196,"line":233},[4187,4191],{"type":40,"tag":193,"props":4188,"children":4189},{"style":672},[4190],{"type":51,"value":3197},{"type":40,"tag":193,"props":4192,"children":4193},{"style":207},[4194],{"type":51,"value":3202},{"type":40,"tag":193,"props":4196,"children":4197},{"class":196,"line":446},[4198,4202,4206,4210,4214],{"type":40,"tag":193,"props":4199,"children":4200},{"style":672},[4201],{"type":51,"value":3210},{"type":40,"tag":193,"props":4203,"children":4204},{"style":207},[4205],{"type":51,"value":3215},{"type":40,"tag":193,"props":4207,"children":4208},{"style":222},[4209],{"type":51,"value":3220},{"type":40,"tag":193,"props":4211,"children":4212},{"style":207},[4213],{"type":51,"value":3225},{"type":40,"tag":193,"props":4215,"children":4216},{"style":672},[4217],{"type":51,"value":3230},{"type":40,"tag":193,"props":4219,"children":4220},{"class":196,"line":477},[4221],{"type":40,"tag":193,"props":4222,"children":4223},{"style":207},[4224],{"type":51,"value":3238},{"type":40,"tag":193,"props":4226,"children":4227},{"class":196,"line":507},[4228],{"type":40,"tag":193,"props":4229,"children":4230},{"style":4180},[4231],{"type":51,"value":4232},"  /* eslint-enable */\n",{"type":40,"tag":193,"props":4234,"children":4235},{"class":196,"line":543},[4236],{"type":40,"tag":193,"props":4237,"children":4238},{"style":207},[4239],{"type":51,"value":239},{"type":40,"tag":179,"props":4241,"children":4244},{"className":242,"code":4242,"filename":4243,"language":246,"meta":7,"style":7},"class Test {\n  constructor() {\n    if (false) debugger // eslint-disable-line\n  }\n}\n","Line",[4245],{"type":40,"tag":189,"props":4246,"children":4247},{"__ignoreMap":7},[4248,4263,4274,4303,4310],{"type":40,"tag":193,"props":4249,"children":4250},{"class":196,"line":185},[4251,4255,4259],{"type":40,"tag":193,"props":4252,"children":4253},{"style":672},[4254],{"type":51,"value":3180},{"type":40,"tag":193,"props":4256,"children":4257},{"style":257},[4258],{"type":51,"value":3185},{"type":40,"tag":193,"props":4260,"children":4261},{"style":207},[4262],{"type":51,"value":210},{"type":40,"tag":193,"props":4264,"children":4265},{"class":196,"line":213},[4266,4270],{"type":40,"tag":193,"props":4267,"children":4268},{"style":672},[4269],{"type":51,"value":3197},{"type":40,"tag":193,"props":4271,"children":4272},{"style":207},[4273],{"type":51,"value":3202},{"type":40,"tag":193,"props":4275,"children":4276},{"class":196,"line":233},[4277,4281,4285,4289,4293,4298],{"type":40,"tag":193,"props":4278,"children":4279},{"style":672},[4280],{"type":51,"value":3210},{"type":40,"tag":193,"props":4282,"children":4283},{"style":207},[4284],{"type":51,"value":3215},{"type":40,"tag":193,"props":4286,"children":4287},{"style":222},[4288],{"type":51,"value":3220},{"type":40,"tag":193,"props":4290,"children":4291},{"style":207},[4292],{"type":51,"value":3225},{"type":40,"tag":193,"props":4294,"children":4295},{"style":672},[4296],{"type":51,"value":4297},"debugger",{"type":40,"tag":193,"props":4299,"children":4300},{"style":4180},[4301],{"type":51,"value":4302}," // eslint-disable-line\n",{"type":40,"tag":193,"props":4304,"children":4305},{"class":196,"line":446},[4306],{"type":40,"tag":193,"props":4307,"children":4308},{"style":207},[4309],{"type":51,"value":3238},{"type":40,"tag":193,"props":4311,"children":4312},{"class":196,"line":477},[4313],{"type":40,"tag":193,"props":4314,"children":4315},{"style":207},[4316],{"type":51,"value":239},{"type":40,"tag":179,"props":4318,"children":4321},{"className":242,"code":4319,"filename":4320,"language":246,"meta":7,"style":7},"class Test {\n  constructor() {\n    // eslint-disable-next-line no-debugger\n    if (false) debugger\n  }\n}\n","Next Line",[4322],{"type":40,"tag":189,"props":4323,"children":4324},{"__ignoreMap":7},[4325,4340,4351,4359,4382,4389],{"type":40,"tag":193,"props":4326,"children":4327},{"class":196,"line":185},[4328,4332,4336],{"type":40,"tag":193,"props":4329,"children":4330},{"style":672},[4331],{"type":51,"value":3180},{"type":40,"tag":193,"props":4333,"children":4334},{"style":257},[4335],{"type":51,"value":3185},{"type":40,"tag":193,"props":4337,"children":4338},{"style":207},[4339],{"type":51,"value":210},{"type":40,"tag":193,"props":4341,"children":4342},{"class":196,"line":213},[4343,4347],{"type":40,"tag":193,"props":4344,"children":4345},{"style":672},[4346],{"type":51,"value":3197},{"type":40,"tag":193,"props":4348,"children":4349},{"style":207},[4350],{"type":51,"value":3202},{"type":40,"tag":193,"props":4352,"children":4353},{"class":196,"line":233},[4354],{"type":40,"tag":193,"props":4355,"children":4356},{"style":4180},[4357],{"type":51,"value":4358},"    // eslint-disable-next-line no-debugger\n",{"type":40,"tag":193,"props":4360,"children":4361},{"class":196,"line":446},[4362,4366,4370,4374,4378],{"type":40,"tag":193,"props":4363,"children":4364},{"style":672},[4365],{"type":51,"value":3210},{"type":40,"tag":193,"props":4367,"children":4368},{"style":207},[4369],{"type":51,"value":3215},{"type":40,"tag":193,"props":4371,"children":4372},{"style":222},[4373],{"type":51,"value":3220},{"type":40,"tag":193,"props":4375,"children":4376},{"style":207},[4377],{"type":51,"value":3225},{"type":40,"tag":193,"props":4379,"children":4380},{"style":672},[4381],{"type":51,"value":3230},{"type":40,"tag":193,"props":4383,"children":4384},{"class":196,"line":477},[4385],{"type":40,"tag":193,"props":4386,"children":4387},{"style":207},[4388],{"type":51,"value":3238},{"type":40,"tag":193,"props":4390,"children":4391},{"class":196,"line":507},[4392],{"type":40,"tag":193,"props":4393,"children":4394},{"style":207},[4395],{"type":51,"value":239},{"type":40,"tag":179,"props":4397,"children":4399},{"className":242,"code":4398,"filename":3476,"language":246,"meta":7,"style":7},"/* eslint no-debugger: \"off\" */\nclass Test {\n  constructor() {\n    if (false) debugger\n  }\n}\n",[4400],{"type":40,"tag":189,"props":4401,"children":4402},{"__ignoreMap":7},[4403,4411,4426,4437,4460,4467],{"type":40,"tag":193,"props":4404,"children":4405},{"class":196,"line":185},[4406],{"type":40,"tag":193,"props":4407,"children":4408},{"style":4180},[4409],{"type":51,"value":4410},"/* eslint no-debugger: \"off\" */\n",{"type":40,"tag":193,"props":4412,"children":4413},{"class":196,"line":213},[4414,4418,4422],{"type":40,"tag":193,"props":4415,"children":4416},{"style":672},[4417],{"type":51,"value":3180},{"type":40,"tag":193,"props":4419,"children":4420},{"style":257},[4421],{"type":51,"value":3185},{"type":40,"tag":193,"props":4423,"children":4424},{"style":207},[4425],{"type":51,"value":210},{"type":40,"tag":193,"props":4427,"children":4428},{"class":196,"line":233},[4429,4433],{"type":40,"tag":193,"props":4430,"children":4431},{"style":672},[4432],{"type":51,"value":3197},{"type":40,"tag":193,"props":4434,"children":4435},{"style":207},[4436],{"type":51,"value":3202},{"type":40,"tag":193,"props":4438,"children":4439},{"class":196,"line":446},[4440,4444,4448,4452,4456],{"type":40,"tag":193,"props":4441,"children":4442},{"style":672},[4443],{"type":51,"value":3210},{"type":40,"tag":193,"props":4445,"children":4446},{"style":207},[4447],{"type":51,"value":3215},{"type":40,"tag":193,"props":4449,"children":4450},{"style":222},[4451],{"type":51,"value":3220},{"type":40,"tag":193,"props":4453,"children":4454},{"style":207},[4455],{"type":51,"value":3225},{"type":40,"tag":193,"props":4457,"children":4458},{"style":672},[4459],{"type":51,"value":3230},{"type":40,"tag":193,"props":4461,"children":4462},{"class":196,"line":477},[4463],{"type":40,"tag":193,"props":4464,"children":4465},{"style":207},[4466],{"type":51,"value":3238},{"type":40,"tag":193,"props":4468,"children":4469},{"class":196,"line":507},[4470],{"type":40,"tag":193,"props":4471,"children":4472},{"style":207},[4473],{"type":51,"value":239},{"type":40,"tag":58,"props":4475,"children":4476},{},[],{"type":40,"tag":62,"props":4478,"children":4480},{"id":4479},"how-to-configure-eslint",[4481],{"type":51,"value":4482},"How to Configure ESLint?",{"type":40,"tag":47,"props":4484,"children":4485},{},[4486,4498,4500,4507],{"type":40,"tag":95,"props":4487,"children":4488},{},[4489,4491,4496],{"type":51,"value":4490},"To alter the tool's behavior, you should now modify the ",{"type":40,"tag":189,"props":4492,"children":4494},{"className":4493},[],[4495],{"type":51,"value":2957},{"type":51,"value":4497}," file created during the initial setup.",{"type":51,"value":4499}," I haven't delved into any advanced configurations yet, so I recommend ",{"type":40,"tag":109,"props":4501,"children":4504},{"href":4502,"rel":4503},"https://eslint.org/docs/latest/use/configure/configuration-files",[113],[4505],{"type":51,"value":4506},"exploring this",{"type":51,"value":4508}," on your own, but for me, the most I need is choosing the coding standards and adjusting rules, and that can be easily managed",{"type":40,"tag":179,"props":4510,"children":4511},{"className":242,"code":3248,"filename":2957,"language":246,"meta":7,"style":7},[4512],{"type":40,"tag":189,"props":4513,"children":4514},{"__ignoreMap":7},[4515,4538,4545,4560,4587,4594,4605,4616,4627,4634,4641,4652,4671,4678,4685],{"type":40,"tag":193,"props":4516,"children":4517},{"class":196,"line":185},[4518,4522,4526,4530,4534],{"type":40,"tag":193,"props":4519,"children":4520},{"style":672},[4521],{"type":51,"value":2969},{"type":40,"tag":193,"props":4523,"children":4524},{"style":201},[4525],{"type":51,"value":3000},{"type":40,"tag":193,"props":4527,"children":4528},{"style":672},[4529],{"type":51,"value":2979},{"type":40,"tag":193,"props":4531,"children":4532},{"style":279},[4533],{"type":51,"value":3009},{"type":40,"tag":193,"props":4535,"children":4536},{"style":207},[4537],{"type":51,"value":230},{"type":40,"tag":193,"props":4539,"children":4540},{"class":196,"line":213},[4541],{"type":40,"tag":193,"props":4542,"children":4543},{"emptyLinePlaceholder":35},[4544],{"type":51,"value":626},{"type":40,"tag":193,"props":4546,"children":4547},{"class":196,"line":233},[4548,4552,4556],{"type":40,"tag":193,"props":4549,"children":4550},{"style":672},[4551],{"type":51,"value":3028},{"type":40,"tag":193,"props":4553,"children":4554},{"style":672},[4555],{"type":51,"value":3033},{"type":40,"tag":193,"props":4557,"children":4558},{"style":207},[4559],{"type":51,"value":3038},{"type":40,"tag":193,"props":4561,"children":4562},{"class":196,"line":446},[4563,4567,4571,4575,4579,4583],{"type":40,"tag":193,"props":4564,"children":4565},{"style":257},[4566],{"type":51,"value":3046},{"type":40,"tag":193,"props":4568,"children":4569},{"style":207},[4570],{"type":51,"value":265},{"type":40,"tag":193,"props":4572,"children":4573},{"style":257},[4574],{"type":51,"value":3055},{"type":40,"tag":193,"props":4576,"children":4577},{"style":207},[4578],{"type":51,"value":265},{"type":40,"tag":193,"props":4580,"children":4581},{"style":201},[4582],{"type":51,"value":3064},{"type":40,"tag":193,"props":4584,"children":4585},{"style":207},[4586],{"type":51,"value":1425},{"type":40,"tag":193,"props":4588,"children":4589},{"class":196,"line":477},[4590],{"type":40,"tag":193,"props":4591,"children":4592},{"style":207},[4593],{"type":51,"value":3076},{"type":40,"tag":193,"props":4595,"children":4596},{"class":196,"line":507},[4597,4601],{"type":40,"tag":193,"props":4598,"children":4599},{"style":201},[4600],{"type":51,"value":3339},{"type":40,"tag":193,"props":4602,"children":4603},{"style":207},[4604],{"type":51,"value":1791},{"type":40,"tag":193,"props":4606,"children":4607},{"class":196,"line":543},[4608,4612],{"type":40,"tag":193,"props":4609,"children":4610},{"style":279},[4611],{"type":51,"value":3351},{"type":40,"tag":193,"props":4613,"children":4614},{"style":207},[4615],{"type":51,"value":1425},{"type":40,"tag":193,"props":4617,"children":4618},{"class":196,"line":582},[4619,4623],{"type":40,"tag":193,"props":4620,"children":4621},{"style":279},[4622],{"type":51,"value":3363},{"type":40,"tag":193,"props":4624,"children":4625},{"style":207},[4626],{"type":51,"value":1425},{"type":40,"tag":193,"props":4628,"children":4629},{"class":196,"line":620},[4630],{"type":40,"tag":193,"props":4631,"children":4632},{"style":279},[4633],{"type":51,"value":3375},{"type":40,"tag":193,"props":4635,"children":4636},{"class":196,"line":294},[4637],{"type":40,"tag":193,"props":4638,"children":4639},{"style":207},[4640],{"type":51,"value":3383},{"type":40,"tag":193,"props":4642,"children":4643},{"class":196,"line":660},[4644,4648],{"type":40,"tag":193,"props":4645,"children":4646},{"style":201},[4647],{"type":51,"value":3391},{"type":40,"tag":193,"props":4649,"children":4650},{"style":207},[4651],{"type":51,"value":1402},{"type":40,"tag":193,"props":4653,"children":4654},{"class":196,"line":668},[4655,4659,4663,4667],{"type":40,"tag":193,"props":4656,"children":4657},{"style":201},[4658],{"type":51,"value":3403},{"type":40,"tag":193,"props":4660,"children":4661},{"style":207},[4662],{"type":51,"value":1415},{"type":40,"tag":193,"props":4664,"children":4665},{"style":279},[4666],{"type":51,"value":3412},{"type":40,"tag":193,"props":4668,"children":4669},{"style":207},[4670],{"type":51,"value":1425},{"type":40,"tag":193,"props":4672,"children":4673},{"class":196,"line":961},[4674],{"type":40,"tag":193,"props":4675,"children":4676},{"style":207},[4677],{"type":51,"value":3424},{"type":40,"tag":193,"props":4679,"children":4680},{"class":196,"line":2115},[4681],{"type":40,"tag":193,"props":4682,"children":4683},{"style":207},[4684],{"type":51,"value":1472},{"type":40,"tag":193,"props":4686,"children":4687},{"class":196,"line":2124},[4688],{"type":40,"tag":193,"props":4689,"children":4690},{"style":207},[4691],{"type":51,"value":3137},{"type":40,"tag":47,"props":4693,"children":4694},{},[4695,4697,4703],{"type":51,"value":4696},"In this example, we use ",{"type":40,"tag":189,"props":4698,"children":4700},{"className":4699},[],[4701],{"type":51,"value":4702},"eslint:recommended",{"type":51,"value":4704}," rules as a foundation for code checks. Also, we configured it to ignore certain directories and enforced the use of curly braces.",{"type":40,"tag":58,"props":4706,"children":4707},{},[],{"type":40,"tag":47,"props":4709,"children":4710},{},[4711],{"type":51,"value":1644},{"type":40,"tag":47,"props":4713,"children":4714},{},[4715],{"type":51,"value":1649},{"type":40,"tag":47,"props":4717,"children":4718},{},[4719],{"type":40,"tag":95,"props":4720,"children":4721},{},[4722],{"type":51,"value":1657},{"type":40,"tag":1659,"props":4724,"children":4725},{},[],{"type":40,"tag":58,"props":4727,"children":4728},{},[],{"type":40,"tag":62,"props":4730,"children":4732},{"id":4731},"what-is-the-best-js-coding-standard",[4733],{"type":51,"value":4734},"What is The Best JS Coding Standard?",{"type":40,"tag":47,"props":4736,"children":4737},{},[4738,4740,4745,4747,4754,4756,4763,4765,4770],{"type":51,"value":4739},"The default config uses ",{"type":40,"tag":189,"props":4741,"children":4743},{"className":4742},[],[4744],{"type":51,"value":4702},{"type":51,"value":4746}," rules, which serve as a good base, but I need something more. A few years ago, while exploring various JavaScript coding styles, I came across ",{"type":40,"tag":109,"props":4748,"children":4751},{"href":4749,"rel":4750},"https://github.com/airbnb/javascript",[113],[4752],{"type":51,"value":4753},"Airbnb's style guide",{"type":51,"value":4755},", however, I found it to be too much for my needs. Then I found ",{"type":40,"tag":109,"props":4757,"children":4760},{"href":4758,"rel":4759},"https://github.com/standard/standard",[113],[4761],{"type":51,"value":4762},"Standard JS",{"type":51,"value":4764},", then Neostandard. You can learn more about available coding standards ",{"type":40,"tag":109,"props":4766,"children":4767},{"href":2871},[4768],{"type":51,"value":4769},"here",{"type":51,"value":265},{"type":40,"tag":147,"props":4772,"children":4773},{"url":2871},[],{"type":40,"tag":58,"props":4775,"children":4776},{},[],{"type":40,"tag":62,"props":4778,"children":4780},{"id":4779},"how-to-integrate-eslint-with-vs-code",[4781],{"type":51,"value":4782},"How to Integrate ESLint With VS Code?",{"type":40,"tag":47,"props":4784,"children":4785},{},[4786,4788,4795],{"type":51,"value":4787},"ESLint offers an integration plugin for VS Code, making it incredibly easy to get started - simply ",{"type":40,"tag":109,"props":4789,"children":4792},{"href":4790,"rel":4791},"https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint",[113],[4793],{"type":51,"value":4794},"install the plugin",{"type":51,"value":4796}," and start using it! The tool will highlight any issues in your code that don't align with the selected rules.",{"type":40,"tag":47,"props":4798,"children":4799},{},[4800],{"type":40,"tag":2789,"props":4801,"children":4803},{"alt":2791,"src":4802},"https://cdn.pragmate.dev/wp-content/uploads/2024/04/b88024d1-9d58-4f1e-910a-f1f429cef3a3.png",[],{"type":40,"tag":47,"props":4805,"children":4806},{},[4807,4809,4815],{"type":51,"value":4808},"To fix issues, you can either run the fix script in the terminal or use the ",{"type":40,"tag":189,"props":4810,"children":4812},{"className":4811},[],[4813],{"type":51,"value":4814},"cmd + shift + p",{"type":51,"value":4816}," shortcut in VS Code, type \"fix,\" and select \"Fix all auto-fixable problems\" to automatically format the code. Additionally, you can configure ESLint to format the code upon saving. However, be aware of potential conflicts with Prettier!",{"type":40,"tag":58,"props":4818,"children":4819},{},[],{"type":40,"tag":62,"props":4821,"children":4823},{"id":4822},"how-to-integrate-eslint-with-prettier",[4824],{"type":51,"value":4825},"How to Integrate ESLint With Prettier?",{"type":40,"tag":47,"props":4827,"children":4828},{},[4829,4834],{"type":40,"tag":95,"props":4830,"children":4831},{},[4832],{"type":51,"value":4833},"ESLint checks formatting rules, which can lead to conflicts with Prettier",{"type":51,"value":4835},", another tool we use in our system. What conflicts? Let's check out the following example.",{"type":40,"tag":174,"props":4837,"children":4839},{":tabs":4838},"[\"block.js\", \".prettierrc\"]",[4840,4917],{"type":40,"tag":179,"props":4841,"children":4843},{"className":242,"code":4842,"filename":3168,"language":246,"meta":7,"style":7},"class Test {\n  log() {\n    console.log('blocks');\n  }\n}\n",[4844],{"type":40,"tag":189,"props":4845,"children":4846},{"__ignoreMap":7},[4847,4862,4874,4903,4910],{"type":40,"tag":193,"props":4848,"children":4849},{"class":196,"line":185},[4850,4854,4858],{"type":40,"tag":193,"props":4851,"children":4852},{"style":672},[4853],{"type":51,"value":3180},{"type":40,"tag":193,"props":4855,"children":4856},{"style":257},[4857],{"type":51,"value":3185},{"type":40,"tag":193,"props":4859,"children":4860},{"style":207},[4861],{"type":51,"value":210},{"type":40,"tag":193,"props":4863,"children":4864},{"class":196,"line":213},[4865,4870],{"type":40,"tag":193,"props":4866,"children":4867},{"style":268},[4868],{"type":51,"value":4869},"  log",{"type":40,"tag":193,"props":4871,"children":4872},{"style":207},[4873],{"type":51,"value":3202},{"type":40,"tag":193,"props":4875,"children":4876},{"class":196,"line":233},[4877,4882,4886,4890,4894,4899],{"type":40,"tag":193,"props":4878,"children":4879},{"style":257},[4880],{"type":51,"value":4881},"    console",{"type":40,"tag":193,"props":4883,"children":4884},{"style":207},[4885],{"type":51,"value":265},{"type":40,"tag":193,"props":4887,"children":4888},{"style":268},[4889],{"type":51,"value":271},{"type":40,"tag":193,"props":4891,"children":4892},{"style":207},[4893],{"type":51,"value":276},{"type":40,"tag":193,"props":4895,"children":4896},{"style":279},[4897],{"type":51,"value":4898},"'blocks'",{"type":40,"tag":193,"props":4900,"children":4901},{"style":207},[4902],{"type":51,"value":287},{"type":40,"tag":193,"props":4904,"children":4905},{"class":196,"line":446},[4906],{"type":40,"tag":193,"props":4907,"children":4908},{"style":207},[4909],{"type":51,"value":3238},{"type":40,"tag":193,"props":4911,"children":4912},{"class":196,"line":477},[4913],{"type":40,"tag":193,"props":4914,"children":4915},{"style":207},[4916],{"type":51,"value":239},{"type":40,"tag":179,"props":4918,"children":4921},{"className":1374,"code":4919,"filename":4920,"language":1377,"meta":7,"style":7},"{\n  \"singleQuote\": false\n}\n",".prettierrc",[4922],{"type":40,"tag":189,"props":4923,"children":4924},{"__ignoreMap":7},[4925,4932,4949],{"type":40,"tag":193,"props":4926,"children":4927},{"class":196,"line":185},[4928],{"type":40,"tag":193,"props":4929,"children":4930},{"style":207},[4931],{"type":51,"value":1389},{"type":40,"tag":193,"props":4933,"children":4934},{"class":196,"line":213},[4935,4940,4944],{"type":40,"tag":193,"props":4936,"children":4937},{"style":201},[4938],{"type":51,"value":4939},"  \"singleQuote\"",{"type":40,"tag":193,"props":4941,"children":4942},{"style":207},[4943],{"type":51,"value":1415},{"type":40,"tag":193,"props":4945,"children":4946},{"style":222},[4947],{"type":51,"value":4948},"false\n",{"type":40,"tag":193,"props":4950,"children":4951},{"class":196,"line":233},[4952],{"type":40,"tag":193,"props":4953,"children":4954},{"style":207},[4955],{"type":51,"value":239},{"type":40,"tag":47,"props":4957,"children":4958},{},[4959,4961,4966],{"type":51,"value":4960},"Prettier in our setup is configured to use double quotes, while ESLint is set to enforce single quotes. When the code is formatted with Prettier, it converts all single quotes to double quotes. This action triggers ESLint to flag these as issues, and if automatic corrections are enabled, ESLint changes them back to single quotes. Then, if Prettier runs again, it marks these single quotes as incorrect and changes them back to double quotes. ",{"type":40,"tag":95,"props":4962,"children":4963},{},[4964],{"type":51,"value":4965},"This creates a cycle where whichever tool is used last could overwrite the changes made by the other,",{"type":51,"value":4967}," leading to a war between the two formatters.",{"type":40,"tag":47,"props":4969,"children":4970},{},[4971],{"type":40,"tag":2789,"props":4972,"children":4974},{"alt":2791,"src":4973},"https://cdn.pragmate.dev/wp-content/uploads/2024/04/52b8603a-9b9c-4914-b82b-2d1a32d45567.png",[],{"type":40,"tag":47,"props":4976,"children":4977},{},[4978,4985,4987,4994,4996,5003,5005,5010],{"type":40,"tag":109,"props":4979,"children":4982},{"href":4980,"rel":4981},"https://pragmate.dev/css/stylelint/#how-to-integrate-stylelint-with-prettier",[113],[4983],{"type":51,"value":4984},"A similar issue occurred with Stylelint",{"type":51,"value":4986},", but as you may recall, we didn't need to make any adjustments in the latest versions because ",{"type":40,"tag":109,"props":4988,"children":4991},{"href":4989,"rel":4990},"https://stylelint.io/migration-guide/to-16/#removed-deprecated-stylistic-rules",[113],[4992],{"type":51,"value":4993},"Stylelint no longer handles formatting rules",{"type":51,"value":4995},". However, for ESLint, while ",{"type":40,"tag":109,"props":4997,"children":5000},{"href":4998,"rel":4999},"https://eslint.org/blog/2023/10/deprecating-formatting-rules/",[113],[5001],{"type":51,"value":5002},"formatting rules are deprecated",{"type":51,"value":5004},", they have not yet been removed. So, ",{"type":40,"tag":95,"props":5006,"children":5007},{},[5008],{"type":51,"value":5009},"to avoid conflicts between those two tools, we need to disable the rules that overlap with what Prettier handles",{"type":51,"value":5011},". We can do it by installing an additional config.",{"type":40,"tag":174,"props":5013,"children":5015},{":tabs":5014},"[\"Installation\", \".eslintrc\"]",[5016,5047],{"type":40,"tag":179,"props":5017,"children":5020},{"className":1308,"code":5018,"filename":5019,"language":1310,"meta":7,"style":7},"yarn add eslint-config-prettier --dev\n","Installation",[5021],{"type":40,"tag":189,"props":5022,"children":5023},{"__ignoreMap":7},[5024],{"type":40,"tag":193,"props":5025,"children":5026},{"class":196,"line":185},[5027,5032,5037,5042],{"type":40,"tag":193,"props":5028,"children":5029},{"style":268},[5030],{"type":51,"value":5031},"yarn",{"type":40,"tag":193,"props":5033,"children":5034},{"style":279},[5035],{"type":51,"value":5036}," add",{"type":40,"tag":193,"props":5038,"children":5039},{"style":279},[5040],{"type":51,"value":5041}," eslint-config-prettier",{"type":40,"tag":193,"props":5043,"children":5044},{"style":222},[5045],{"type":51,"value":5046}," --dev\n",{"type":40,"tag":179,"props":5048,"children":5052},{"className":1374,"code":5049,"filename":5050,"highlights":5051,"language":1377,"meta":7,"style":7},"{\n  \"root\": true,\n  \"extends\": [\"semistandard\", \"prettier\"],\n  \"rules\": {\n    \"space-before-function-paren\": [\"error\", \"never\"],\n    \"curly\": [\"error\", \"all\"],\n    \"comma-dangle\": [\"error\", \"always-multiline\"],\n    \"padding-line-between-statements\": [\"error\", {\n      \"blankLine\": \"always\",\n      \"prev\": \"*\",\n      \"next\": \"return\"\n    }]\n  }\n}\n",".eslintrc",[233],[5053],{"type":40,"tag":189,"props":5054,"children":5055},{"__ignoreMap":7},[5056,5063,5084,5117,5129,5159,5188,5217,5238,5259,5280,5297,5305,5312],{"type":40,"tag":193,"props":5057,"children":5058},{"class":196,"line":185},[5059],{"type":40,"tag":193,"props":5060,"children":5061},{"style":207},[5062],{"type":51,"value":1389},{"type":40,"tag":193,"props":5064,"children":5065},{"class":196,"line":213},[5066,5071,5075,5080],{"type":40,"tag":193,"props":5067,"children":5068},{"style":201},[5069],{"type":51,"value":5070},"  \"root\"",{"type":40,"tag":193,"props":5072,"children":5073},{"style":207},[5074],{"type":51,"value":1415},{"type":40,"tag":193,"props":5076,"children":5077},{"style":222},[5078],{"type":51,"value":5079},"true",{"type":40,"tag":193,"props":5081,"children":5082},{"style":207},[5083],{"type":51,"value":1425},{"type":40,"tag":193,"props":5085,"children":5087},{"class":5086,"line":233},[196,197],[5088,5093,5098,5103,5107,5112],{"type":40,"tag":193,"props":5089,"children":5090},{"style":201},[5091],{"type":51,"value":5092},"  \"extends\"",{"type":40,"tag":193,"props":5094,"children":5095},{"style":207},[5096],{"type":51,"value":5097},": [",{"type":40,"tag":193,"props":5099,"children":5100},{"style":279},[5101],{"type":51,"value":5102},"\"semistandard\"",{"type":40,"tag":193,"props":5104,"children":5105},{"style":207},[5106],{"type":51,"value":1239},{"type":40,"tag":193,"props":5108,"children":5109},{"style":279},[5110],{"type":51,"value":5111},"\"prettier\"",{"type":40,"tag":193,"props":5113,"children":5114},{"style":207},[5115],{"type":51,"value":5116},"],\n",{"type":40,"tag":193,"props":5118,"children":5119},{"class":196,"line":446},[5120,5125],{"type":40,"tag":193,"props":5121,"children":5122},{"style":201},[5123],{"type":51,"value":5124},"  \"rules\"",{"type":40,"tag":193,"props":5126,"children":5127},{"style":207},[5128],{"type":51,"value":1402},{"type":40,"tag":193,"props":5130,"children":5131},{"class":196,"line":477},[5132,5137,5141,5146,5150,5155],{"type":40,"tag":193,"props":5133,"children":5134},{"style":201},[5135],{"type":51,"value":5136},"    \"space-before-function-paren\"",{"type":40,"tag":193,"props":5138,"children":5139},{"style":207},[5140],{"type":51,"value":5097},{"type":40,"tag":193,"props":5142,"children":5143},{"style":279},[5144],{"type":51,"value":5145},"\"error\"",{"type":40,"tag":193,"props":5147,"children":5148},{"style":207},[5149],{"type":51,"value":1239},{"type":40,"tag":193,"props":5151,"children":5152},{"style":279},[5153],{"type":51,"value":5154},"\"never\"",{"type":40,"tag":193,"props":5156,"children":5157},{"style":207},[5158],{"type":51,"value":5116},{"type":40,"tag":193,"props":5160,"children":5161},{"class":196,"line":507},[5162,5167,5171,5175,5179,5184],{"type":40,"tag":193,"props":5163,"children":5164},{"style":201},[5165],{"type":51,"value":5166},"    \"curly\"",{"type":40,"tag":193,"props":5168,"children":5169},{"style":207},[5170],{"type":51,"value":5097},{"type":40,"tag":193,"props":5172,"children":5173},{"style":279},[5174],{"type":51,"value":5145},{"type":40,"tag":193,"props":5176,"children":5177},{"style":207},[5178],{"type":51,"value":1239},{"type":40,"tag":193,"props":5180,"children":5181},{"style":279},[5182],{"type":51,"value":5183},"\"all\"",{"type":40,"tag":193,"props":5185,"children":5186},{"style":207},[5187],{"type":51,"value":5116},{"type":40,"tag":193,"props":5189,"children":5190},{"class":196,"line":543},[5191,5196,5200,5204,5208,5213],{"type":40,"tag":193,"props":5192,"children":5193},{"style":201},[5194],{"type":51,"value":5195},"    \"comma-dangle\"",{"type":40,"tag":193,"props":5197,"children":5198},{"style":207},[5199],{"type":51,"value":5097},{"type":40,"tag":193,"props":5201,"children":5202},{"style":279},[5203],{"type":51,"value":5145},{"type":40,"tag":193,"props":5205,"children":5206},{"style":207},[5207],{"type":51,"value":1239},{"type":40,"tag":193,"props":5209,"children":5210},{"style":279},[5211],{"type":51,"value":5212},"\"always-multiline\"",{"type":40,"tag":193,"props":5214,"children":5215},{"style":207},[5216],{"type":51,"value":5116},{"type":40,"tag":193,"props":5218,"children":5219},{"class":196,"line":582},[5220,5225,5229,5233],{"type":40,"tag":193,"props":5221,"children":5222},{"style":201},[5223],{"type":51,"value":5224},"    \"padding-line-between-statements\"",{"type":40,"tag":193,"props":5226,"children":5227},{"style":207},[5228],{"type":51,"value":5097},{"type":40,"tag":193,"props":5230,"children":5231},{"style":279},[5232],{"type":51,"value":5145},{"type":40,"tag":193,"props":5234,"children":5235},{"style":207},[5236],{"type":51,"value":5237},", {\n",{"type":40,"tag":193,"props":5239,"children":5240},{"class":196,"line":620},[5241,5246,5250,5255],{"type":40,"tag":193,"props":5242,"children":5243},{"style":201},[5244],{"type":51,"value":5245},"      \"blankLine\"",{"type":40,"tag":193,"props":5247,"children":5248},{"style":207},[5249],{"type":51,"value":1415},{"type":40,"tag":193,"props":5251,"children":5252},{"style":279},[5253],{"type":51,"value":5254},"\"always\"",{"type":40,"tag":193,"props":5256,"children":5257},{"style":207},[5258],{"type":51,"value":1425},{"type":40,"tag":193,"props":5260,"children":5261},{"class":196,"line":294},[5262,5267,5271,5276],{"type":40,"tag":193,"props":5263,"children":5264},{"style":201},[5265],{"type":51,"value":5266},"      \"prev\"",{"type":40,"tag":193,"props":5268,"children":5269},{"style":207},[5270],{"type":51,"value":1415},{"type":40,"tag":193,"props":5272,"children":5273},{"style":279},[5274],{"type":51,"value":5275},"\"*\"",{"type":40,"tag":193,"props":5277,"children":5278},{"style":207},[5279],{"type":51,"value":1425},{"type":40,"tag":193,"props":5281,"children":5282},{"class":196,"line":660},[5283,5288,5292],{"type":40,"tag":193,"props":5284,"children":5285},{"style":201},[5286],{"type":51,"value":5287},"      \"next\"",{"type":40,"tag":193,"props":5289,"children":5290},{"style":207},[5291],{"type":51,"value":1415},{"type":40,"tag":193,"props":5293,"children":5294},{"style":279},[5295],{"type":51,"value":5296},"\"return\"\n",{"type":40,"tag":193,"props":5298,"children":5299},{"class":196,"line":668},[5300],{"type":40,"tag":193,"props":5301,"children":5302},{"style":207},[5303],{"type":51,"value":5304},"    }]\n",{"type":40,"tag":193,"props":5306,"children":5307},{"class":196,"line":961},[5308],{"type":40,"tag":193,"props":5309,"children":5310},{"style":207},[5311],{"type":51,"value":3238},{"type":40,"tag":193,"props":5313,"children":5314},{"class":196,"line":2115},[5315],{"type":40,"tag":193,"props":5316,"children":5317},{"style":207},[5318],{"type":51,"value":239},{"type":40,"tag":58,"props":5320,"children":5321},{},[],{"type":40,"tag":47,"props":5323,"children":5324},{},[5325,5326,5331,5332,5339,5341,5346],{"type":51,"value":2801},{"type":40,"tag":109,"props":5327,"children":5329},{"href":2804,"rel":5328},[113],[5330],{"type":51,"value":2808},{"type":51,"value":1076},{"type":40,"tag":109,"props":5333,"children":5336},{"href":5334,"rel":5335},"https://www.youtube.com/watch?v=uOcJqRGAWAA",[113],[5337],{"type":51,"value":5338},"giving it a thumbs-up",{"type":51,"value":5340}," - it really helps spread the word. And if you need developers who truly care about quality and delivering great results, visit my company’s site: ",{"type":40,"tag":109,"props":5342,"children":5344},{"href":2435,"rel":5343},[113],[5345],{"type":51,"value":2816},{"type":51,"value":2818},{"type":40,"tag":2820,"props":5348,"children":5349},{},[5350],{"type":51,"value":2824},{"title":7,"searchDepth":213,"depth":213,"links":5352},[5353,5354,5355,5356,5357,5358,5359],{"id":2901,"depth":213,"text":2904},{"id":3143,"depth":213,"text":3146},{"id":3957,"depth":213,"text":3960},{"id":4479,"depth":213,"text":4482},{"id":4731,"depth":213,"text":4734},{"id":4779,"depth":213,"text":4782},{"id":4822,"depth":213,"text":4825},"content:js:eslint.md","js/eslint.md","js/eslint",{"_path":5364,"_dir":5365,"_draft":6,"_partial":6,"_locale":7,"title":5366,"description":5367,"head":5368,"tags":5379,"links":5380,"chapters":5383,"created":5376,"thumb":5385,"body":5386,"_type":2844,"_id":7412,"_source":2846,"_file":7413,"_stem":7414,"_extension":2849},"/css/stylelint","css","Stylelint: CSS Linter You Must Know As A Frontend","Let me show you Stylelint, a tool for anyone working with CSS or SCSS, making sure the code doesn't go off the rails. It identifies errors, and rule violations, suggests fixes, and sometimes solves issues for you.",{"title":5369,"link":5370,"meta":5372},"Stylelint: CSS Linter You Must Know As A Frontend | pragmate.dev",[5371],{"rel":14,"href":121},[5373,5374,5375,5377],{"name":18,"content":19},{"name":21,"content":22},{"name":24,"content":5376},"2024-05-08",{"name":27,"content":5378},"https://cdn.pragmate.dev/wp-content/uploads/2024/04/d8aa6dd6-0dc4-4826-966a-6ff17292a09e.jpeg",{"time":2866,"level":31},{"github":5381,"solution":5382},"https://github.com/pragmatedev/vilare/pull/20/files","#how-to-install-stylelint",[153,5384],"/css/stylelint-order/","frontend",{"type":37,"children":5387,"toc":7400},[5388,5392,5419,5429,5432,5435,5441,5455,5478,5518,5560,5574,5649,5652,5658,5679,5779,5798,5863,5883,5996,5999,6005,6056,6154,6175,6288,6291,6297,6311,6402,6432,6528,6531,6535,6539,6546,6549,6552,6558,6579,6584,6605,6612,6615,6621,6639,6645,6650,6827,6832,6935,6952,6962,6970,6976,6990,7165,7170,7286,7315,7346,7352,7365,7370,7373,7396],{"type":40,"tag":41,"props":5389,"children":5391},{"thumbnail":5378,"url":5390},"https://www.youtube-nocookie.com/embed/_cDvBp-C7oY",[],{"type":40,"tag":47,"props":5393,"children":5394},{},[5395,5397,5403,5405,5417],{"type":51,"value":5396},"What kind of issues? For example, if your project has a policy against using ",{"type":40,"tag":189,"props":5398,"children":5400},{"className":5399},[],[5401],{"type":51,"value":5402},"px",{"type":51,"value":5404}," units, ",{"type":40,"tag":95,"props":5406,"children":5407},{},[5408,5410,5415],{"type":51,"value":5409},"you can configure Stylelint to flag any instances where ",{"type":40,"tag":189,"props":5411,"children":5413},{"className":5412},[],[5414],{"type":51,"value":5402},{"type":51,"value":5416}," units are used, providing immediate feedback to developers that these need to be changed",{"type":51,"value":5418},". This instant alert helps maintain consistency and uphold standards within your project.",{"type":40,"tag":47,"props":5420,"children":5421},{},[5422,5427],{"type":40,"tag":95,"props":5423,"children":5424},{},[5425],{"type":51,"value":5426},"Stylelint protects against coding issues, saves development time, and improves the quality of your project.",{"type":51,"value":5428}," It is precious in team environments or larger projects where a consistent coding style is key, however, it is not so crucial if you don't write a lot of CSS code, or for the simplest projects.",{"type":40,"tag":54,"props":5430,"children":5431},{},[],{"type":40,"tag":58,"props":5433,"children":5434},{},[],{"type":40,"tag":62,"props":5436,"children":5438},{"id":5437},"how-to-install-stylelint",[5439],{"type":51,"value":5440},"How to Install Stylelint?",{"type":40,"tag":47,"props":5442,"children":5443},{},[5444,5446,5453],{"type":51,"value":5445},"At first, I suggest sticking to the ",{"type":40,"tag":109,"props":5447,"children":5450},{"href":5448,"rel":5449},"https://stylelint.io/user-guide/get-started",[113],[5451],{"type":51,"value":5452},"official docs",{"type":51,"value":5454}," and using NPM for installation 😅 This method ensures a smooth setup, avoiding the issues like I experienced with Yarn.",{"type":40,"tag":179,"props":5456,"children":5458},{"className":1308,"code":5457,"language":1310,"meta":7,"style":7},"npm init stylelint\n",[5459],{"type":40,"tag":189,"props":5460,"children":5461},{"__ignoreMap":7},[5462],{"type":40,"tag":193,"props":5463,"children":5464},{"class":196,"line":185},[5465,5469,5473],{"type":40,"tag":193,"props":5466,"children":5467},{"style":268},[5468],{"type":51,"value":2929},{"type":40,"tag":193,"props":5470,"children":5471},{"style":279},[5472],{"type":51,"value":2934},{"type":40,"tag":193,"props":5474,"children":5475},{"style":279},[5476],{"type":51,"value":5477}," stylelint\n",{"type":40,"tag":47,"props":5479,"children":5480},{},[5481,5483,5490,5492,5499,5501,5508,5510,5516],{"type":51,"value":5482},"The installation command not only sets up Stylelint but also includes ",{"type":40,"tag":109,"props":5484,"children":5487},{"href":5485,"rel":5486},"https://github.com/stylelint/stylelint-config-recommended/blob/main/index.js",[113],[5488],{"type":51,"value":5489},"recommended rules",{"type":51,"value":5491},", providing a strong foundation that you can ",{"type":40,"tag":109,"props":5493,"children":5496},{"href":5494,"rel":5495},"https://stylelint.io/user-guide/customize",[113],[5497],{"type":51,"value":5498},"customize",{"type":51,"value":5500}," for your project's needs. It also creates a ",{"type":40,"tag":109,"props":5502,"children":5505},{"href":5503,"rel":5504},"https://stylelint.io/user-guide/configure/",[113],[5506],{"type":51,"value":5507},"configuration file",{"type":51,"value":5509}," named ",{"type":40,"tag":189,"props":5511,"children":5513},{"className":5512},[],[5514],{"type":51,"value":5515},".stylelintrc.json",{"type":51,"value":5517}," that you'll modify later.",{"type":40,"tag":179,"props":5519,"children":5521},{"className":1374,"code":5520,"filename":5515,"language":1377,"meta":7,"style":7},"{\n  \"extends\": [\"stylelint-config-standard\"]\n}\n",[5522],{"type":40,"tag":189,"props":5523,"children":5524},{"__ignoreMap":7},[5525,5532,5553],{"type":40,"tag":193,"props":5526,"children":5527},{"class":196,"line":185},[5528],{"type":40,"tag":193,"props":5529,"children":5530},{"style":207},[5531],{"type":51,"value":1389},{"type":40,"tag":193,"props":5533,"children":5534},{"class":196,"line":213},[5535,5539,5543,5548],{"type":40,"tag":193,"props":5536,"children":5537},{"style":201},[5538],{"type":51,"value":5092},{"type":40,"tag":193,"props":5540,"children":5541},{"style":207},[5542],{"type":51,"value":5097},{"type":40,"tag":193,"props":5544,"children":5545},{"style":279},[5546],{"type":51,"value":5547},"\"stylelint-config-standard\"",{"type":40,"tag":193,"props":5549,"children":5550},{"style":207},[5551],{"type":51,"value":5552},"]\n",{"type":40,"tag":193,"props":5554,"children":5555},{"class":196,"line":233},[5556],{"type":40,"tag":193,"props":5557,"children":5558},{"style":207},[5559],{"type":51,"value":239},{"type":40,"tag":47,"props":5561,"children":5562},{},[5563,5565,5572],{"type":51,"value":5564},"If you're working with SCSS, integrating ",{"type":40,"tag":109,"props":5566,"children":5569},{"href":5567,"rel":5568},"https://github.com/stylelint-scss/stylelint-config-standard-scss/blob/main/index.js",[113],[5570],{"type":51,"value":5571},"SCSS-specific rules",{"type":51,"value":5573}," into your configuration is easy. Install them with the command below and tell the Stylelint to use them.",{"type":40,"tag":174,"props":5575,"children":5577},{":tabs":5576},"[\"Install\", \".stylelintrc.json\"]",[5578,5608],{"type":40,"tag":179,"props":5579,"children":5582},{"className":1308,"code":5580,"filename":5581,"language":1310,"meta":7,"style":7},"npm install stylelint-config-standard-scss --save-dev\n","Install",[5583],{"type":40,"tag":189,"props":5584,"children":5585},{"__ignoreMap":7},[5586],{"type":40,"tag":193,"props":5587,"children":5588},{"class":196,"line":185},[5589,5593,5598,5603],{"type":40,"tag":193,"props":5590,"children":5591},{"style":268},[5592],{"type":51,"value":2929},{"type":40,"tag":193,"props":5594,"children":5595},{"style":279},[5596],{"type":51,"value":5597}," install",{"type":40,"tag":193,"props":5599,"children":5600},{"style":279},[5601],{"type":51,"value":5602}," stylelint-config-standard-scss",{"type":40,"tag":193,"props":5604,"children":5605},{"style":222},[5606],{"type":51,"value":5607}," --save-dev\n",{"type":40,"tag":179,"props":5609,"children":5611},{"className":1374,"code":5610,"filename":5515,"language":1377,"meta":7,"style":7},"{\n  \"extends\": [\"stylelint-config-standard-scss\"]\n}\n",[5612],{"type":40,"tag":189,"props":5613,"children":5614},{"__ignoreMap":7},[5615,5622,5642],{"type":40,"tag":193,"props":5616,"children":5617},{"class":196,"line":185},[5618],{"type":40,"tag":193,"props":5619,"children":5620},{"style":207},[5621],{"type":51,"value":1389},{"type":40,"tag":193,"props":5623,"children":5624},{"class":196,"line":213},[5625,5629,5633,5638],{"type":40,"tag":193,"props":5626,"children":5627},{"style":201},[5628],{"type":51,"value":5092},{"type":40,"tag":193,"props":5630,"children":5631},{"style":207},[5632],{"type":51,"value":5097},{"type":40,"tag":193,"props":5634,"children":5635},{"style":279},[5636],{"type":51,"value":5637},"\"stylelint-config-standard-scss\"",{"type":40,"tag":193,"props":5639,"children":5640},{"style":207},[5641],{"type":51,"value":5552},{"type":40,"tag":193,"props":5643,"children":5644},{"class":196,"line":233},[5645],{"type":40,"tag":193,"props":5646,"children":5647},{"style":207},[5648],{"type":51,"value":239},{"type":40,"tag":58,"props":5650,"children":5651},{},[],{"type":40,"tag":62,"props":5653,"children":5655},{"id":5654},"how-to-use-stylelint",[5656],{"type":51,"value":5657},"How to Use Stylelint?",{"type":40,"tag":47,"props":5659,"children":5660},{},[5661,5663,5670,5672,5678],{"type":51,"value":5662},"Once Stylelint is installed, you're ready to put it to work. With the ",{"type":40,"tag":109,"props":5664,"children":5667},{"href":5665,"rel":5666},"https://stylelint.io/user-guide/cli",[113],[5668],{"type":51,"value":5669},"command-line interface",{"type":51,"value":5671},", you can lint all SCSS files within the specific directory e.g. ",{"type":40,"tag":189,"props":5673,"children":5675},{"className":5674},[],[5676],{"type":51,"value":5677},"resources",{"type":51,"value":265},{"type":40,"tag":179,"props":5680,"children":5682},{"className":3474,"code":5681,"language":3478,"meta":7,"style":7},"yarn stylelint resources/**/*.scss\n\nresources/styles/styles.scss\n   2:16  ✖  Unexpected quotes around \"Montserrat\"           font-family-name-quotes\n  11:16  ✖  Unexpected quotes around \"Montserrat\"           font-family-name-quotes\n  20:16  ✖  Unexpected quotes around \"Montserrat\"           font-family-name-quotes\n  35:16  ✖  Unexpected quotes around \"Montserrat\"           font-family-name-quotes\n  35:16  ✖  Unexpected missing generic font family          font-family-no-missing-generic-family-keyword\n  47:3   ✖  Expected \"0 0 1.375rem 0\" to be \"0 0 1.375rem\"  shorthand-property-no-redundant-values\n\n✖ 6 problems (6 errors, 0 warnings)\n  5 errors potentially fixable with the \"--fix\" option.\n",[5683],{"type":40,"tag":189,"props":5684,"children":5685},{"__ignoreMap":7},[5686,5694,5701,5708,5716,5724,5732,5740,5748,5756,5763,5771],{"type":40,"tag":193,"props":5687,"children":5688},{"class":196,"line":185},[5689],{"type":40,"tag":193,"props":5690,"children":5691},{"style":207},[5692],{"type":51,"value":5693},"yarn stylelint resources/**/*.scss\n",{"type":40,"tag":193,"props":5695,"children":5696},{"class":196,"line":213},[5697],{"type":40,"tag":193,"props":5698,"children":5699},{"emptyLinePlaceholder":35},[5700],{"type":51,"value":626},{"type":40,"tag":193,"props":5702,"children":5703},{"class":196,"line":233},[5704],{"type":40,"tag":193,"props":5705,"children":5706},{"style":207},[5707],{"type":51,"value":734},{"type":40,"tag":193,"props":5709,"children":5710},{"class":196,"line":446},[5711],{"type":40,"tag":193,"props":5712,"children":5713},{"style":207},[5714],{"type":51,"value":5715},"   2:16  ✖  Unexpected quotes around \"Montserrat\"           font-family-name-quotes\n",{"type":40,"tag":193,"props":5717,"children":5718},{"class":196,"line":477},[5719],{"type":40,"tag":193,"props":5720,"children":5721},{"style":207},[5722],{"type":51,"value":5723},"  11:16  ✖  Unexpected quotes around \"Montserrat\"           font-family-name-quotes\n",{"type":40,"tag":193,"props":5725,"children":5726},{"class":196,"line":507},[5727],{"type":40,"tag":193,"props":5728,"children":5729},{"style":207},[5730],{"type":51,"value":5731},"  20:16  ✖  Unexpected quotes around \"Montserrat\"           font-family-name-quotes\n",{"type":40,"tag":193,"props":5733,"children":5734},{"class":196,"line":543},[5735],{"type":40,"tag":193,"props":5736,"children":5737},{"style":207},[5738],{"type":51,"value":5739},"  35:16  ✖  Unexpected quotes around \"Montserrat\"           font-family-name-quotes\n",{"type":40,"tag":193,"props":5741,"children":5742},{"class":196,"line":582},[5743],{"type":40,"tag":193,"props":5744,"children":5745},{"style":207},[5746],{"type":51,"value":5747},"  35:16  ✖  Unexpected missing generic font family          font-family-no-missing-generic-family-keyword\n",{"type":40,"tag":193,"props":5749,"children":5750},{"class":196,"line":620},[5751],{"type":40,"tag":193,"props":5752,"children":5753},{"style":207},[5754],{"type":51,"value":5755},"  47:3   ✖  Expected \"0 0 1.375rem 0\" to be \"0 0 1.375rem\"  shorthand-property-no-redundant-values\n",{"type":40,"tag":193,"props":5757,"children":5758},{"class":196,"line":294},[5759],{"type":40,"tag":193,"props":5760,"children":5761},{"emptyLinePlaceholder":35},[5762],{"type":51,"value":626},{"type":40,"tag":193,"props":5764,"children":5765},{"class":196,"line":660},[5766],{"type":40,"tag":193,"props":5767,"children":5768},{"style":207},[5769],{"type":51,"value":5770},"✖ 6 problems (6 errors, 0 warnings)\n",{"type":40,"tag":193,"props":5772,"children":5773},{"class":196,"line":668},[5774],{"type":40,"tag":193,"props":5775,"children":5776},{"style":207},[5777],{"type":51,"value":5778},"  5 errors potentially fixable with the \"--fix\" option.\n",{"type":40,"tag":47,"props":5780,"children":5781},{},[5782,5796],{"type":40,"tag":193,"props":5783,"children":5786},{"className":5784},[5785],"-highlight",[5787,5789,5794],{"type":51,"value":5788},"If Stylelint identifies issues that can be automatically fixed, appending the ",{"type":40,"tag":189,"props":5790,"children":5792},{"className":5791},[],[5793],{"type":51,"value":3739},{"type":51,"value":5795}," flag to your command will address these issues",{"type":51,"value":5797},", simplifying your workflow. Any remaining issues must be manually handled, which is a standard part of the process.",{"type":40,"tag":179,"props":5799,"children":5801},{"className":3474,"code":5800,"language":3478,"meta":7,"style":7},"yarn stylelint resources/**/*.scss --fix\n\nresources/styles/styles.scss\n  35:16  ✖  Unexpected missing generic font family  font-family-no-missing-generic-family-keyword\n\n✖ 1 problem (1 error, 0 warnings)\n\nerror Command failed with exit code 2.\n",[5802],{"type":40,"tag":189,"props":5803,"children":5804},{"__ignoreMap":7},[5805,5813,5820,5827,5835,5842,5849,5856],{"type":40,"tag":193,"props":5806,"children":5807},{"class":196,"line":185},[5808],{"type":40,"tag":193,"props":5809,"children":5810},{"style":207},[5811],{"type":51,"value":5812},"yarn stylelint resources/**/*.scss --fix\n",{"type":40,"tag":193,"props":5814,"children":5815},{"class":196,"line":213},[5816],{"type":40,"tag":193,"props":5817,"children":5818},{"emptyLinePlaceholder":35},[5819],{"type":51,"value":626},{"type":40,"tag":193,"props":5821,"children":5822},{"class":196,"line":233},[5823],{"type":40,"tag":193,"props":5824,"children":5825},{"style":207},[5826],{"type":51,"value":734},{"type":40,"tag":193,"props":5828,"children":5829},{"class":196,"line":446},[5830],{"type":40,"tag":193,"props":5831,"children":5832},{"style":207},[5833],{"type":51,"value":5834},"  35:16  ✖  Unexpected missing generic font family  font-family-no-missing-generic-family-keyword\n",{"type":40,"tag":193,"props":5836,"children":5837},{"class":196,"line":477},[5838],{"type":40,"tag":193,"props":5839,"children":5840},{"emptyLinePlaceholder":35},[5841],{"type":51,"value":626},{"type":40,"tag":193,"props":5843,"children":5844},{"class":196,"line":507},[5845],{"type":40,"tag":193,"props":5846,"children":5847},{"style":207},[5848],{"type":51,"value":758},{"type":40,"tag":193,"props":5850,"children":5851},{"class":196,"line":543},[5852],{"type":40,"tag":193,"props":5853,"children":5854},{"emptyLinePlaceholder":35},[5855],{"type":51,"value":626},{"type":40,"tag":193,"props":5857,"children":5858},{"class":196,"line":582},[5859],{"type":40,"tag":193,"props":5860,"children":5861},{"style":207},[5862],{"type":51,"value":781},{"type":40,"tag":47,"props":5864,"children":5865},{},[5866,5868,5873,5875,5881],{"type":51,"value":5867},"Tip: Dropping Stylelint tasks into your ",{"type":40,"tag":189,"props":5869,"children":5871},{"className":5870},[],[5872],{"type":51,"value":1231},{"type":51,"value":5874}," is a great way to make your setup more efficient, keeping your configs and dependencies in one place. Just place the lining and formatting commands after the Prettier's ones (they have been described ",{"type":40,"tag":109,"props":5876,"children":5879},{"href":5877,"rel":5878},"https://pragmate.dev/environment/prettier/",[113],[5880],{"type":51,"value":4769},{"type":51,"value":5882},").",{"type":40,"tag":179,"props":5884,"children":5886},{"className":1374,"code":5885,"filename":1231,"language":1377,"meta":7,"style":7},"{\n  \"scripts\": {\n    \"build\": \"vite build\",\n    \"dev\": \"vite\",\n    \"lint\": \"prettier . --check && stylelint **/*.{css,scss};\",\n    \"format\": \"prettier . --write && stylelint **/*.{css,scss} --fix;\"\n  },\n}\n",[5887],{"type":40,"tag":189,"props":5888,"children":5889},{"__ignoreMap":7},[5890,5897,5908,5927,5946,5966,5982,5989],{"type":40,"tag":193,"props":5891,"children":5892},{"class":196,"line":185},[5893],{"type":40,"tag":193,"props":5894,"children":5895},{"style":207},[5896],{"type":51,"value":1389},{"type":40,"tag":193,"props":5898,"children":5899},{"class":196,"line":213},[5900,5904],{"type":40,"tag":193,"props":5901,"children":5902},{"style":201},[5903],{"type":51,"value":1397},{"type":40,"tag":193,"props":5905,"children":5906},{"style":207},[5907],{"type":51,"value":1402},{"type":40,"tag":193,"props":5909,"children":5910},{"class":196,"line":233},[5911,5915,5919,5923],{"type":40,"tag":193,"props":5912,"children":5913},{"style":201},[5914],{"type":51,"value":3865},{"type":40,"tag":193,"props":5916,"children":5917},{"style":207},[5918],{"type":51,"value":1415},{"type":40,"tag":193,"props":5920,"children":5921},{"style":279},[5922],{"type":51,"value":3874},{"type":40,"tag":193,"props":5924,"children":5925},{"style":207},[5926],{"type":51,"value":1425},{"type":40,"tag":193,"props":5928,"children":5929},{"class":196,"line":446},[5930,5934,5938,5942],{"type":40,"tag":193,"props":5931,"children":5932},{"style":201},[5933],{"type":51,"value":3886},{"type":40,"tag":193,"props":5935,"children":5936},{"style":207},[5937],{"type":51,"value":1415},{"type":40,"tag":193,"props":5939,"children":5940},{"style":279},[5941],{"type":51,"value":3895},{"type":40,"tag":193,"props":5943,"children":5944},{"style":207},[5945],{"type":51,"value":1425},{"type":40,"tag":193,"props":5947,"children":5948},{"class":196,"line":477},[5949,5953,5957,5962],{"type":40,"tag":193,"props":5950,"children":5951},{"style":201},[5952],{"type":51,"value":1410},{"type":40,"tag":193,"props":5954,"children":5955},{"style":207},[5956],{"type":51,"value":1415},{"type":40,"tag":193,"props":5958,"children":5959},{"style":279},[5960],{"type":51,"value":5961},"\"prettier . --check && stylelint **/*.{css,scss};\"",{"type":40,"tag":193,"props":5963,"children":5964},{"style":207},[5965],{"type":51,"value":1425},{"type":40,"tag":193,"props":5967,"children":5968},{"class":196,"line":507},[5969,5973,5977],{"type":40,"tag":193,"props":5970,"children":5971},{"style":201},[5972],{"type":51,"value":1433},{"type":40,"tag":193,"props":5974,"children":5975},{"style":207},[5976],{"type":51,"value":1415},{"type":40,"tag":193,"props":5978,"children":5979},{"style":279},[5980],{"type":51,"value":5981},"\"prettier . --write && stylelint **/*.{css,scss} --fix;\"\n",{"type":40,"tag":193,"props":5983,"children":5984},{"class":196,"line":543},[5985],{"type":40,"tag":193,"props":5986,"children":5987},{"style":207},[5988],{"type":51,"value":1472},{"type":40,"tag":193,"props":5990,"children":5991},{"class":196,"line":582},[5992],{"type":40,"tag":193,"props":5993,"children":5994},{"style":207},[5995],{"type":51,"value":239},{"type":40,"tag":58,"props":5997,"children":5998},{},[],{"type":40,"tag":62,"props":6000,"children":6002},{"id":6001},"how-to-configure-stylelint",[6003],{"type":51,"value":6004},"How to Configure Stylelint?",{"type":40,"tag":47,"props":6006,"children":6007},{},[6008,6010,6017,6019,6032,6034,6039,6041,6047,6049,6055],{"type":51,"value":6009},"Stylelint provides several ",{"type":40,"tag":109,"props":6011,"children":6014},{"href":6012,"rel":6013},"https://stylelint.io/user-guide/configure",[113],[6015],{"type":51,"value":6016},"configurable options",{"type":51,"value":6018},", but ",{"type":40,"tag":95,"props":6020,"children":6021},{},[6022,6024,6030],{"type":51,"value":6023},"the most I need is choosing standard and ",{"type":40,"tag":109,"props":6025,"children":6027},{"href":5494,"rel":6026},[113],[6028],{"type":51,"value":6029},"adjusting rules",{"type":51,"value":6031}," to my needs",{"type":51,"value":6033}," what can be eaisly done in the ",{"type":40,"tag":189,"props":6035,"children":6037},{"className":6036},[],[6038],{"type":51,"value":5515},{"type":51,"value":6040}," file. Let's say that I want to allow empty CSS files, which are forbidden in the standard config. I need to add a ",{"type":40,"tag":189,"props":6042,"children":6044},{"className":6043},[],[6045],{"type":51,"value":6046},"rules",{"type":51,"value":6048}," key to the config and disable ",{"type":40,"tag":189,"props":6050,"children":6052},{"className":6051},[],[6053],{"type":51,"value":6054},"no-empty-source",{"type":51,"value":265},{"type":40,"tag":179,"props":6057,"children":6060},{"className":1374,"code":6058,"filename":5515,"highlights":6059,"language":1377,"meta":7,"style":7},"{\n  \"extends\": [\n    \"stylelint-config-standard-scss\",\n    \"stylelint-config-clean-order\"\n  ],\n  \"rules\": {\n    \"no-empty-source\": null\n  }\n}\n",[507,543,582],[6061],{"type":40,"tag":189,"props":6062,"children":6063},{"__ignoreMap":7},[6064,6071,6082,6094,6102,6109,6121,6139,6147],{"type":40,"tag":193,"props":6065,"children":6066},{"class":196,"line":185},[6067],{"type":40,"tag":193,"props":6068,"children":6069},{"style":207},[6070],{"type":51,"value":1389},{"type":40,"tag":193,"props":6072,"children":6073},{"class":196,"line":213},[6074,6078],{"type":40,"tag":193,"props":6075,"children":6076},{"style":201},[6077],{"type":51,"value":5092},{"type":40,"tag":193,"props":6079,"children":6080},{"style":207},[6081],{"type":51,"value":1791},{"type":40,"tag":193,"props":6083,"children":6084},{"class":196,"line":233},[6085,6090],{"type":40,"tag":193,"props":6086,"children":6087},{"style":279},[6088],{"type":51,"value":6089},"    \"stylelint-config-standard-scss\"",{"type":40,"tag":193,"props":6091,"children":6092},{"style":207},[6093],{"type":51,"value":1425},{"type":40,"tag":193,"props":6095,"children":6096},{"class":196,"line":446},[6097],{"type":40,"tag":193,"props":6098,"children":6099},{"style":279},[6100],{"type":51,"value":6101},"    \"stylelint-config-clean-order\"\n",{"type":40,"tag":193,"props":6103,"children":6104},{"class":196,"line":477},[6105],{"type":40,"tag":193,"props":6106,"children":6107},{"style":207},[6108],{"type":51,"value":1819},{"type":40,"tag":193,"props":6110,"children":6112},{"class":6111,"line":507},[196,197],[6113,6117],{"type":40,"tag":193,"props":6114,"children":6115},{"style":201},[6116],{"type":51,"value":5124},{"type":40,"tag":193,"props":6118,"children":6119},{"style":207},[6120],{"type":51,"value":1402},{"type":40,"tag":193,"props":6122,"children":6124},{"class":6123,"line":543},[196,197],[6125,6130,6134],{"type":40,"tag":193,"props":6126,"children":6127},{"style":201},[6128],{"type":51,"value":6129},"    \"no-empty-source\"",{"type":40,"tag":193,"props":6131,"children":6132},{"style":207},[6133],{"type":51,"value":1415},{"type":40,"tag":193,"props":6135,"children":6136},{"style":222},[6137],{"type":51,"value":6138},"null\n",{"type":40,"tag":193,"props":6140,"children":6142},{"class":6141,"line":582},[196,197],[6143],{"type":40,"tag":193,"props":6144,"children":6145},{"style":207},[6146],{"type":51,"value":3238},{"type":40,"tag":193,"props":6148,"children":6149},{"class":196,"line":620},[6150],{"type":40,"tag":193,"props":6151,"children":6152},{"style":207},[6153],{"type":51,"value":239},{"type":40,"tag":47,"props":6155,"children":6156},{},[6157,6159,6165,6167,6173],{"type":51,"value":6158},"Keep in mind that Stylelint ",{"type":40,"tag":109,"props":6160,"children":6162},{"href":5503,"rel":6161},[113],[6163],{"type":51,"value":6164},"searches for configurations in several file types",{"type":51,"value":6166},", so JSON is not your only option. If you're looking for more flexible solutions, such as applying rules conditionally, you might want to consider using the ",{"type":40,"tag":189,"props":6168,"children":6170},{"className":6169},[],[6171],{"type":51,"value":6172},"stylelint.config.js",{"type":51,"value":6174}," format.",{"type":40,"tag":179,"props":6176,"children":6178},{"className":242,"code":6177,"filename":6172,"language":246,"meta":7,"style":7},"export default {\n  extends: [\n    'stylelint-config-standard-scss',\n    'stylelint-config-clean-order',\n  ],\n  rules: {\n    'no-empty-source': null,\n  },\n};\n",[6179],{"type":40,"tag":189,"props":6180,"children":6181},{"__ignoreMap":7},[6182,6197,6209,6221,6233,6240,6252,6273,6280],{"type":40,"tag":193,"props":6183,"children":6184},{"class":196,"line":185},[6185,6189,6193],{"type":40,"tag":193,"props":6186,"children":6187},{"style":672},[6188],{"type":51,"value":3028},{"type":40,"tag":193,"props":6190,"children":6191},{"style":672},[6192],{"type":51,"value":3033},{"type":40,"tag":193,"props":6194,"children":6195},{"style":207},[6196],{"type":51,"value":210},{"type":40,"tag":193,"props":6198,"children":6199},{"class":196,"line":213},[6200,6205],{"type":40,"tag":193,"props":6201,"children":6202},{"style":201},[6203],{"type":51,"value":6204},"  extends",{"type":40,"tag":193,"props":6206,"children":6207},{"style":207},[6208],{"type":51,"value":1791},{"type":40,"tag":193,"props":6210,"children":6211},{"class":196,"line":233},[6212,6217],{"type":40,"tag":193,"props":6213,"children":6214},{"style":279},[6215],{"type":51,"value":6216},"    'stylelint-config-standard-scss'",{"type":40,"tag":193,"props":6218,"children":6219},{"style":207},[6220],{"type":51,"value":1425},{"type":40,"tag":193,"props":6222,"children":6223},{"class":196,"line":446},[6224,6229],{"type":40,"tag":193,"props":6225,"children":6226},{"style":279},[6227],{"type":51,"value":6228},"    'stylelint-config-clean-order'",{"type":40,"tag":193,"props":6230,"children":6231},{"style":207},[6232],{"type":51,"value":1425},{"type":40,"tag":193,"props":6234,"children":6235},{"class":196,"line":477},[6236],{"type":40,"tag":193,"props":6237,"children":6238},{"style":207},[6239],{"type":51,"value":1819},{"type":40,"tag":193,"props":6241,"children":6242},{"class":196,"line":507},[6243,6248],{"type":40,"tag":193,"props":6244,"children":6245},{"style":201},[6246],{"type":51,"value":6247},"  rules",{"type":40,"tag":193,"props":6249,"children":6250},{"style":207},[6251],{"type":51,"value":1402},{"type":40,"tag":193,"props":6253,"children":6254},{"class":196,"line":543},[6255,6260,6264,6269],{"type":40,"tag":193,"props":6256,"children":6257},{"style":279},[6258],{"type":51,"value":6259},"    'no-empty-source'",{"type":40,"tag":193,"props":6261,"children":6262},{"style":207},[6263],{"type":51,"value":1415},{"type":40,"tag":193,"props":6265,"children":6266},{"style":222},[6267],{"type":51,"value":6268},"null",{"type":40,"tag":193,"props":6270,"children":6271},{"style":207},[6272],{"type":51,"value":1425},{"type":40,"tag":193,"props":6274,"children":6275},{"class":196,"line":582},[6276],{"type":40,"tag":193,"props":6277,"children":6278},{"style":207},[6279],{"type":51,"value":1472},{"type":40,"tag":193,"props":6281,"children":6282},{"class":196,"line":620},[6283],{"type":40,"tag":193,"props":6284,"children":6285},{"style":207},[6286],{"type":51,"value":6287},"};\n",{"type":40,"tag":58,"props":6289,"children":6290},{},[],{"type":40,"tag":62,"props":6292,"children":6294},{"id":6293},"how-to-ignore-errors-in-stylelint",[6295],{"type":51,"value":6296},"How to Ignore Errors in Stylelint?",{"type":40,"tag":47,"props":6298,"children":6299},{},[6300,6302,6309],{"type":51,"value":6301},"The process with Stylelint is similar to other linters and formatters. You can use specific ",{"type":40,"tag":109,"props":6303,"children":6306},{"href":6304,"rel":6305},"https://stylelint.io/user-guide/ignore-code/#parts-of-a-file",[113],[6307],{"type":51,"value":6308},"comment formats",{"type":51,"value":6310}," to exclude certain blocks from validation, specific lines, or even disable a specific rule for a section or line.",{"type":40,"tag":179,"props":6312,"children":6315},{"className":6313,"code":6314,"language":5365,"meta":7,"style":7},"language-css shiki shiki-themes one-dark-pro","/* stylelint-disable */\na {}\n/* stylelint-enable */\n\n#id { /* stylelint-disable-line */\n  color: pink !important; /* stylelint-disable-line declaration-no-important */\n}\n",[6316],{"type":40,"tag":189,"props":6317,"children":6318},{"__ignoreMap":7},[6319,6327,6339,6347,6354,6372,6395],{"type":40,"tag":193,"props":6320,"children":6321},{"class":196,"line":185},[6322],{"type":40,"tag":193,"props":6323,"children":6324},{"style":4180},[6325],{"type":51,"value":6326},"/* stylelint-disable */\n",{"type":40,"tag":193,"props":6328,"children":6329},{"class":196,"line":213},[6330,6334],{"type":40,"tag":193,"props":6331,"children":6332},{"style":201},[6333],{"type":51,"value":109},{"type":40,"tag":193,"props":6335,"children":6336},{"style":207},[6337],{"type":51,"value":6338}," {}\n",{"type":40,"tag":193,"props":6340,"children":6341},{"class":196,"line":233},[6342],{"type":40,"tag":193,"props":6343,"children":6344},{"style":4180},[6345],{"type":51,"value":6346},"/* stylelint-enable */\n",{"type":40,"tag":193,"props":6348,"children":6349},{"class":196,"line":446},[6350],{"type":40,"tag":193,"props":6351,"children":6352},{"emptyLinePlaceholder":35},[6353],{"type":51,"value":626},{"type":40,"tag":193,"props":6355,"children":6356},{"class":196,"line":477},[6357,6362,6367],{"type":40,"tag":193,"props":6358,"children":6359},{"style":268},[6360],{"type":51,"value":6361},"#id",{"type":40,"tag":193,"props":6363,"children":6364},{"style":207},[6365],{"type":51,"value":6366}," { ",{"type":40,"tag":193,"props":6368,"children":6369},{"style":4180},[6370],{"type":51,"value":6371},"/* stylelint-disable-line */\n",{"type":40,"tag":193,"props":6373,"children":6374},{"class":196,"line":507},[6375,6380,6385,6390],{"type":40,"tag":193,"props":6376,"children":6377},{"style":207},[6378],{"type":51,"value":6379},"  color: pink ",{"type":40,"tag":193,"props":6381,"children":6382},{"style":672},[6383],{"type":51,"value":6384},"!important",{"type":40,"tag":193,"props":6386,"children":6387},{"style":207},[6388],{"type":51,"value":6389},"; ",{"type":40,"tag":193,"props":6391,"children":6392},{"style":4180},[6393],{"type":51,"value":6394},"/* stylelint-disable-line declaration-no-important */\n",{"type":40,"tag":193,"props":6396,"children":6397},{"class":196,"line":543},[6398],{"type":40,"tag":193,"props":6399,"children":6400},{"style":207},[6401],{"type":51,"value":239},{"type":40,"tag":47,"props":6403,"children":6404},{},[6405,6407,6413,6415,6422,6424,6430],{"type":51,"value":6406},"Additionally, you can create a ",{"type":40,"tag":189,"props":6408,"children":6410},{"className":6409},[],[6411],{"type":51,"value":6412},".stylelintignore",{"type":51,"value":6414}," file to ",{"type":40,"tag":109,"props":6416,"children":6419},{"href":6417,"rel":6418},"https://stylelint.io/user-guide/ignore-code/#files-entirely",[113],[6420],{"type":51,"value":6421},"exclude entire directories or specific file formats",{"type":51,"value":6423}," from being linted. Alternatively, you can achieve the same effect by specifying files to ignore in the ",{"type":40,"tag":189,"props":6425,"children":6427},{"className":6426},[],[6428],{"type":51,"value":6429},"ignoreFiles",{"type":51,"value":6431}," key of the Stylelint configuration file.",{"type":40,"tag":179,"props":6433,"children":6435},{"className":1374,"code":6434,"filename":5515,"language":1377,"meta":7,"style":7},"{\n  \"extends\": [\n    \"stylelint-config-standard-scss\",\n    \"stylelint-config-clean-order\"\n  ],\n  \"ignoreFiles\": [\n    \"node_modules\",\n    \"dist/**/*\"\n  ]\n}\n",[6436],{"type":40,"tag":189,"props":6437,"children":6438},{"__ignoreMap":7},[6439,6446,6457,6468,6475,6482,6494,6506,6514,6521],{"type":40,"tag":193,"props":6440,"children":6441},{"class":196,"line":185},[6442],{"type":40,"tag":193,"props":6443,"children":6444},{"style":207},[6445],{"type":51,"value":1389},{"type":40,"tag":193,"props":6447,"children":6448},{"class":196,"line":213},[6449,6453],{"type":40,"tag":193,"props":6450,"children":6451},{"style":201},[6452],{"type":51,"value":5092},{"type":40,"tag":193,"props":6454,"children":6455},{"style":207},[6456],{"type":51,"value":1791},{"type":40,"tag":193,"props":6458,"children":6459},{"class":196,"line":233},[6460,6464],{"type":40,"tag":193,"props":6461,"children":6462},{"style":279},[6463],{"type":51,"value":6089},{"type":40,"tag":193,"props":6465,"children":6466},{"style":207},[6467],{"type":51,"value":1425},{"type":40,"tag":193,"props":6469,"children":6470},{"class":196,"line":446},[6471],{"type":40,"tag":193,"props":6472,"children":6473},{"style":279},[6474],{"type":51,"value":6101},{"type":40,"tag":193,"props":6476,"children":6477},{"class":196,"line":477},[6478],{"type":40,"tag":193,"props":6479,"children":6480},{"style":207},[6481],{"type":51,"value":1819},{"type":40,"tag":193,"props":6483,"children":6484},{"class":196,"line":507},[6485,6490],{"type":40,"tag":193,"props":6486,"children":6487},{"style":201},[6488],{"type":51,"value":6489},"  \"ignoreFiles\"",{"type":40,"tag":193,"props":6491,"children":6492},{"style":207},[6493],{"type":51,"value":1791},{"type":40,"tag":193,"props":6495,"children":6496},{"class":196,"line":543},[6497,6502],{"type":40,"tag":193,"props":6498,"children":6499},{"style":279},[6500],{"type":51,"value":6501},"    \"node_modules\"",{"type":40,"tag":193,"props":6503,"children":6504},{"style":207},[6505],{"type":51,"value":1425},{"type":40,"tag":193,"props":6507,"children":6508},{"class":196,"line":582},[6509],{"type":40,"tag":193,"props":6510,"children":6511},{"style":279},[6512],{"type":51,"value":6513},"    \"dist/**/*\"\n",{"type":40,"tag":193,"props":6515,"children":6516},{"class":196,"line":620},[6517],{"type":40,"tag":193,"props":6518,"children":6519},{"style":207},[6520],{"type":51,"value":1886},{"type":40,"tag":193,"props":6522,"children":6523},{"class":196,"line":294},[6524],{"type":40,"tag":193,"props":6525,"children":6526},{"style":207},[6527],{"type":51,"value":239},{"type":40,"tag":58,"props":6529,"children":6530},{},[],{"type":40,"tag":47,"props":6532,"children":6533},{},[6534],{"type":51,"value":1644},{"type":40,"tag":47,"props":6536,"children":6537},{},[6538],{"type":51,"value":1649},{"type":40,"tag":47,"props":6540,"children":6541},{},[6542],{"type":40,"tag":95,"props":6543,"children":6544},{},[6545],{"type":51,"value":1657},{"type":40,"tag":1659,"props":6547,"children":6548},{},[],{"type":40,"tag":58,"props":6550,"children":6551},{},[],{"type":40,"tag":62,"props":6553,"children":6555},{"id":6554},"how-to-integrate-stylelint-with-vs-code",[6556],{"type":51,"value":6557},"How to Integrate Stylelint With VS Code?",{"type":40,"tag":47,"props":6559,"children":6560},{},[6561,6563,6570,6572,6577],{"type":51,"value":6562},"Stylelint offers an ",{"type":40,"tag":109,"props":6564,"children":6567},{"href":6565,"rel":6566},"https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint",[113],[6568],{"type":51,"value":6569},"integration plugin for VS Code",{"type":51,"value":6571},", and setting it up is pretty easy. Simply install the plugin, and it should work seamlessly. ",{"type":40,"tag":95,"props":6573,"children":6574},{},[6575],{"type":51,"value":6576},"If you work with SCSS, you'll need to adjust the extension settings to include SCSS in the file types to check too.",{"type":51,"value":6578}," This is also applicable to other file types like Vue if you want to check SCSS within those files.",{"type":40,"tag":6580,"props":6581,"children":6583},"prose-gallery",{":items":6582},"[\"https://cdn.pragmate.dev/wp-content/uploads/2024/04/48517392-ae0d-4fa9-9b77-2c5f74a3d2d7.png\",\"https://cdn.pragmate.dev/wp-content/uploads/2024/04/199365bb-2d32-4bfc-8ffb-891e39b4a560.png\"]",[],{"type":40,"tag":47,"props":6585,"children":6586},{},[6587,6589,6595,6597,6603],{"type":51,"value":6588},"Once installed, the plugin allows you to see problems in your code as you write. You can also fix these issues directly in VS Code by using the ",{"type":40,"tag":189,"props":6590,"children":6592},{"className":6591},[],[6593],{"type":51,"value":6594},"cmd+shift+p",{"type":51,"value":6596}," shortcut, typing ",{"type":40,"tag":189,"props":6598,"children":6600},{"className":6599},[],[6601],{"type":51,"value":6602},"fix",{"type":51,"value":6604}," and choosing Stylelint to fix the file. You can also modify the settings and enable file formatting every time you save a file. It happens in the background.",{"type":40,"tag":47,"props":6606,"children":6607},{},[6608],{"type":40,"tag":2789,"props":6609,"children":6611},{"alt":2791,"src":6610},"https://cdn.pragmate.dev/wp-content/uploads/2024/04/6f72bb04-0a60-41f3-ace4-32e187b0c8af.png",[],{"type":40,"tag":58,"props":6613,"children":6614},{},[],{"type":40,"tag":62,"props":6616,"children":6618},{"id":6617},"how-to-integrate-stylelint-with-prettier",[6619],{"type":51,"value":6620},"How to Integrate Stylelint with Prettier?",{"type":40,"tag":47,"props":6622,"children":6623},{},[6624,6626,6632,6634],{"type":51,"value":6625},"Until version 15, Stylelint managed stylistic rules, which Prettier also handled. This overlap meant that whichever tool was used last could overwrite changes made by the other. However, with the release of version 16, Stylelint ",{"type":40,"tag":109,"props":6627,"children":6629},{"href":4989,"rel":6628},[113],[6630],{"type":51,"value":6631},"discontinued support for stylistic rules",{"type":51,"value":6633}," and recommends Prettier for these tasks. Now, ",{"type":40,"tag":95,"props":6635,"children":6636},{},[6637],{"type":51,"value":6638},"Stylelint concentrates mostly on architectural concerns and lets Prettier handle stylistic rules.",{"type":40,"tag":1058,"props":6640,"children":6642},{"id":6641},"why-im-worried-about-self-awareness",[6643],{"type":51,"value":6644},"Why I'm Worried About Self-Awareness?",{"type":40,"tag":47,"props":6646,"children":6647},{},[6648],{"type":51,"value":6649},"It sounds fine, but I have some doubts. Please check out the following code which breaks different rules like incorrect quotes in line 2 handled by Stylelint and incorrect indentation in the line 2,3 handled by Prettier.",{"type":40,"tag":179,"props":6651,"children":6653},{"className":181,"code":6652,"language":186,"meta":7,"style":7},"@font-face {\n    font-family: 'Montserrat';\n    font-style: normal;\n  font-weight: 300;\n  font-display: swap;\n  src: url('../fonts/Montserrat-Light.woff2') format('woff2'),\n  url('../fonts/Montserrat-Light.woff') format('woff');\n}\n",[6654],{"type":40,"tag":189,"props":6655,"children":6656},{"__ignoreMap":7},[6657,6669,6686,6703,6720,6737,6782,6820],{"type":40,"tag":193,"props":6658,"children":6659},{"class":196,"line":185},[6660,6665],{"type":40,"tag":193,"props":6661,"children":6662},{"style":672},[6663],{"type":51,"value":6664},"@font-face",{"type":40,"tag":193,"props":6666,"children":6667},{"style":207},[6668],{"type":51,"value":210},{"type":40,"tag":193,"props":6670,"children":6671},{"class":196,"line":213},[6672,6677,6682],{"type":40,"tag":193,"props":6673,"children":6674},{"style":207},[6675],{"type":51,"value":6676},"    font-family: ",{"type":40,"tag":193,"props":6678,"children":6679},{"style":279},[6680],{"type":51,"value":6681},"'Montserrat'",{"type":40,"tag":193,"props":6683,"children":6684},{"style":207},[6685],{"type":51,"value":230},{"type":40,"tag":193,"props":6687,"children":6688},{"class":196,"line":233},[6689,6694,6699],{"type":40,"tag":193,"props":6690,"children":6691},{"style":207},[6692],{"type":51,"value":6693},"    font-style: ",{"type":40,"tag":193,"props":6695,"children":6696},{"style":222},[6697],{"type":51,"value":6698},"normal",{"type":40,"tag":193,"props":6700,"children":6701},{"style":207},[6702],{"type":51,"value":230},{"type":40,"tag":193,"props":6704,"children":6705},{"class":196,"line":446},[6706,6711,6716],{"type":40,"tag":193,"props":6707,"children":6708},{"style":207},[6709],{"type":51,"value":6710},"  font-weight: ",{"type":40,"tag":193,"props":6712,"children":6713},{"style":222},[6714],{"type":51,"value":6715},"300",{"type":40,"tag":193,"props":6717,"children":6718},{"style":207},[6719],{"type":51,"value":230},{"type":40,"tag":193,"props":6721,"children":6722},{"class":196,"line":477},[6723,6728,6733],{"type":40,"tag":193,"props":6724,"children":6725},{"style":207},[6726],{"type":51,"value":6727},"  font-display: ",{"type":40,"tag":193,"props":6729,"children":6730},{"style":222},[6731],{"type":51,"value":6732},"swap",{"type":40,"tag":193,"props":6734,"children":6735},{"style":207},[6736],{"type":51,"value":230},{"type":40,"tag":193,"props":6738,"children":6739},{"class":196,"line":507},[6740,6745,6750,6754,6759,6763,6768,6772,6777],{"type":40,"tag":193,"props":6741,"children":6742},{"style":207},[6743],{"type":51,"value":6744},"  src: ",{"type":40,"tag":193,"props":6746,"children":6747},{"style":305},[6748],{"type":51,"value":6749},"url",{"type":40,"tag":193,"props":6751,"children":6752},{"style":207},[6753],{"type":51,"value":276},{"type":40,"tag":193,"props":6755,"children":6756},{"style":279},[6757],{"type":51,"value":6758},"'../fonts/Montserrat-Light.woff2'",{"type":40,"tag":193,"props":6760,"children":6761},{"style":207},[6762],{"type":51,"value":3225},{"type":40,"tag":193,"props":6764,"children":6765},{"style":305},[6766],{"type":51,"value":6767},"format",{"type":40,"tag":193,"props":6769,"children":6770},{"style":207},[6771],{"type":51,"value":276},{"type":40,"tag":193,"props":6773,"children":6774},{"style":279},[6775],{"type":51,"value":6776},"'woff2'",{"type":40,"tag":193,"props":6778,"children":6779},{"style":207},[6780],{"type":51,"value":6781},"),\n",{"type":40,"tag":193,"props":6783,"children":6784},{"class":196,"line":543},[6785,6790,6794,6799,6803,6807,6811,6816],{"type":40,"tag":193,"props":6786,"children":6787},{"style":305},[6788],{"type":51,"value":6789},"  url",{"type":40,"tag":193,"props":6791,"children":6792},{"style":207},[6793],{"type":51,"value":276},{"type":40,"tag":193,"props":6795,"children":6796},{"style":279},[6797],{"type":51,"value":6798},"'../fonts/Montserrat-Light.woff'",{"type":40,"tag":193,"props":6800,"children":6801},{"style":207},[6802],{"type":51,"value":3225},{"type":40,"tag":193,"props":6804,"children":6805},{"style":305},[6806],{"type":51,"value":6767},{"type":40,"tag":193,"props":6808,"children":6809},{"style":207},[6810],{"type":51,"value":276},{"type":40,"tag":193,"props":6812,"children":6813},{"style":279},[6814],{"type":51,"value":6815},"'woff'",{"type":40,"tag":193,"props":6817,"children":6818},{"style":207},[6819],{"type":51,"value":287},{"type":40,"tag":193,"props":6821,"children":6822},{"class":196,"line":582},[6823],{"type":40,"tag":193,"props":6824,"children":6825},{"style":207},[6826],{"type":51,"value":239},{"type":40,"tag":47,"props":6828,"children":6829},{},[6830],{"type":51,"value":6831},"When I run Stylelint checks, it works great and shows all the rules violations with exact references. When I run Prettier to check formatting, I get only the information about files which includes problems without any further references.",{"type":40,"tag":174,"props":6833,"children":6835},{":tabs":6834},"[\"Stylelint\", \"Prettier\"]",[6836,6880],{"type":40,"tag":179,"props":6837,"children":6839},{"className":3474,"code":6838,"filename":125,"language":3478,"meta":7,"style":7},"yarn stylelint resources/**/*.scss\n\nresources/styles/styles.scss\n  2:18  ✖  Unexpected quotes around \"Montserrat\"                            font-family-name-quotes\n  4:3   ⚠  Expected \"font-weight\" to come before \"font-style\"               order/properties-order\n",[6840],{"type":40,"tag":189,"props":6841,"children":6842},{"__ignoreMap":7},[6843,6850,6857,6864,6872],{"type":40,"tag":193,"props":6844,"children":6845},{"class":196,"line":185},[6846],{"type":40,"tag":193,"props":6847,"children":6848},{"style":207},[6849],{"type":51,"value":5693},{"type":40,"tag":193,"props":6851,"children":6852},{"class":196,"line":213},[6853],{"type":40,"tag":193,"props":6854,"children":6855},{"emptyLinePlaceholder":35},[6856],{"type":51,"value":626},{"type":40,"tag":193,"props":6858,"children":6859},{"class":196,"line":233},[6860],{"type":40,"tag":193,"props":6861,"children":6862},{"style":207},[6863],{"type":51,"value":734},{"type":40,"tag":193,"props":6865,"children":6866},{"class":196,"line":446},[6867],{"type":40,"tag":193,"props":6868,"children":6869},{"style":207},[6870],{"type":51,"value":6871},"  2:18  ✖  Unexpected quotes around \"Montserrat\"                            font-family-name-quotes\n",{"type":40,"tag":193,"props":6873,"children":6874},{"class":196,"line":477},[6875],{"type":40,"tag":193,"props":6876,"children":6877},{"style":207},[6878],{"type":51,"value":6879},"  4:3   ⚠  Expected \"font-weight\" to come before \"font-style\"               order/properties-order\n",{"type":40,"tag":179,"props":6881,"children":6884},{"className":3474,"code":6882,"filename":6883,"language":3478,"meta":7,"style":7},"yarn prettier . --check\n\nChecking formatting...\n[warn] .stylelintrc.json\n[warn] resources/styles/styles.scss\n[warn] Code style issues found in 2 files. Run Prettier to fix.\n","Prettier",[6885],{"type":40,"tag":189,"props":6886,"children":6887},{"__ignoreMap":7},[6888,6896,6903,6911,6919,6927],{"type":40,"tag":193,"props":6889,"children":6890},{"class":196,"line":185},[6891],{"type":40,"tag":193,"props":6892,"children":6893},{"style":207},[6894],{"type":51,"value":6895},"yarn prettier . --check\n",{"type":40,"tag":193,"props":6897,"children":6898},{"class":196,"line":213},[6899],{"type":40,"tag":193,"props":6900,"children":6901},{"emptyLinePlaceholder":35},[6902],{"type":51,"value":626},{"type":40,"tag":193,"props":6904,"children":6905},{"class":196,"line":233},[6906],{"type":40,"tag":193,"props":6907,"children":6908},{"style":207},[6909],{"type":51,"value":6910},"Checking formatting...\n",{"type":40,"tag":193,"props":6912,"children":6913},{"class":196,"line":446},[6914],{"type":40,"tag":193,"props":6915,"children":6916},{"style":207},[6917],{"type":51,"value":6918},"[warn] .stylelintrc.json\n",{"type":40,"tag":193,"props":6920,"children":6921},{"class":196,"line":477},[6922],{"type":40,"tag":193,"props":6923,"children":6924},{"style":207},[6925],{"type":51,"value":6926},"[warn] resources/styles/styles.scss\n",{"type":40,"tag":193,"props":6928,"children":6929},{"class":196,"line":507},[6930],{"type":40,"tag":193,"props":6931,"children":6932},{"style":207},[6933],{"type":51,"value":6934},"[warn] Code style issues found in 2 files. Run Prettier to fix.\n",{"type":40,"tag":47,"props":6936,"children":6937},{},[6938,6940,6945,6947],{"type":51,"value":6939},"I know, ",{"type":40,"tag":95,"props":6941,"children":6942},{},[6943],{"type":51,"value":6944},"Prettier was created to forget about problems.",{"type":51,"value":6946}," Automatic corrections, especially with features like \"format on save,\" are amazing, and improve the coding experience a lot, but they can also obscure learning opportunities. ",{"type":40,"tag":95,"props":6948,"children":6949},{},[6950],{"type":51,"value":6951},"For developers who thrive on detailed feedback to improve their coding practices, seeing each issue is beneficial.",{"type":40,"tag":47,"props":6953,"children":6954},{},[6955,6960],{"type":40,"tag":95,"props":6956,"children":6957},{},[6958],{"type":51,"value":6959},"Also, without CI/CD processes or integrating tools like Husky, developers must remember to format the code before pushing.",{"type":51,"value":6961}," This reliance on memory is a potential source of the problems. I don't like this and that's why I prefer seeing problems immediately as I write - I can't just say \"Oh, I forgot.\"",{"type":40,"tag":47,"props":6963,"children":6964},{},[6965],{"type":40,"tag":95,"props":6966,"children":6967},{},[6968],{"type":51,"value":6969},"So while Prettier is an excellent tool, it truly shines only in the right hands.",{"type":40,"tag":1058,"props":6971,"children":6973},{"id":6972},"is-there-any-alternative",[6974],{"type":51,"value":6975},"Is There Any Alternative?",{"type":40,"tag":47,"props":6977,"children":6978},{},[6979,6981,6988],{"type":51,"value":6980},"It might seem that with Stylelint's decision to remove stylistic rules, you'd be left without those capabilities unless you switch to using Prettier. However, that isn't the case. A ",{"type":40,"tag":109,"props":6982,"children":6985},{"href":6983,"rel":6984},"https://www.npmjs.com/package/@stylistic/stylelint-plugin",[113],[6986],{"type":51,"value":6987},"community-driven plugin",{"type":51,"value":6989}," has brought these deprecated rules back.",{"type":40,"tag":174,"props":6991,"children":6992},{":tabs":5576},[6993,7025],{"type":40,"tag":179,"props":6994,"children":6996},{"className":1308,"code":6995,"filename":5581,"language":1310,"meta":7,"style":7},"npm install @stylistic/stylelint-plugin @stylistic/stylelint-config --save-dev\n",[6997],{"type":40,"tag":189,"props":6998,"children":6999},{"__ignoreMap":7},[7000],{"type":40,"tag":193,"props":7001,"children":7002},{"class":196,"line":185},[7003,7007,7011,7016,7021],{"type":40,"tag":193,"props":7004,"children":7005},{"style":268},[7006],{"type":51,"value":2929},{"type":40,"tag":193,"props":7008,"children":7009},{"style":279},[7010],{"type":51,"value":5597},{"type":40,"tag":193,"props":7012,"children":7013},{"style":279},[7014],{"type":51,"value":7015}," @stylistic/stylelint-plugin",{"type":40,"tag":193,"props":7017,"children":7018},{"style":279},[7019],{"type":51,"value":7020}," @stylistic/stylelint-config",{"type":40,"tag":193,"props":7022,"children":7023},{"style":222},[7024],{"type":51,"value":5607},{"type":40,"tag":179,"props":7026,"children":7028},{"className":1374,"code":7027,"filename":5515,"language":1377,"meta":7,"style":7},"{\n  \"extends\": [\n    \"@stylistic/stylelint-config\",\n    \"stylelint-config-standard-scss\",\n    \"stylelint-config-clean-order\"\n  ],\n  \"ignoreFiles\": [\n    \"node_modules\",\n    \"dist/**/*\"\n  ],\n  \"rules\": {\n    \"@stylistic/string-quotes\": \"single\"\n  }\n}\n",[7029],{"type":40,"tag":189,"props":7030,"children":7031},{"__ignoreMap":7},[7032,7039,7050,7062,7073,7080,7087,7098,7109,7116,7123,7134,7151,7158],{"type":40,"tag":193,"props":7033,"children":7034},{"class":196,"line":185},[7035],{"type":40,"tag":193,"props":7036,"children":7037},{"style":207},[7038],{"type":51,"value":1389},{"type":40,"tag":193,"props":7040,"children":7041},{"class":196,"line":213},[7042,7046],{"type":40,"tag":193,"props":7043,"children":7044},{"style":201},[7045],{"type":51,"value":5092},{"type":40,"tag":193,"props":7047,"children":7048},{"style":207},[7049],{"type":51,"value":1791},{"type":40,"tag":193,"props":7051,"children":7052},{"class":196,"line":233},[7053,7058],{"type":40,"tag":193,"props":7054,"children":7055},{"style":279},[7056],{"type":51,"value":7057},"    \"@stylistic/stylelint-config\"",{"type":40,"tag":193,"props":7059,"children":7060},{"style":207},[7061],{"type":51,"value":1425},{"type":40,"tag":193,"props":7063,"children":7064},{"class":196,"line":446},[7065,7069],{"type":40,"tag":193,"props":7066,"children":7067},{"style":279},[7068],{"type":51,"value":6089},{"type":40,"tag":193,"props":7070,"children":7071},{"style":207},[7072],{"type":51,"value":1425},{"type":40,"tag":193,"props":7074,"children":7075},{"class":196,"line":477},[7076],{"type":40,"tag":193,"props":7077,"children":7078},{"style":279},[7079],{"type":51,"value":6101},{"type":40,"tag":193,"props":7081,"children":7082},{"class":196,"line":507},[7083],{"type":40,"tag":193,"props":7084,"children":7085},{"style":207},[7086],{"type":51,"value":1819},{"type":40,"tag":193,"props":7088,"children":7089},{"class":196,"line":543},[7090,7094],{"type":40,"tag":193,"props":7091,"children":7092},{"style":201},[7093],{"type":51,"value":6489},{"type":40,"tag":193,"props":7095,"children":7096},{"style":207},[7097],{"type":51,"value":1791},{"type":40,"tag":193,"props":7099,"children":7100},{"class":196,"line":582},[7101,7105],{"type":40,"tag":193,"props":7102,"children":7103},{"style":279},[7104],{"type":51,"value":6501},{"type":40,"tag":193,"props":7106,"children":7107},{"style":207},[7108],{"type":51,"value":1425},{"type":40,"tag":193,"props":7110,"children":7111},{"class":196,"line":620},[7112],{"type":40,"tag":193,"props":7113,"children":7114},{"style":279},[7115],{"type":51,"value":6513},{"type":40,"tag":193,"props":7117,"children":7118},{"class":196,"line":294},[7119],{"type":40,"tag":193,"props":7120,"children":7121},{"style":207},[7122],{"type":51,"value":1819},{"type":40,"tag":193,"props":7124,"children":7125},{"class":196,"line":660},[7126,7130],{"type":40,"tag":193,"props":7127,"children":7128},{"style":201},[7129],{"type":51,"value":5124},{"type":40,"tag":193,"props":7131,"children":7132},{"style":207},[7133],{"type":51,"value":1402},{"type":40,"tag":193,"props":7135,"children":7136},{"class":196,"line":668},[7137,7142,7146],{"type":40,"tag":193,"props":7138,"children":7139},{"style":201},[7140],{"type":51,"value":7141},"    \"@stylistic/string-quotes\"",{"type":40,"tag":193,"props":7143,"children":7144},{"style":207},[7145],{"type":51,"value":1415},{"type":40,"tag":193,"props":7147,"children":7148},{"style":279},[7149],{"type":51,"value":7150},"\"single\"\n",{"type":40,"tag":193,"props":7152,"children":7153},{"class":196,"line":961},[7154],{"type":40,"tag":193,"props":7155,"children":7156},{"style":207},[7157],{"type":51,"value":3238},{"type":40,"tag":193,"props":7159,"children":7160},{"class":196,"line":2115},[7161],{"type":40,"tag":193,"props":7162,"children":7163},{"style":207},[7164],{"type":51,"value":239},{"type":40,"tag":47,"props":7166,"children":7167},{},[7168],{"type":51,"value":7169},"After installing the additional plugin, stylistic issues such as breaking indentation rules are also displayed in the reports. This visibility ensures that developers can no longer claim they didn't notice these problems.",{"type":40,"tag":179,"props":7171,"children":7173},{"className":3474,"code":7172,"language":3478,"meta":7,"style":7},"yarn stylelint resources/**/*.scss\n\nresources/styles/styles.scss\n   2:5   ✖  Expected indentation of 2 spaces                                 @stylistic/indentation\n   2:18  ✖  Expected double quotes                                           @stylistic/string-quotes\n   2:18  ✖  Unexpected quotes around \"Montserrat\"                            font-family-name-quotes\n   3:5   ✖  Expected indentation of 2 spaces                                 @stylistic/indentation\n   4:3   ⚠  Expected \"font-weight\" to come before \"font-style\"               order/properties-order\n   6:6   ✖  Expected newline after \":\" with a multi-line declaration         @stylistic/declaration-colon-newline-after\n   6:12  ✖  Expected double quotes                                           @stylistic/string-quotes\n   6:54  ✖  Expected double quotes                                           @stylistic/string-quotes\n   7:3   ✖  Expected indentation of 4 spaces                                 @stylistic/indentation\n   7:7   ✖  Expected double quotes                                           @stylistic/string-quotes\n   7:48  ✖  Expected double quotes                                           @stylistic/string-quotes\n",[7174],{"type":40,"tag":189,"props":7175,"children":7176},{"__ignoreMap":7},[7177,7184,7191,7198,7206,7214,7222,7230,7238,7246,7254,7262,7270,7278],{"type":40,"tag":193,"props":7178,"children":7179},{"class":196,"line":185},[7180],{"type":40,"tag":193,"props":7181,"children":7182},{"style":207},[7183],{"type":51,"value":5693},{"type":40,"tag":193,"props":7185,"children":7186},{"class":196,"line":213},[7187],{"type":40,"tag":193,"props":7188,"children":7189},{"emptyLinePlaceholder":35},[7190],{"type":51,"value":626},{"type":40,"tag":193,"props":7192,"children":7193},{"class":196,"line":233},[7194],{"type":40,"tag":193,"props":7195,"children":7196},{"style":207},[7197],{"type":51,"value":734},{"type":40,"tag":193,"props":7199,"children":7200},{"class":196,"line":446},[7201],{"type":40,"tag":193,"props":7202,"children":7203},{"style":207},[7204],{"type":51,"value":7205},"   2:5   ✖  Expected indentation of 2 spaces                                 @stylistic/indentation\n",{"type":40,"tag":193,"props":7207,"children":7208},{"class":196,"line":477},[7209],{"type":40,"tag":193,"props":7210,"children":7211},{"style":207},[7212],{"type":51,"value":7213},"   2:18  ✖  Expected double quotes                                           @stylistic/string-quotes\n",{"type":40,"tag":193,"props":7215,"children":7216},{"class":196,"line":507},[7217],{"type":40,"tag":193,"props":7218,"children":7219},{"style":207},[7220],{"type":51,"value":7221},"   2:18  ✖  Unexpected quotes around \"Montserrat\"                            font-family-name-quotes\n",{"type":40,"tag":193,"props":7223,"children":7224},{"class":196,"line":543},[7225],{"type":40,"tag":193,"props":7226,"children":7227},{"style":207},[7228],{"type":51,"value":7229},"   3:5   ✖  Expected indentation of 2 spaces                                 @stylistic/indentation\n",{"type":40,"tag":193,"props":7231,"children":7232},{"class":196,"line":582},[7233],{"type":40,"tag":193,"props":7234,"children":7235},{"style":207},[7236],{"type":51,"value":7237},"   4:3   ⚠  Expected \"font-weight\" to come before \"font-style\"               order/properties-order\n",{"type":40,"tag":193,"props":7239,"children":7240},{"class":196,"line":620},[7241],{"type":40,"tag":193,"props":7242,"children":7243},{"style":207},[7244],{"type":51,"value":7245},"   6:6   ✖  Expected newline after \":\" with a multi-line declaration         @stylistic/declaration-colon-newline-after\n",{"type":40,"tag":193,"props":7247,"children":7248},{"class":196,"line":294},[7249],{"type":40,"tag":193,"props":7250,"children":7251},{"style":207},[7252],{"type":51,"value":7253},"   6:12  ✖  Expected double quotes                                           @stylistic/string-quotes\n",{"type":40,"tag":193,"props":7255,"children":7256},{"class":196,"line":660},[7257],{"type":40,"tag":193,"props":7258,"children":7259},{"style":207},[7260],{"type":51,"value":7261},"   6:54  ✖  Expected double quotes                                           @stylistic/string-quotes\n",{"type":40,"tag":193,"props":7263,"children":7264},{"class":196,"line":668},[7265],{"type":40,"tag":193,"props":7266,"children":7267},{"style":207},[7268],{"type":51,"value":7269},"   7:3   ✖  Expected indentation of 4 spaces                                 @stylistic/indentation\n",{"type":40,"tag":193,"props":7271,"children":7272},{"class":196,"line":961},[7273],{"type":40,"tag":193,"props":7274,"children":7275},{"style":207},[7276],{"type":51,"value":7277},"   7:7   ✖  Expected double quotes                                           @stylistic/string-quotes\n",{"type":40,"tag":193,"props":7279,"children":7280},{"class":196,"line":2115},[7281],{"type":40,"tag":193,"props":7282,"children":7283},{"style":207},[7284],{"type":51,"value":7285},"   7:48  ✖  Expected double quotes                                           @stylistic/string-quotes\n",{"type":40,"tag":47,"props":7287,"children":7288},{},[7289,7291,7298,7300,7306,7308,7313],{"type":51,"value":7290},"In this approach, I want to ",{"type":40,"tag":109,"props":7292,"children":7295},{"href":7293,"rel":7294},"https://github.com/stylelint-stylistic/stylelint-config/tree/1cf0dc407cce1c7da4a157996d9c5e8b0a1646b7?tab=readme-ov-file#rule-overrides",[113],[7296],{"type":51,"value":7297},"tweak",{"type":51,"value":7299}," the ",{"type":40,"tag":109,"props":7301,"children":7304},{"href":7302,"rel":7303},"https://github.com/stylelint-stylistic/stylelint-config/blob/1cf0dc407cce1c7da4a157996d9c5e8b0a1646b7/.stylelintrc.json",[113],[7305],{"type":51,"value":6046},{"type":51,"value":7307}," slightly, as I prefer using single quotes. Consequently, I need to update the ",{"type":40,"tag":189,"props":7309,"children":7311},{"className":7310},[],[7312],{"type":51,"value":4920},{"type":51,"value":7314}," file to exclude CSS files from its checks.",{"type":40,"tag":179,"props":7316,"children":7318},{"className":3474,"code":7317,"language":3478,"meta":7,"style":7},"*.lock\n*-lock.json\n**/*.scss\n",[7319],{"type":40,"tag":189,"props":7320,"children":7321},{"__ignoreMap":7},[7322,7330,7338],{"type":40,"tag":193,"props":7323,"children":7324},{"class":196,"line":185},[7325],{"type":40,"tag":193,"props":7326,"children":7327},{"style":207},[7328],{"type":51,"value":7329},"*.lock\n",{"type":40,"tag":193,"props":7331,"children":7332},{"class":196,"line":213},[7333],{"type":40,"tag":193,"props":7334,"children":7335},{"style":207},[7336],{"type":51,"value":7337},"*-lock.json\n",{"type":40,"tag":193,"props":7339,"children":7340},{"class":196,"line":233},[7341],{"type":40,"tag":193,"props":7342,"children":7343},{"style":207},[7344],{"type":51,"value":7345},"**/*.scss\n",{"type":40,"tag":1058,"props":7347,"children":7349},{"id":7348},"what-approach-do-i-use",[7350],{"type":51,"value":7351},"What Approach do I Use?",{"type":40,"tag":47,"props":7353,"children":7354},{},[7355,7357,7363],{"type":51,"value":7356},"In a previous ",{"type":40,"tag":109,"props":7358,"children":7360},{"href":5877,"rel":7359},[113],[7361],{"type":51,"value":7362},"video about Prettier",{"type":51,"value":7364},", I mentioned that I wouldn't use Prettier for managing stylistic rules in CSS code, believing that it was the right approach at the time. However, my perspective has since shifted.",{"type":40,"tag":47,"props":7366,"children":7367},{},[7368],{"type":51,"value":7369},"I had concerns about developers losing awareness or forgetting about the formatting process, but It might not be a huge problem when integrating tools like Husky or setting up CI/CD processes, which I plan to implement soon. Therefore, I now use Stylelint to handle CSS architectural concerns and let Prettier take care of the formatting.",{"type":40,"tag":58,"props":7371,"children":7372},{},[],{"type":40,"tag":47,"props":7374,"children":7375},{},[7376,7377,7382,7383,7389,7390,7395],{"type":51,"value":2801},{"type":40,"tag":109,"props":7378,"children":7380},{"href":2804,"rel":7379},[113],[7381],{"type":51,"value":2808},{"type":51,"value":1076},{"type":40,"tag":109,"props":7384,"children":7387},{"href":7385,"rel":7386},"https://www.youtube.com/watch?v=_cDvBp-C7oY",[113],[7388],{"type":51,"value":5338},{"type":51,"value":5340},{"type":40,"tag":109,"props":7391,"children":7393},{"href":2435,"rel":7392},[113],[7394],{"type":51,"value":2816},{"type":51,"value":2818},{"type":40,"tag":2820,"props":7397,"children":7398},{},[7399],{"type":51,"value":2824},{"title":7,"searchDepth":213,"depth":213,"links":7401},[7402,7403,7404,7405,7406,7407],{"id":5437,"depth":213,"text":5440},{"id":5654,"depth":213,"text":5657},{"id":6001,"depth":213,"text":6004},{"id":6293,"depth":213,"text":6296},{"id":6554,"depth":213,"text":6557},{"id":6617,"depth":213,"text":6620,"children":7408},[7409,7410,7411],{"id":6641,"depth":233,"text":6644},{"id":6972,"depth":233,"text":6975},{"id":7348,"depth":233,"text":7351},"content:css:stylelint.md","css/stylelint.md","css/stylelint",{"_path":7416,"_dir":295,"_draft":6,"_partial":6,"_locale":7,"title":7417,"description":7418,"head":7419,"tags":7430,"links":7435,"chapters":7438,"created":7427,"thumb":7439,"body":7440,"_type":2844,"_id":13975,"_source":2846,"_file":13976,"_stem":13977,"_extension":2849},"/php/phpcs","PHP Code Sniffer: In-Depth Tutorial for Developers","Learn how to integrate PHP Code Sniffer into your development workflow and create coding standards tailored to your needs. Discover how it works, from its core functionalities to its integration with Visual Studio Code and don't miss any problems ever again.",{"title":7420,"link":7421,"meta":7423},"PHP Code Sniffer: In-Depth Tutorial for Developers | pragmate.dev",[7422],{"rel":14,"href":130},[7424,7425,7426,7428],{"name":21,"content":22},{"name":18,"content":19},{"name":24,"content":7427},"2024-03-20",{"name":27,"content":7429},"https://cdn.pragmate.dev/wp-content/uploads/2024/03/b89af984-e6c7-4a3b-8e55-19046d6393cb.jpeg",{"time":7431,"level":7432,"stack":7433},"15min","Medium",[7434],"PHP",{"github":7436,"solution":7437},"https://github.com/pragmatedev/vilare/pull/18","#how-to-use-php-code-sniffer",[157],"font",{"type":37,"children":7441,"toc":13962},[7442,7446,7451,7456,7461,7464,7467,7473,7499,7535,7539,7575,7737,7773,8001,8040,8082,8089,8092,8098,8111,9221,9225,9229,9233,9237,9241,9245,9249,9253,9256,9262,9309,9323,9326,9332,9351,9453,9480,9644,9656,9739,9758,9761,9765,9769,9776,9779,9782,9788,9798,9835,10530,10556,10559,10565,10599,10628,10649,10832,10844,10858,10880,11062,11093,11161,11203,11452,11472,13294,13306,13309,13315,13329,13342,13376,13383,13388,13393,13400,13403,13409,13429,13448,13588,13601,13755,13768,13774,13804,13811,13837,13842,13847,13853,13897,13904,13909,13932,13935,13958],{"type":40,"tag":41,"props":7443,"children":7445},{"thumbnail":7429,"url":7444},"https://www.youtube-nocookie.com/embed/0OelE2c4wVs",[],{"type":40,"tag":47,"props":7447,"children":7448},{},[7449],{"type":51,"value":7450},"If you work with PHP you probably heard about PHP Code Sniffer. And I'm not surprised! There are plenty of articles with basic knowledge about how to set it up, and if you think that's another one, please let me give you something more.",{"type":40,"tag":47,"props":7452,"children":7453},{},[7454],{"type":51,"value":7455},"Because, in the latest material on my channel, I'll provide the knowledge that I wish to have when starting my adventure with this tool. The knowledge that is not discussed so often. Of course, you'll find some basics too, but what's more important, you'll get more advanced tips that will help you build solutions that work for you, for your real needs.",{"type":40,"tag":47,"props":7457,"children":7458},{},[7459],{"type":51,"value":7460},"Welcome back, I'm Przemek and in this material, I'll talk about setting up PHP Code Sniffer and performing more advanced configurations to let you build your own rules.",{"type":40,"tag":54,"props":7462,"children":7463},{},[],{"type":40,"tag":58,"props":7465,"children":7466},{},[],{"type":40,"tag":62,"props":7468,"children":7470},{"id":7469},"what-is-php-code-sniffer",[7471],{"type":51,"value":7472},"What is PHP Code Sniffer?",{"type":40,"tag":47,"props":7474,"children":7475},{},[7476,7478,7483,7485,7490,7492,7497],{"type":51,"value":7477},"PHP Code Sniffer is a command line tool that ",{"type":40,"tag":95,"props":7479,"children":7480},{},[7481],{"type":51,"value":7482},"ensures your PHP code remains clean and consistent with a specific coding standard",{"type":51,"value":7484},". It consists of two scripts: ",{"type":40,"tag":189,"props":7486,"children":7488},{"className":7487},[],[7489],{"type":51,"value":1936},{"type":51,"value":7491}," - linter that checks what is wrong with the code, and ",{"type":40,"tag":189,"props":7493,"children":7495},{"className":7494},[],[7496],{"type":51,"value":1944},{"type":51,"value":7498}," - formatter that tries to fix problems.",{"type":40,"tag":47,"props":7500,"children":7501},{},[7502,7504,7511,7513,7519,7521,7526,7528,7534],{"type":51,"value":7503},"A coding standard in PHP Code Sniffer is a collection of ",{"type":40,"tag":109,"props":7505,"children":7508},{"href":7506,"rel":7507},"https://github.com/PHPCSStandards/PHP_CodeSniffer/tree/master/src/Standards/Generic/Sniffs",[113],[7509],{"type":51,"value":7510},"sniffs",{"type":51,"value":7512},", each identified by the code using the ",{"type":40,"tag":189,"props":7514,"children":7516},{"className":7515},[],[7517],{"type":51,"value":7518},"Standard.Category.Name",{"type":51,"value":7520}," pattern. ",{"type":40,"tag":95,"props":7522,"children":7523},{},[7524],{"type":51,"value":7525},"A single sniff is designed to find one or more rule violations",{"type":51,"value":7527}," which also have a unique identifier: ",{"type":40,"tag":189,"props":7529,"children":7531},{"className":7530},[],[7532],{"type":51,"value":7533},"Standard.Category.Name.Error",{"type":51,"value":265},{"type":40,"tag":6580,"props":7536,"children":7538},{":items":7537},"[\"https://cdn.pragmate.dev/wp-content/uploads/2024/02/285f9bdc-7356-4b66-a759-3f18fe653a1a.jpg\",\"https://cdn.pragmate.dev/wp-content/uploads/2024/02/edb490f4-0e5a-4f0e-9adc-bc4183be4b02.jpg\"]",[],{"type":40,"tag":47,"props":7540,"children":7541},{},[7542,7544,7550,7552,7558,7560,7565,7567,7573],{"type":51,"value":7543},"For example, the ",{"type":40,"tag":189,"props":7545,"children":7547},{"className":7546},[],[7548],{"type":51,"value":7549},"Generic.Arrays.DisallowLongArraySyntax",{"type":51,"value":7551}," sniff checks if the code uses a long array syntax like ",{"type":40,"tag":189,"props":7553,"children":7555},{"className":7554},[],[7556],{"type":51,"value":7557},"array()",{"type":51,"value":7559},". If so, ",{"type":40,"tag":189,"props":7561,"children":7563},{"className":7562},[],[7564],{"type":51,"value":1936},{"type":51,"value":7566}," informs that it's not allowed and that the short syntax ",{"type":40,"tag":189,"props":7568,"children":7570},{"className":7569},[],[7571],{"type":51,"value":7572},"[]",{"type":51,"value":7574}," should be used instead. That's a pretty fast check showing just one fix.",{"type":40,"tag":174,"props":7576,"children":7578},{":tabs":7577},"[\"Code\", \"Error\"]",[7579,7681],{"type":40,"tag":179,"props":7580,"children":7584},{"className":290,"code":7581,"filename":7582,"highlights":7583,"language":295,"meta":7,"style":7},"class Hooks\n{\n    public static function init(): void {\n        $foo = array();\n    }\n}\n","Code",[446],[7585],{"type":40,"tag":189,"props":7586,"children":7587},{"__ignoreMap":7},[7588,7600,7607,7643,7667,7674],{"type":40,"tag":193,"props":7589,"children":7590},{"class":196,"line":185},[7591,7595],{"type":40,"tag":193,"props":7592,"children":7593},{"style":672},[7594],{"type":51,"value":3180},{"type":40,"tag":193,"props":7596,"children":7597},{"style":257},[7598],{"type":51,"value":7599}," Hooks\n",{"type":40,"tag":193,"props":7601,"children":7602},{"class":196,"line":213},[7603],{"type":40,"tag":193,"props":7604,"children":7605},{"style":207},[7606],{"type":51,"value":1389},{"type":40,"tag":193,"props":7608,"children":7609},{"class":196,"line":233},[7610,7615,7620,7625,7629,7634,7639],{"type":40,"tag":193,"props":7611,"children":7612},{"style":672},[7613],{"type":51,"value":7614},"    public",{"type":40,"tag":193,"props":7616,"children":7617},{"style":672},[7618],{"type":51,"value":7619}," static",{"type":40,"tag":193,"props":7621,"children":7622},{"style":672},[7623],{"type":51,"value":7624}," function",{"type":40,"tag":193,"props":7626,"children":7627},{"style":268},[7628],{"type":51,"value":2934},{"type":40,"tag":193,"props":7630,"children":7631},{"style":207},[7632],{"type":51,"value":7633},"(): ",{"type":40,"tag":193,"props":7635,"children":7636},{"style":257},[7637],{"type":51,"value":7638},"void",{"type":40,"tag":193,"props":7640,"children":7641},{"style":207},[7642],{"type":51,"value":210},{"type":40,"tag":193,"props":7644,"children":7646},{"class":7645,"line":446},[196,197],[7647,7652,7657,7662],{"type":40,"tag":193,"props":7648,"children":7649},{"style":201},[7650],{"type":51,"value":7651},"        $foo",{"type":40,"tag":193,"props":7653,"children":7654},{"style":305},[7655],{"type":51,"value":7656}," =",{"type":40,"tag":193,"props":7658,"children":7659},{"style":305},[7660],{"type":51,"value":7661}," array",{"type":40,"tag":193,"props":7663,"children":7664},{"style":207},[7665],{"type":51,"value":7666},"();\n",{"type":40,"tag":193,"props":7668,"children":7669},{"class":196,"line":477},[7670],{"type":40,"tag":193,"props":7671,"children":7672},{"style":207},[7673],{"type":51,"value":3424},{"type":40,"tag":193,"props":7675,"children":7676},{"class":196,"line":507},[7677],{"type":40,"tag":193,"props":7678,"children":7679},{"style":207},[7680],{"type":51,"value":239},{"type":40,"tag":179,"props":7682,"children":7686},{"className":3474,"code":7683,"filename":7684,"highlights":7685,"language":3478,"meta":7,"style":7},"FILE: /footmate.pro/wp-content/themes/footmate/app/Core/Hooks.php\n-----------------------------------------------------------------------------------------------------------------\nFOUND 1 ERROR AFFECTING 1 LINE\n-----------------------------------------------------------------------------------------------------------------\n7 | ERROR | [x] Short array syntax must be used to define arrays (Generic.Arrays.DisallowLongArraySyntax)\n-----------------------------------------------------------------------------------------------------------------\n","Error",[477],[7687],{"type":40,"tag":189,"props":7688,"children":7689},{"__ignoreMap":7},[7690,7698,7706,7714,7721,7730],{"type":40,"tag":193,"props":7691,"children":7692},{"class":196,"line":185},[7693],{"type":40,"tag":193,"props":7694,"children":7695},{"style":207},[7696],{"type":51,"value":7697},"FILE: /footmate.pro/wp-content/themes/footmate/app/Core/Hooks.php\n",{"type":40,"tag":193,"props":7699,"children":7700},{"class":196,"line":213},[7701],{"type":40,"tag":193,"props":7702,"children":7703},{"style":201},[7704],{"type":51,"value":7705},"-----------------------------------------------------------------------------------------------------------------\n",{"type":40,"tag":193,"props":7707,"children":7708},{"class":196,"line":233},[7709],{"type":40,"tag":193,"props":7710,"children":7711},{"style":207},[7712],{"type":51,"value":7713},"FOUND 1 ERROR AFFECTING 1 LINE\n",{"type":40,"tag":193,"props":7715,"children":7716},{"class":196,"line":446},[7717],{"type":40,"tag":193,"props":7718,"children":7719},{"style":201},[7720],{"type":51,"value":7705},{"type":40,"tag":193,"props":7722,"children":7724},{"class":7723,"line":477},[196,197],[7725],{"type":40,"tag":193,"props":7726,"children":7727},{"style":207},[7728],{"type":51,"value":7729},"7 | ERROR | [x] Short array syntax must be used to define arrays (Generic.Arrays.DisallowLongArraySyntax)\n",{"type":40,"tag":193,"props":7731,"children":7732},{"class":196,"line":507},[7733],{"type":40,"tag":193,"props":7734,"children":7735},{"style":201},[7736],{"type":51,"value":7705},{"type":40,"tag":47,"props":7738,"children":7739},{},[7740,7742,7748,7750,7756,7758,7764,7766,7772],{"type":51,"value":7741},"Another example is ",{"type":40,"tag":189,"props":7743,"children":7745},{"className":7744},[],[7746],{"type":51,"value":7747},"Squiz.ControlStructures.ForEachLoopDeclaration",{"type":51,"value":7749}," sniff which ensures a space between each element of a ",{"type":40,"tag":189,"props":7751,"children":7753},{"className":7752},[],[7754],{"type":51,"value":7755},"foreach",{"type":51,"value":7757}," loop and lowercase ",{"type":40,"tag":189,"props":7759,"children":7761},{"className":7760},[],[7762],{"type":51,"value":7763},"keyword",{"type":51,"value":7765},". Compared to the previous example, this rule might be violated in different ways, so as a result, we get more errors to fix, e.g. ",{"type":40,"tag":189,"props":7767,"children":7769},{"className":7768},[],[7770],{"type":51,"value":7771},"Squiz.ControlStructures.ForEachLoopDeclaration.SpaceAfterOpen",{"type":51,"value":265},{"type":40,"tag":174,"props":7774,"children":7775},{":tabs":7577},[7776,7911],{"type":40,"tag":179,"props":7777,"children":7780},{"className":290,"code":7778,"filename":7582,"highlights":7779,"language":295,"meta":7,"style":7},"class Hooks\n{\n    public static function init(): void {\n        foreach ( [] AS $bar=>$baz ) {\n            echo $baz;\n        }\n    }\n}\n",[446],[7781],{"type":40,"tag":189,"props":7782,"children":7783},{"__ignoreMap":7},[7784,7795,7802,7833,7872,7889,7897,7904],{"type":40,"tag":193,"props":7785,"children":7786},{"class":196,"line":185},[7787,7791],{"type":40,"tag":193,"props":7788,"children":7789},{"style":672},[7790],{"type":51,"value":3180},{"type":40,"tag":193,"props":7792,"children":7793},{"style":257},[7794],{"type":51,"value":7599},{"type":40,"tag":193,"props":7796,"children":7797},{"class":196,"line":213},[7798],{"type":40,"tag":193,"props":7799,"children":7800},{"style":207},[7801],{"type":51,"value":1389},{"type":40,"tag":193,"props":7803,"children":7804},{"class":196,"line":233},[7805,7809,7813,7817,7821,7825,7829],{"type":40,"tag":193,"props":7806,"children":7807},{"style":672},[7808],{"type":51,"value":7614},{"type":40,"tag":193,"props":7810,"children":7811},{"style":672},[7812],{"type":51,"value":7619},{"type":40,"tag":193,"props":7814,"children":7815},{"style":672},[7816],{"type":51,"value":7624},{"type":40,"tag":193,"props":7818,"children":7819},{"style":268},[7820],{"type":51,"value":2934},{"type":40,"tag":193,"props":7822,"children":7823},{"style":207},[7824],{"type":51,"value":7633},{"type":40,"tag":193,"props":7826,"children":7827},{"style":257},[7828],{"type":51,"value":7638},{"type":40,"tag":193,"props":7830,"children":7831},{"style":207},[7832],{"type":51,"value":210},{"type":40,"tag":193,"props":7834,"children":7836},{"class":7835,"line":446},[196,197],[7837,7842,7847,7852,7857,7862,7867],{"type":40,"tag":193,"props":7838,"children":7839},{"style":672},[7840],{"type":51,"value":7841},"        foreach",{"type":40,"tag":193,"props":7843,"children":7844},{"style":207},[7845],{"type":51,"value":7846}," ( [] ",{"type":40,"tag":193,"props":7848,"children":7849},{"style":305},[7850],{"type":51,"value":7851},"AS",{"type":40,"tag":193,"props":7853,"children":7854},{"style":201},[7855],{"type":51,"value":7856}," $bar",{"type":40,"tag":193,"props":7858,"children":7859},{"style":207},[7860],{"type":51,"value":7861},"=>",{"type":40,"tag":193,"props":7863,"children":7864},{"style":201},[7865],{"type":51,"value":7866},"$baz",{"type":40,"tag":193,"props":7868,"children":7869},{"style":207},[7870],{"type":51,"value":7871}," ) {\n",{"type":40,"tag":193,"props":7873,"children":7874},{"class":196,"line":477},[7875,7880,7885],{"type":40,"tag":193,"props":7876,"children":7877},{"style":305},[7878],{"type":51,"value":7879},"            echo",{"type":40,"tag":193,"props":7881,"children":7882},{"style":201},[7883],{"type":51,"value":7884}," $baz",{"type":40,"tag":193,"props":7886,"children":7887},{"style":207},[7888],{"type":51,"value":230},{"type":40,"tag":193,"props":7890,"children":7891},{"class":196,"line":507},[7892],{"type":40,"tag":193,"props":7893,"children":7894},{"style":207},[7895],{"type":51,"value":7896},"        }\n",{"type":40,"tag":193,"props":7898,"children":7899},{"class":196,"line":543},[7900],{"type":40,"tag":193,"props":7901,"children":7902},{"style":207},[7903],{"type":51,"value":3424},{"type":40,"tag":193,"props":7905,"children":7906},{"class":196,"line":582},[7907],{"type":40,"tag":193,"props":7908,"children":7909},{"style":207},[7910],{"type":51,"value":239},{"type":40,"tag":179,"props":7912,"children":7915},{"className":3474,"code":7913,"filename":7684,"highlights":7914,"language":3478,"meta":7,"style":7},"FILE: /footmate.pro/wp-content/themes/footmate/app/Core/Hooks.php\n----------------------------------------------------------------------------------------------------------------------------------------\nFOUND 5 ERRORS AFFECTING 1 LINE\n----------------------------------------------------------------------------------------------------------------------------------------\n7 | ERROR | [x] Space found after opening bracket of FOREACH loop (Squiz.ControlStructures.ForEachLoopDeclaration.SpaceAfterOpen)\n7 | ERROR | [x] Space found before closing bracket of FOREACH loop (Squiz.ControlStructures.ForEachLoopDeclaration.SpaceBeforeClose)\n7 | ERROR | [x] Expected 1 space before \"=>\"; 0 found (Squiz.ControlStructures.ForEachLoopDeclaration.NoSpaceBeforeArrow)\n7 | ERROR | [x] Expected 1 space after \"=>\"; 0 found (Squiz.ControlStructures.ForEachLoopDeclaration.NoSpaceAfterArrow)\n7 | ERROR | [x] AS keyword must be lowercase; expected \"as\" but found \"AS\" (Squiz.ControlStructures.ForEachLoopDeclaration.AsNotLower)\n----------------------------------------------------------------------------------------------------------------------------------------\n",[477,507,543,582,620],[7916],{"type":40,"tag":189,"props":7917,"children":7918},{"__ignoreMap":7},[7919,7926,7934,7942,7949,7958,7967,7976,7985,7994],{"type":40,"tag":193,"props":7920,"children":7921},{"class":196,"line":185},[7922],{"type":40,"tag":193,"props":7923,"children":7924},{"style":207},[7925],{"type":51,"value":7697},{"type":40,"tag":193,"props":7927,"children":7928},{"class":196,"line":213},[7929],{"type":40,"tag":193,"props":7930,"children":7931},{"style":201},[7932],{"type":51,"value":7933},"----------------------------------------------------------------------------------------------------------------------------------------\n",{"type":40,"tag":193,"props":7935,"children":7936},{"class":196,"line":233},[7937],{"type":40,"tag":193,"props":7938,"children":7939},{"style":207},[7940],{"type":51,"value":7941},"FOUND 5 ERRORS AFFECTING 1 LINE\n",{"type":40,"tag":193,"props":7943,"children":7944},{"class":196,"line":446},[7945],{"type":40,"tag":193,"props":7946,"children":7947},{"style":201},[7948],{"type":51,"value":7933},{"type":40,"tag":193,"props":7950,"children":7952},{"class":7951,"line":477},[196,197],[7953],{"type":40,"tag":193,"props":7954,"children":7955},{"style":207},[7956],{"type":51,"value":7957},"7 | ERROR | [x] Space found after opening bracket of FOREACH loop (Squiz.ControlStructures.ForEachLoopDeclaration.SpaceAfterOpen)\n",{"type":40,"tag":193,"props":7959,"children":7961},{"class":7960,"line":507},[196,197],[7962],{"type":40,"tag":193,"props":7963,"children":7964},{"style":207},[7965],{"type":51,"value":7966},"7 | ERROR | [x] Space found before closing bracket of FOREACH loop (Squiz.ControlStructures.ForEachLoopDeclaration.SpaceBeforeClose)\n",{"type":40,"tag":193,"props":7968,"children":7970},{"class":7969,"line":543},[196,197],[7971],{"type":40,"tag":193,"props":7972,"children":7973},{"style":207},[7974],{"type":51,"value":7975},"7 | ERROR | [x] Expected 1 space before \"=>\"; 0 found (Squiz.ControlStructures.ForEachLoopDeclaration.NoSpaceBeforeArrow)\n",{"type":40,"tag":193,"props":7977,"children":7979},{"class":7978,"line":582},[196,197],[7980],{"type":40,"tag":193,"props":7981,"children":7982},{"style":207},[7983],{"type":51,"value":7984},"7 | ERROR | [x] Expected 1 space after \"=>\"; 0 found (Squiz.ControlStructures.ForEachLoopDeclaration.NoSpaceAfterArrow)\n",{"type":40,"tag":193,"props":7986,"children":7988},{"class":7987,"line":620},[196,197],[7989],{"type":40,"tag":193,"props":7990,"children":7991},{"style":207},[7992],{"type":51,"value":7993},"7 | ERROR | [x] AS keyword must be lowercase; expected \"as\" but found \"AS\" (Squiz.ControlStructures.ForEachLoopDeclaration.AsNotLower)\n",{"type":40,"tag":193,"props":7995,"children":7996},{"class":196,"line":294},[7997],{"type":40,"tag":193,"props":7998,"children":7999},{"style":201},[8000],{"type":51,"value":7933},{"type":40,"tag":47,"props":8002,"children":8003},{},[8004,8006,8013,8015,8022,8023,8030,8031,8038],{"type":51,"value":8005},"If we want those rules to be respected across the codebase, we can create a new coding standard to ensure that the codebase meets our needs. Of course, there's no need to build them from scratch. PHP Code Sniffer includes ",{"type":40,"tag":109,"props":8007,"children":8010},{"href":8008,"rel":8009},"https://github.com/PHPCSStandards/PHP_CodeSniffer/tree/e0bb06cee41684be1b7be85b275afcffcc85f4e4/src/Standards",[113],[8011],{"type":51,"value":8012},"several standards",{"type":51,"value":8014}," like ",{"type":40,"tag":109,"props":8016,"children":8019},{"href":8017,"rel":8018},"https://www.php-fig.org/psr/psr-1/",[113],[8020],{"type":51,"value":8021},"PSR1",{"type":51,"value":1239},{"type":40,"tag":109,"props":8024,"children":8027},{"href":8025,"rel":8026},"https://www.php-fig.org/psr/psr-12/",[113],[8028],{"type":51,"value":8029},"PSR12",{"type":51,"value":1239},{"type":40,"tag":109,"props":8032,"children":8035},{"href":8033,"rel":8034},"https://pear.php.net/manual/en/standards.php",[113],[8036],{"type":51,"value":8037},"PEAR",{"type":51,"value":8039},", and a few more within installation, so we can use one of them.",{"type":40,"tag":47,"props":8041,"children":8042},{},[8043,8048,8050,8057,8058,8064,8065,8072,8074,8081],{"type":40,"tag":95,"props":8044,"children":8045},{},[8046],{"type":51,"value":8047},"This is simply the way how the standards are built.",{"type":51,"value":8049}," Just by choosing specific sniffs and adding them to the ruleset. You can simply check them: ",{"type":40,"tag":109,"props":8051,"children":8054},{"href":8052,"rel":8053},"https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/src/Standards/PEAR/ruleset.xml",[113],[8055],{"type":51,"value":8056},"Pear",{"type":51,"value":1239},{"type":40,"tag":109,"props":8059,"children":8062},{"href":8060,"rel":8061},"https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/src/Standards/PSR12/ruleset.xml",[113],[8063],{"type":51,"value":8029},{"type":51,"value":1239},{"type":40,"tag":109,"props":8066,"children":8069},{"href":8067,"rel":8068},"https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/src/Standards/Squiz/ruleset.xml",[113],[8070],{"type":51,"value":8071},"Squiz",{"type":51,"value":8073}," and ",{"type":40,"tag":109,"props":8075,"children":8078},{"href":8076,"rel":8077},"https://github.com/PHPCSStandards/PHP_CodeSniffer/tree/master/src/Standards",[113],[8079],{"type":51,"value":8080},"others",{"type":51,"value":265},{"type":40,"tag":47,"props":8083,"children":8084},{},[8085],{"type":40,"tag":2789,"props":8086,"children":8088},{"alt":2791,"src":8087},"https://cdn.pragmate.dev/wp-content/uploads/2024/02/ce83539a-d255-43d3-869a-1d8ae55b5974.jpg",[],{"type":40,"tag":58,"props":8090,"children":8091},{},[],{"type":40,"tag":62,"props":8093,"children":8095},{"id":8094},"what-are-available-coding-standards",[8096],{"type":51,"value":8097},"What are available coding standards?",{"type":40,"tag":47,"props":8099,"children":8100},{},[8101,8103,8109],{"type":51,"value":8102},"Personal documentation generated with simple ",{"type":40,"tag":1914,"props":8104,"children":8106},{"type":1914,"dataModal":8105},"L1Goqfa6cs",[8107],{"type":51,"value":8108},"script",{"type":51,"value":8110}," for the sniffs available in the PHP Code Sniffer coding standards to help build an own rulesets and search for errors.",{"type":40,"tag":1922,"props":8112,"children":8113},{"id":8105},[8114,8144,9186,9212],{"type":40,"tag":47,"props":8115,"children":8116},{},[8117,8119,8125,8127,8134,8136,8142],{"type":51,"value":8118},"The simple bash script created for personal needs to list all the sniffs available in the ",{"type":40,"tag":109,"props":8120,"children":8122},{"href":8076,"rel":8121},[113],[8123],{"type":51,"value":8124},"coding standards",{"type":51,"value":8126}," provided by ",{"type":40,"tag":109,"props":8128,"children":8131},{"href":8129,"rel":8130},"https://github.com/squizlabs/PHP_CodeSniffer/tree/master",[113],[8132],{"type":51,"value":8133},"PHP_Code_Sniffer",{"type":51,"value":8135},". It iterates through the standards, list sniffs with ",{"type":40,"tag":189,"props":8137,"children":8139},{"className":8138},[],[8140],{"type":51,"value":8141},"-e",{"type":51,"value":8143}," attribute, exctract sniff codes, and generates docs for each of them.",{"type":40,"tag":179,"props":8145,"children":8147},{"className":1308,"code":8146,"language":1310,"meta":7,"style":7},"#!/bin/bash\n\nSTANDARDS=('Generic' 'Pear' 'PSR1' 'PSR12' 'PSR2' 'Squiz' 'Zend', 'WordPress')\noutput=\"\"\n\nfor standard in \"${STANDARDS[@]}\"; do\n  output+=\"# Standard: $standard\"\n  output+=$'\\n\\n'\n\n  list=$(vendor/bin/phpcs --standard=$standard -e)\n  codes=$(echo \"$list\" | grep -E '^[[:space:]]{2,}[A-Za-z0-9.]+' | sed 's/^[[:space:]]*//')\n\n  IFS=$'\\n'\n  for code in $codes; do\n    stnd=$(echo \"$code\" | cut -d'.' -f1)\n    category=$(echo \"$code\" | cut -d'.' -f2)\n    sniff=$(echo \"$code\" | cut -d'.' -f3)\n    url=\"https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/src/Standards/${stnd}/Sniffs/${category}/${sniff}Sniff.php\"\n\n    output+=$'\\n\\n'\n    output+=\"\\`$code\\` | [[ref]($url)]\"\n    output+=$(vendor/bin/phpcs --standard=$standard --generator=markdown --sniffs=\"$code\")\n    output+=$'\\n\\n---\\n\\n'\n  done\ndone\n\noutput=$(echo \"$output\" | sed -E \"s/Documentation generated on [[:alpha:]]+, [0-9]+ [[:alpha:]]+ [0-9]+ [0-9]+:[0-9]+:[0-9]+ \\+[0-9]+ by \\[PHP_CodeSniffer [0-9]+\\.[0-9]+\\.[0-9]+\\](.*)//\")\noutput=$(echo \"$output\" | sed -E \"s/# (Generic|Pear|PSR1|PSR12|PSR2|Squiz|Zend|WordPress) Coding Standard//\")\noutput=$(echo \"$output\" | sed '/^$/N;/^\\n$/D')\noutput=$(echo \"$output\" | sed '/^##/d')\n\necho \"$output\"\n",[8148],{"type":40,"tag":189,"props":8149,"children":8150},{"__ignoreMap":7},[8151,8159,8166,8228,8245,8252,8302,8330,8356,8363,8403,8476,8483,8508,8538,8599,8657,8715,8763,8771,8796,8840,8894,8927,8936,8945,8953,9007,9060,9109,9158,9166],{"type":40,"tag":193,"props":8152,"children":8153},{"class":196,"line":185},[8154],{"type":40,"tag":193,"props":8155,"children":8156},{"style":4180},[8157],{"type":51,"value":8158},"#!/bin/bash\n",{"type":40,"tag":193,"props":8160,"children":8161},{"class":196,"line":213},[8162],{"type":40,"tag":193,"props":8163,"children":8164},{"emptyLinePlaceholder":35},[8165],{"type":51,"value":626},{"type":40,"tag":193,"props":8167,"children":8168},{"class":196,"line":233},[8169,8174,8179,8183,8188,8193,8198,8203,8208,8213,8218,8223],{"type":40,"tag":193,"props":8170,"children":8171},{"style":201},[8172],{"type":51,"value":8173},"STANDARDS",{"type":40,"tag":193,"props":8175,"children":8176},{"style":305},[8177],{"type":51,"value":8178},"=",{"type":40,"tag":193,"props":8180,"children":8181},{"style":207},[8182],{"type":51,"value":276},{"type":40,"tag":193,"props":8184,"children":8185},{"style":279},[8186],{"type":51,"value":8187},"'Generic'",{"type":40,"tag":193,"props":8189,"children":8190},{"style":279},[8191],{"type":51,"value":8192}," 'Pear'",{"type":40,"tag":193,"props":8194,"children":8195},{"style":279},[8196],{"type":51,"value":8197}," 'PSR1'",{"type":40,"tag":193,"props":8199,"children":8200},{"style":279},[8201],{"type":51,"value":8202}," 'PSR12'",{"type":40,"tag":193,"props":8204,"children":8205},{"style":279},[8206],{"type":51,"value":8207}," 'PSR2'",{"type":40,"tag":193,"props":8209,"children":8210},{"style":279},[8211],{"type":51,"value":8212}," 'Squiz'",{"type":40,"tag":193,"props":8214,"children":8215},{"style":279},[8216],{"type":51,"value":8217}," 'Zend',",{"type":40,"tag":193,"props":8219,"children":8220},{"style":279},[8221],{"type":51,"value":8222}," 'WordPress'",{"type":40,"tag":193,"props":8224,"children":8225},{"style":207},[8226],{"type":51,"value":8227},")\n",{"type":40,"tag":193,"props":8229,"children":8230},{"class":196,"line":446},[8231,8236,8240],{"type":40,"tag":193,"props":8232,"children":8233},{"style":201},[8234],{"type":51,"value":8235},"output",{"type":40,"tag":193,"props":8237,"children":8238},{"style":305},[8239],{"type":51,"value":8178},{"type":40,"tag":193,"props":8241,"children":8242},{"style":279},[8243],{"type":51,"value":8244},"\"\"\n",{"type":40,"tag":193,"props":8246,"children":8247},{"class":196,"line":477},[8248],{"type":40,"tag":193,"props":8249,"children":8250},{"emptyLinePlaceholder":35},[8251],{"type":51,"value":626},{"type":40,"tag":193,"props":8253,"children":8254},{"class":196,"line":507},[8255,8260,8264,8269,8274,8278,8283,8288,8293,8297],{"type":40,"tag":193,"props":8256,"children":8257},{"style":672},[8258],{"type":51,"value":8259},"for",{"type":40,"tag":193,"props":8261,"children":8262},{"style":201},[8263],{"type":51,"value":3000},{"type":40,"tag":193,"props":8265,"children":8266},{"style":672},[8267],{"type":51,"value":8268}," in",{"type":40,"tag":193,"props":8270,"children":8271},{"style":279},[8272],{"type":51,"value":8273}," \"${",{"type":40,"tag":193,"props":8275,"children":8276},{"style":201},[8277],{"type":51,"value":8173},{"type":40,"tag":193,"props":8279,"children":8280},{"style":279},[8281],{"type":51,"value":8282},"[",{"type":40,"tag":193,"props":8284,"children":8285},{"style":207},[8286],{"type":51,"value":8287},"@",{"type":40,"tag":193,"props":8289,"children":8290},{"style":279},[8291],{"type":51,"value":8292},"]}\"",{"type":40,"tag":193,"props":8294,"children":8295},{"style":207},[8296],{"type":51,"value":6389},{"type":40,"tag":193,"props":8298,"children":8299},{"style":672},[8300],{"type":51,"value":8301},"do\n",{"type":40,"tag":193,"props":8303,"children":8304},{"class":196,"line":543},[8305,8310,8315,8320,8325],{"type":40,"tag":193,"props":8306,"children":8307},{"style":201},[8308],{"type":51,"value":8309},"  output",{"type":40,"tag":193,"props":8311,"children":8312},{"style":672},[8313],{"type":51,"value":8314},"+=",{"type":40,"tag":193,"props":8316,"children":8317},{"style":279},[8318],{"type":51,"value":8319},"\"# Standard: ",{"type":40,"tag":193,"props":8321,"children":8322},{"style":201},[8323],{"type":51,"value":8324},"$standard",{"type":40,"tag":193,"props":8326,"children":8327},{"style":279},[8328],{"type":51,"value":8329},"\"\n",{"type":40,"tag":193,"props":8331,"children":8332},{"class":196,"line":582},[8333,8337,8341,8346,8351],{"type":40,"tag":193,"props":8334,"children":8335},{"style":201},[8336],{"type":51,"value":8309},{"type":40,"tag":193,"props":8338,"children":8339},{"style":672},[8340],{"type":51,"value":8314},{"type":40,"tag":193,"props":8342,"children":8343},{"style":279},[8344],{"type":51,"value":8345},"$'",{"type":40,"tag":193,"props":8347,"children":8348},{"style":305},[8349],{"type":51,"value":8350},"\\n\\n",{"type":40,"tag":193,"props":8352,"children":8353},{"style":279},[8354],{"type":51,"value":8355},"'\n",{"type":40,"tag":193,"props":8357,"children":8358},{"class":196,"line":620},[8359],{"type":40,"tag":193,"props":8360,"children":8361},{"emptyLinePlaceholder":35},[8362],{"type":51,"value":626},{"type":40,"tag":193,"props":8364,"children":8365},{"class":196,"line":294},[8366,8371,8375,8380,8385,8390,8394,8399],{"type":40,"tag":193,"props":8367,"children":8368},{"style":201},[8369],{"type":51,"value":8370},"  list",{"type":40,"tag":193,"props":8372,"children":8373},{"style":305},[8374],{"type":51,"value":8178},{"type":40,"tag":193,"props":8376,"children":8377},{"style":207},[8378],{"type":51,"value":8379},"$(",{"type":40,"tag":193,"props":8381,"children":8382},{"style":268},[8383],{"type":51,"value":8384},"vendor/bin/phpcs",{"type":40,"tag":193,"props":8386,"children":8387},{"style":222},[8388],{"type":51,"value":8389}," --standard=",{"type":40,"tag":193,"props":8391,"children":8392},{"style":201},[8393],{"type":51,"value":8324},{"type":40,"tag":193,"props":8395,"children":8396},{"style":222},[8397],{"type":51,"value":8398}," -e",{"type":40,"tag":193,"props":8400,"children":8401},{"style":207},[8402],{"type":51,"value":8227},{"type":40,"tag":193,"props":8404,"children":8405},{"class":196,"line":660},[8406,8411,8415,8419,8423,8428,8433,8438,8443,8448,8453,8458,8462,8467,8472],{"type":40,"tag":193,"props":8407,"children":8408},{"style":201},[8409],{"type":51,"value":8410},"  codes",{"type":40,"tag":193,"props":8412,"children":8413},{"style":305},[8414],{"type":51,"value":8178},{"type":40,"tag":193,"props":8416,"children":8417},{"style":207},[8418],{"type":51,"value":8379},{"type":40,"tag":193,"props":8420,"children":8421},{"style":305},[8422],{"type":51,"value":1322},{"type":40,"tag":193,"props":8424,"children":8425},{"style":279},[8426],{"type":51,"value":8427}," \"",{"type":40,"tag":193,"props":8429,"children":8430},{"style":201},[8431],{"type":51,"value":8432},"$list",{"type":40,"tag":193,"props":8434,"children":8435},{"style":279},[8436],{"type":51,"value":8437},"\"",{"type":40,"tag":193,"props":8439,"children":8440},{"style":207},[8441],{"type":51,"value":8442}," | ",{"type":40,"tag":193,"props":8444,"children":8445},{"style":268},[8446],{"type":51,"value":8447},"grep",{"type":40,"tag":193,"props":8449,"children":8450},{"style":222},[8451],{"type":51,"value":8452}," -E",{"type":40,"tag":193,"props":8454,"children":8455},{"style":279},[8456],{"type":51,"value":8457}," '^[[:space:]]{2,}[A-Za-z0-9.]+'",{"type":40,"tag":193,"props":8459,"children":8460},{"style":207},[8461],{"type":51,"value":8442},{"type":40,"tag":193,"props":8463,"children":8464},{"style":268},[8465],{"type":51,"value":8466},"sed",{"type":40,"tag":193,"props":8468,"children":8469},{"style":279},[8470],{"type":51,"value":8471}," 's/^[[:space:]]*//'",{"type":40,"tag":193,"props":8473,"children":8474},{"style":207},[8475],{"type":51,"value":8227},{"type":40,"tag":193,"props":8477,"children":8478},{"class":196,"line":668},[8479],{"type":40,"tag":193,"props":8480,"children":8481},{"emptyLinePlaceholder":35},[8482],{"type":51,"value":626},{"type":40,"tag":193,"props":8484,"children":8485},{"class":196,"line":961},[8486,8491,8495,8499,8504],{"type":40,"tag":193,"props":8487,"children":8488},{"style":201},[8489],{"type":51,"value":8490},"  IFS",{"type":40,"tag":193,"props":8492,"children":8493},{"style":305},[8494],{"type":51,"value":8178},{"type":40,"tag":193,"props":8496,"children":8497},{"style":279},[8498],{"type":51,"value":8345},{"type":40,"tag":193,"props":8500,"children":8501},{"style":305},[8502],{"type":51,"value":8503},"\\n",{"type":40,"tag":193,"props":8505,"children":8506},{"style":279},[8507],{"type":51,"value":8355},{"type":40,"tag":193,"props":8509,"children":8510},{"class":196,"line":2115},[8511,8516,8521,8525,8530,8534],{"type":40,"tag":193,"props":8512,"children":8513},{"style":672},[8514],{"type":51,"value":8515},"  for",{"type":40,"tag":193,"props":8517,"children":8518},{"style":201},[8519],{"type":51,"value":8520}," code",{"type":40,"tag":193,"props":8522,"children":8523},{"style":672},[8524],{"type":51,"value":8268},{"type":40,"tag":193,"props":8526,"children":8527},{"style":201},[8528],{"type":51,"value":8529}," $codes",{"type":40,"tag":193,"props":8531,"children":8532},{"style":207},[8533],{"type":51,"value":6389},{"type":40,"tag":193,"props":8535,"children":8536},{"style":672},[8537],{"type":51,"value":8301},{"type":40,"tag":193,"props":8539,"children":8540},{"class":196,"line":2124},[8541,8546,8550,8554,8558,8562,8567,8571,8575,8580,8585,8590,8595],{"type":40,"tag":193,"props":8542,"children":8543},{"style":201},[8544],{"type":51,"value":8545},"    stnd",{"type":40,"tag":193,"props":8547,"children":8548},{"style":305},[8549],{"type":51,"value":8178},{"type":40,"tag":193,"props":8551,"children":8552},{"style":207},[8553],{"type":51,"value":8379},{"type":40,"tag":193,"props":8555,"children":8556},{"style":305},[8557],{"type":51,"value":1322},{"type":40,"tag":193,"props":8559,"children":8560},{"style":279},[8561],{"type":51,"value":8427},{"type":40,"tag":193,"props":8563,"children":8564},{"style":201},[8565],{"type":51,"value":8566},"$code",{"type":40,"tag":193,"props":8568,"children":8569},{"style":279},[8570],{"type":51,"value":8437},{"type":40,"tag":193,"props":8572,"children":8573},{"style":207},[8574],{"type":51,"value":8442},{"type":40,"tag":193,"props":8576,"children":8577},{"style":268},[8578],{"type":51,"value":8579},"cut",{"type":40,"tag":193,"props":8581,"children":8582},{"style":222},[8583],{"type":51,"value":8584}," -d",{"type":40,"tag":193,"props":8586,"children":8587},{"style":279},[8588],{"type":51,"value":8589},"'.'",{"type":40,"tag":193,"props":8591,"children":8592},{"style":222},[8593],{"type":51,"value":8594}," -f1",{"type":40,"tag":193,"props":8596,"children":8597},{"style":207},[8598],{"type":51,"value":8227},{"type":40,"tag":193,"props":8600,"children":8602},{"class":196,"line":8601},16,[8603,8608,8612,8616,8620,8624,8628,8632,8636,8640,8644,8648,8653],{"type":40,"tag":193,"props":8604,"children":8605},{"style":201},[8606],{"type":51,"value":8607},"    category",{"type":40,"tag":193,"props":8609,"children":8610},{"style":305},[8611],{"type":51,"value":8178},{"type":40,"tag":193,"props":8613,"children":8614},{"style":207},[8615],{"type":51,"value":8379},{"type":40,"tag":193,"props":8617,"children":8618},{"style":305},[8619],{"type":51,"value":1322},{"type":40,"tag":193,"props":8621,"children":8622},{"style":279},[8623],{"type":51,"value":8427},{"type":40,"tag":193,"props":8625,"children":8626},{"style":201},[8627],{"type":51,"value":8566},{"type":40,"tag":193,"props":8629,"children":8630},{"style":279},[8631],{"type":51,"value":8437},{"type":40,"tag":193,"props":8633,"children":8634},{"style":207},[8635],{"type":51,"value":8442},{"type":40,"tag":193,"props":8637,"children":8638},{"style":268},[8639],{"type":51,"value":8579},{"type":40,"tag":193,"props":8641,"children":8642},{"style":222},[8643],{"type":51,"value":8584},{"type":40,"tag":193,"props":8645,"children":8646},{"style":279},[8647],{"type":51,"value":8589},{"type":40,"tag":193,"props":8649,"children":8650},{"style":222},[8651],{"type":51,"value":8652}," -f2",{"type":40,"tag":193,"props":8654,"children":8655},{"style":207},[8656],{"type":51,"value":8227},{"type":40,"tag":193,"props":8658,"children":8660},{"class":196,"line":8659},17,[8661,8666,8670,8674,8678,8682,8686,8690,8694,8698,8702,8706,8711],{"type":40,"tag":193,"props":8662,"children":8663},{"style":201},[8664],{"type":51,"value":8665},"    sniff",{"type":40,"tag":193,"props":8667,"children":8668},{"style":305},[8669],{"type":51,"value":8178},{"type":40,"tag":193,"props":8671,"children":8672},{"style":207},[8673],{"type":51,"value":8379},{"type":40,"tag":193,"props":8675,"children":8676},{"style":305},[8677],{"type":51,"value":1322},{"type":40,"tag":193,"props":8679,"children":8680},{"style":279},[8681],{"type":51,"value":8427},{"type":40,"tag":193,"props":8683,"children":8684},{"style":201},[8685],{"type":51,"value":8566},{"type":40,"tag":193,"props":8687,"children":8688},{"style":279},[8689],{"type":51,"value":8437},{"type":40,"tag":193,"props":8691,"children":8692},{"style":207},[8693],{"type":51,"value":8442},{"type":40,"tag":193,"props":8695,"children":8696},{"style":268},[8697],{"type":51,"value":8579},{"type":40,"tag":193,"props":8699,"children":8700},{"style":222},[8701],{"type":51,"value":8584},{"type":40,"tag":193,"props":8703,"children":8704},{"style":279},[8705],{"type":51,"value":8589},{"type":40,"tag":193,"props":8707,"children":8708},{"style":222},[8709],{"type":51,"value":8710}," -f3",{"type":40,"tag":193,"props":8712,"children":8713},{"style":207},[8714],{"type":51,"value":8227},{"type":40,"tag":193,"props":8716,"children":8718},{"class":196,"line":8717},18,[8719,8724,8728,8733,8738,8743,8748,8753,8758],{"type":40,"tag":193,"props":8720,"children":8721},{"style":201},[8722],{"type":51,"value":8723},"    url",{"type":40,"tag":193,"props":8725,"children":8726},{"style":305},[8727],{"type":51,"value":8178},{"type":40,"tag":193,"props":8729,"children":8730},{"style":279},[8731],{"type":51,"value":8732},"\"https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/src/Standards/${",{"type":40,"tag":193,"props":8734,"children":8735},{"style":201},[8736],{"type":51,"value":8737},"stnd",{"type":40,"tag":193,"props":8739,"children":8740},{"style":279},[8741],{"type":51,"value":8742},"}/Sniffs/${",{"type":40,"tag":193,"props":8744,"children":8745},{"style":201},[8746],{"type":51,"value":8747},"category",{"type":40,"tag":193,"props":8749,"children":8750},{"style":279},[8751],{"type":51,"value":8752},"}/${",{"type":40,"tag":193,"props":8754,"children":8755},{"style":201},[8756],{"type":51,"value":8757},"sniff",{"type":40,"tag":193,"props":8759,"children":8760},{"style":279},[8761],{"type":51,"value":8762},"}Sniff.php\"\n",{"type":40,"tag":193,"props":8764,"children":8766},{"class":196,"line":8765},19,[8767],{"type":40,"tag":193,"props":8768,"children":8769},{"emptyLinePlaceholder":35},[8770],{"type":51,"value":626},{"type":40,"tag":193,"props":8772,"children":8774},{"class":196,"line":8773},20,[8775,8780,8784,8788,8792],{"type":40,"tag":193,"props":8776,"children":8777},{"style":201},[8778],{"type":51,"value":8779},"    output",{"type":40,"tag":193,"props":8781,"children":8782},{"style":672},[8783],{"type":51,"value":8314},{"type":40,"tag":193,"props":8785,"children":8786},{"style":279},[8787],{"type":51,"value":8345},{"type":40,"tag":193,"props":8789,"children":8790},{"style":305},[8791],{"type":51,"value":8350},{"type":40,"tag":193,"props":8793,"children":8794},{"style":279},[8795],{"type":51,"value":8355},{"type":40,"tag":193,"props":8797,"children":8799},{"class":196,"line":8798},21,[8800,8804,8808,8812,8817,8821,8825,8830,8835],{"type":40,"tag":193,"props":8801,"children":8802},{"style":201},[8803],{"type":51,"value":8779},{"type":40,"tag":193,"props":8805,"children":8806},{"style":672},[8807],{"type":51,"value":8314},{"type":40,"tag":193,"props":8809,"children":8810},{"style":279},[8811],{"type":51,"value":8437},{"type":40,"tag":193,"props":8813,"children":8814},{"style":305},[8815],{"type":51,"value":8816},"\\`",{"type":40,"tag":193,"props":8818,"children":8819},{"style":201},[8820],{"type":51,"value":8566},{"type":40,"tag":193,"props":8822,"children":8823},{"style":305},[8824],{"type":51,"value":8816},{"type":40,"tag":193,"props":8826,"children":8827},{"style":279},[8828],{"type":51,"value":8829}," | [[ref](",{"type":40,"tag":193,"props":8831,"children":8832},{"style":201},[8833],{"type":51,"value":8834},"$url",{"type":40,"tag":193,"props":8836,"children":8837},{"style":279},[8838],{"type":51,"value":8839},")]\"\n",{"type":40,"tag":193,"props":8841,"children":8843},{"class":196,"line":8842},22,[8844,8848,8852,8856,8860,8864,8868,8873,8878,8882,8886,8890],{"type":40,"tag":193,"props":8845,"children":8846},{"style":201},[8847],{"type":51,"value":8779},{"type":40,"tag":193,"props":8849,"children":8850},{"style":672},[8851],{"type":51,"value":8314},{"type":40,"tag":193,"props":8853,"children":8854},{"style":207},[8855],{"type":51,"value":8379},{"type":40,"tag":193,"props":8857,"children":8858},{"style":268},[8859],{"type":51,"value":8384},{"type":40,"tag":193,"props":8861,"children":8862},{"style":222},[8863],{"type":51,"value":8389},{"type":40,"tag":193,"props":8865,"children":8866},{"style":201},[8867],{"type":51,"value":8324},{"type":40,"tag":193,"props":8869,"children":8870},{"style":222},[8871],{"type":51,"value":8872}," --generator=markdown",{"type":40,"tag":193,"props":8874,"children":8875},{"style":222},[8876],{"type":51,"value":8877}," --sniffs=",{"type":40,"tag":193,"props":8879,"children":8880},{"style":279},[8881],{"type":51,"value":8437},{"type":40,"tag":193,"props":8883,"children":8884},{"style":201},[8885],{"type":51,"value":8566},{"type":40,"tag":193,"props":8887,"children":8888},{"style":279},[8889],{"type":51,"value":8437},{"type":40,"tag":193,"props":8891,"children":8892},{"style":207},[8893],{"type":51,"value":8227},{"type":40,"tag":193,"props":8895,"children":8897},{"class":196,"line":8896},23,[8898,8902,8906,8910,8914,8919,8923],{"type":40,"tag":193,"props":8899,"children":8900},{"style":201},[8901],{"type":51,"value":8779},{"type":40,"tag":193,"props":8903,"children":8904},{"style":672},[8905],{"type":51,"value":8314},{"type":40,"tag":193,"props":8907,"children":8908},{"style":279},[8909],{"type":51,"value":8345},{"type":40,"tag":193,"props":8911,"children":8912},{"style":305},[8913],{"type":51,"value":8350},{"type":40,"tag":193,"props":8915,"children":8916},{"style":279},[8917],{"type":51,"value":8918},"---",{"type":40,"tag":193,"props":8920,"children":8921},{"style":305},[8922],{"type":51,"value":8350},{"type":40,"tag":193,"props":8924,"children":8925},{"style":279},[8926],{"type":51,"value":8355},{"type":40,"tag":193,"props":8928,"children":8930},{"class":196,"line":8929},24,[8931],{"type":40,"tag":193,"props":8932,"children":8933},{"style":672},[8934],{"type":51,"value":8935},"  done\n",{"type":40,"tag":193,"props":8937,"children":8939},{"class":196,"line":8938},25,[8940],{"type":40,"tag":193,"props":8941,"children":8942},{"style":672},[8943],{"type":51,"value":8944},"done\n",{"type":40,"tag":193,"props":8946,"children":8948},{"class":196,"line":8947},26,[8949],{"type":40,"tag":193,"props":8950,"children":8951},{"emptyLinePlaceholder":35},[8952],{"type":51,"value":626},{"type":40,"tag":193,"props":8954,"children":8956},{"class":196,"line":8955},27,[8957,8961,8965,8969,8973,8977,8982,8986,8990,8994,8998,9003],{"type":40,"tag":193,"props":8958,"children":8959},{"style":201},[8960],{"type":51,"value":8235},{"type":40,"tag":193,"props":8962,"children":8963},{"style":305},[8964],{"type":51,"value":8178},{"type":40,"tag":193,"props":8966,"children":8967},{"style":207},[8968],{"type":51,"value":8379},{"type":40,"tag":193,"props":8970,"children":8971},{"style":305},[8972],{"type":51,"value":1322},{"type":40,"tag":193,"props":8974,"children":8975},{"style":279},[8976],{"type":51,"value":8427},{"type":40,"tag":193,"props":8978,"children":8979},{"style":201},[8980],{"type":51,"value":8981},"$output",{"type":40,"tag":193,"props":8983,"children":8984},{"style":279},[8985],{"type":51,"value":8437},{"type":40,"tag":193,"props":8987,"children":8988},{"style":207},[8989],{"type":51,"value":8442},{"type":40,"tag":193,"props":8991,"children":8992},{"style":268},[8993],{"type":51,"value":8466},{"type":40,"tag":193,"props":8995,"children":8996},{"style":222},[8997],{"type":51,"value":8452},{"type":40,"tag":193,"props":8999,"children":9000},{"style":279},[9001],{"type":51,"value":9002}," \"s/Documentation generated on [[:alpha:]]+, [0-9]+ [[:alpha:]]+ [0-9]+ [0-9]+:[0-9]+:[0-9]+ \\+[0-9]+ by \\[PHP_CodeSniffer [0-9]+\\.[0-9]+\\.[0-9]+\\](.*)//\"",{"type":40,"tag":193,"props":9004,"children":9005},{"style":207},[9006],{"type":51,"value":8227},{"type":40,"tag":193,"props":9008,"children":9010},{"class":196,"line":9009},28,[9011,9015,9019,9023,9027,9031,9035,9039,9043,9047,9051,9056],{"type":40,"tag":193,"props":9012,"children":9013},{"style":201},[9014],{"type":51,"value":8235},{"type":40,"tag":193,"props":9016,"children":9017},{"style":305},[9018],{"type":51,"value":8178},{"type":40,"tag":193,"props":9020,"children":9021},{"style":207},[9022],{"type":51,"value":8379},{"type":40,"tag":193,"props":9024,"children":9025},{"style":305},[9026],{"type":51,"value":1322},{"type":40,"tag":193,"props":9028,"children":9029},{"style":279},[9030],{"type":51,"value":8427},{"type":40,"tag":193,"props":9032,"children":9033},{"style":201},[9034],{"type":51,"value":8981},{"type":40,"tag":193,"props":9036,"children":9037},{"style":279},[9038],{"type":51,"value":8437},{"type":40,"tag":193,"props":9040,"children":9041},{"style":207},[9042],{"type":51,"value":8442},{"type":40,"tag":193,"props":9044,"children":9045},{"style":268},[9046],{"type":51,"value":8466},{"type":40,"tag":193,"props":9048,"children":9049},{"style":222},[9050],{"type":51,"value":8452},{"type":40,"tag":193,"props":9052,"children":9053},{"style":279},[9054],{"type":51,"value":9055}," \"s/# (Generic|Pear|PSR1|PSR12|PSR2|Squiz|Zend|WordPress) Coding Standard//\"",{"type":40,"tag":193,"props":9057,"children":9058},{"style":207},[9059],{"type":51,"value":8227},{"type":40,"tag":193,"props":9061,"children":9063},{"class":196,"line":9062},29,[9064,9068,9072,9076,9080,9084,9088,9092,9096,9100,9105],{"type":40,"tag":193,"props":9065,"children":9066},{"style":201},[9067],{"type":51,"value":8235},{"type":40,"tag":193,"props":9069,"children":9070},{"style":305},[9071],{"type":51,"value":8178},{"type":40,"tag":193,"props":9073,"children":9074},{"style":207},[9075],{"type":51,"value":8379},{"type":40,"tag":193,"props":9077,"children":9078},{"style":305},[9079],{"type":51,"value":1322},{"type":40,"tag":193,"props":9081,"children":9082},{"style":279},[9083],{"type":51,"value":8427},{"type":40,"tag":193,"props":9085,"children":9086},{"style":201},[9087],{"type":51,"value":8981},{"type":40,"tag":193,"props":9089,"children":9090},{"style":279},[9091],{"type":51,"value":8437},{"type":40,"tag":193,"props":9093,"children":9094},{"style":207},[9095],{"type":51,"value":8442},{"type":40,"tag":193,"props":9097,"children":9098},{"style":268},[9099],{"type":51,"value":8466},{"type":40,"tag":193,"props":9101,"children":9102},{"style":279},[9103],{"type":51,"value":9104}," '/^$/N;/^\\n$/D'",{"type":40,"tag":193,"props":9106,"children":9107},{"style":207},[9108],{"type":51,"value":8227},{"type":40,"tag":193,"props":9110,"children":9112},{"class":196,"line":9111},30,[9113,9117,9121,9125,9129,9133,9137,9141,9145,9149,9154],{"type":40,"tag":193,"props":9114,"children":9115},{"style":201},[9116],{"type":51,"value":8235},{"type":40,"tag":193,"props":9118,"children":9119},{"style":305},[9120],{"type":51,"value":8178},{"type":40,"tag":193,"props":9122,"children":9123},{"style":207},[9124],{"type":51,"value":8379},{"type":40,"tag":193,"props":9126,"children":9127},{"style":305},[9128],{"type":51,"value":1322},{"type":40,"tag":193,"props":9130,"children":9131},{"style":279},[9132],{"type":51,"value":8427},{"type":40,"tag":193,"props":9134,"children":9135},{"style":201},[9136],{"type":51,"value":8981},{"type":40,"tag":193,"props":9138,"children":9139},{"style":279},[9140],{"type":51,"value":8437},{"type":40,"tag":193,"props":9142,"children":9143},{"style":207},[9144],{"type":51,"value":8442},{"type":40,"tag":193,"props":9146,"children":9147},{"style":268},[9148],{"type":51,"value":8466},{"type":40,"tag":193,"props":9150,"children":9151},{"style":279},[9152],{"type":51,"value":9153}," '/^##/d'",{"type":40,"tag":193,"props":9155,"children":9156},{"style":207},[9157],{"type":51,"value":8227},{"type":40,"tag":193,"props":9159,"children":9161},{"class":196,"line":9160},31,[9162],{"type":40,"tag":193,"props":9163,"children":9164},{"emptyLinePlaceholder":35},[9165],{"type":51,"value":626},{"type":40,"tag":193,"props":9167,"children":9169},{"class":196,"line":9168},32,[9170,9174,9178,9182],{"type":40,"tag":193,"props":9171,"children":9172},{"style":305},[9173],{"type":51,"value":1322},{"type":40,"tag":193,"props":9175,"children":9176},{"style":279},[9177],{"type":51,"value":8427},{"type":40,"tag":193,"props":9179,"children":9180},{"style":201},[9181],{"type":51,"value":8981},{"type":40,"tag":193,"props":9183,"children":9184},{"style":279},[9185],{"type":51,"value":8329},{"type":40,"tag":179,"props":9187,"children":9191},{"className":9188,"code":9189,"language":9190,"meta":7,"style":7},"language-shell shiki shiki-themes one-dark-pro","./docs.sh > docs.md\n","shell",[9192],{"type":40,"tag":189,"props":9193,"children":9194},{"__ignoreMap":7},[9195],{"type":40,"tag":193,"props":9196,"children":9197},{"class":196,"line":185},[9198,9203,9207],{"type":40,"tag":193,"props":9199,"children":9200},{"style":268},[9201],{"type":51,"value":9202},"./docs.sh",{"type":40,"tag":193,"props":9204,"children":9205},{"style":207},[9206],{"type":51,"value":1332},{"type":40,"tag":193,"props":9208,"children":9209},{"style":279},[9210],{"type":51,"value":9211},"docs.md\n",{"type":40,"tag":47,"props":9213,"children":9214},{},[9215],{"type":40,"tag":109,"props":9216,"children":9219},{"href":9217,"rel":9218},"https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/317",[113],[9220],{"type":51,"value":9217},{"type":40,"tag":147,"props":9222,"children":9224},{"url":9223},"/php/phpcs/generic",[],{"type":40,"tag":147,"props":9226,"children":9228},{"url":9227},"/php/phpcs/pear",[],{"type":40,"tag":147,"props":9230,"children":9232},{"url":9231},"/php/phpcs/psr1",[],{"type":40,"tag":147,"props":9234,"children":9236},{"url":9235},"/php/phpcs/psr2",[],{"type":40,"tag":147,"props":9238,"children":9240},{"url":9239},"/php/phpcs/psr12",[],{"type":40,"tag":147,"props":9242,"children":9244},{"url":9243},"/php/phpcs/squiz",[],{"type":40,"tag":147,"props":9246,"children":9248},{"url":9247},"/php/phpcs/zend",[],{"type":40,"tag":147,"props":9250,"children":9252},{"url":9251},"/php/phpcs/wordpress",[],{"type":40,"tag":58,"props":9254,"children":9255},{},[],{"type":40,"tag":62,"props":9257,"children":9259},{"id":9258},"how-to-install-php-code-sniffer",[9260],{"type":51,"value":9261},"How to install PHP Code Sniffer?",{"type":40,"tag":47,"props":9263,"children":9264},{},[9265,9267,9274,9276,9283,9285,9291,9293,9299,9301,9307],{"type":51,"value":9266},"We can install the tool globally using ",{"type":40,"tag":109,"props":9268,"children":9271},{"href":9269,"rel":9270},"https://github.com/squizlabs/PHP_CodeSniffer#installation",[113],[9272],{"type":51,"value":9273},"official instructions",{"type":51,"value":9275}," or ",{"type":40,"tag":109,"props":9277,"children":9280},{"href":9278,"rel":9279},"https://formulae.brew.sh/formula/php-code-sniffer#default",[113],[9281],{"type":51,"value":9282},"Homebrew",{"type":51,"value":9284},", but here, we’ll go with local installation using  ",{"type":40,"tag":189,"props":9286,"children":9288},{"className":9287},[],[9289],{"type":51,"value":9290},"composer",{"type":51,"value":9292},". Open the terminal, go to the theme or plugin directory, and add PHP Code Sniffer to your codebase with ",{"type":40,"tag":189,"props":9294,"children":9296},{"className":9295},[],[9297],{"type":51,"value":9298},"composer require",{"type":51,"value":9300}," command. Remember to do it with ",{"type":40,"tag":189,"props":9302,"children":9304},{"className":9303},[],[9305],{"type":51,"value":9306},"--dev",{"type":51,"value":9308}," flag to skip the package in the production release!",{"type":40,"tag":179,"props":9310,"children":9312},{"className":3474,"code":9311,"language":3478,"meta":7,"style":7},"composer require squizlabs/php_codesniffer --dev\n",[9313],{"type":40,"tag":189,"props":9314,"children":9315},{"__ignoreMap":7},[9316],{"type":40,"tag":193,"props":9317,"children":9318},{"class":196,"line":185},[9319],{"type":40,"tag":193,"props":9320,"children":9321},{"style":207},[9322],{"type":51,"value":9311},{"type":40,"tag":58,"props":9324,"children":9325},{},[],{"type":40,"tag":62,"props":9327,"children":9329},{"id":9328},"how-to-use-php-code-sniffer",[9330],{"type":51,"value":9331},"How to use PHP Code Sniffer?",{"type":40,"tag":47,"props":9333,"children":9334},{},[9335,9337,9342,9344,9349],{"type":51,"value":9336},"The simplest way to search for the violations in our code is to use the ",{"type":40,"tag":189,"props":9338,"children":9340},{"className":9339},[],[9341],{"type":51,"value":8384},{"type":51,"value":9343}," script, provide the location to check - the file or directory - and specify the coding rules. ",{"type":40,"tag":95,"props":9345,"children":9346},{},[9347],{"type":51,"value":9348},"The tool will check all the files there and list all the problems with their exact location.",{"type":51,"value":9350}," We can navigate through them and fix all the problems manually one by one.",{"type":40,"tag":179,"props":9352,"children":9355},{"className":3474,"code":9353,"highlights":9354,"language":3478,"meta":7,"style":7},"vendor/bin/phpcs app/Core/Hooks.php --standard=PSR12\n\nFILE: /footmate.pro/wp-content/themes/footmate/app/Core/Hooks.php\n---------------------------------------------------------------------------------------------------------\nFOUND 4 ERRORS AND 1 WARNING AFFECTING 4 LINES\n---------------------------------------------------------------------------------------------------------\n  1 | ERROR   | [x] Header blocks must be separated by a single blank line\n  6 | WARNING | [ ] Line exceeds 120 characters; contains 122 characters\n  8 | ERROR   | [x] Opening brace should be on a new line\n---------------------------------------------------------------------------------------------------------\nPHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n---------------------------------------------------------------------------------------------------------\n",[543,582,620],[9356],{"type":40,"tag":189,"props":9357,"children":9358},{"__ignoreMap":7},[9359,9367,9374,9381,9389,9397,9404,9413,9422,9431,9438,9446],{"type":40,"tag":193,"props":9360,"children":9361},{"class":196,"line":185},[9362],{"type":40,"tag":193,"props":9363,"children":9364},{"style":207},[9365],{"type":51,"value":9366},"vendor/bin/phpcs app/Core/Hooks.php --standard=PSR12\n",{"type":40,"tag":193,"props":9368,"children":9369},{"class":196,"line":213},[9370],{"type":40,"tag":193,"props":9371,"children":9372},{"emptyLinePlaceholder":35},[9373],{"type":51,"value":626},{"type":40,"tag":193,"props":9375,"children":9376},{"class":196,"line":233},[9377],{"type":40,"tag":193,"props":9378,"children":9379},{"style":207},[9380],{"type":51,"value":7697},{"type":40,"tag":193,"props":9382,"children":9383},{"class":196,"line":446},[9384],{"type":40,"tag":193,"props":9385,"children":9386},{"style":201},[9387],{"type":51,"value":9388},"---------------------------------------------------------------------------------------------------------\n",{"type":40,"tag":193,"props":9390,"children":9391},{"class":196,"line":477},[9392],{"type":40,"tag":193,"props":9393,"children":9394},{"style":207},[9395],{"type":51,"value":9396},"FOUND 4 ERRORS AND 1 WARNING AFFECTING 4 LINES\n",{"type":40,"tag":193,"props":9398,"children":9399},{"class":196,"line":507},[9400],{"type":40,"tag":193,"props":9401,"children":9402},{"style":201},[9403],{"type":51,"value":9388},{"type":40,"tag":193,"props":9405,"children":9407},{"class":9406,"line":543},[196,197],[9408],{"type":40,"tag":193,"props":9409,"children":9410},{"style":207},[9411],{"type":51,"value":9412},"  1 | ERROR   | [x] Header blocks must be separated by a single blank line\n",{"type":40,"tag":193,"props":9414,"children":9416},{"class":9415,"line":582},[196,197],[9417],{"type":40,"tag":193,"props":9418,"children":9419},{"style":207},[9420],{"type":51,"value":9421},"  6 | WARNING | [ ] Line exceeds 120 characters; contains 122 characters\n",{"type":40,"tag":193,"props":9423,"children":9425},{"class":9424,"line":620},[196,197],[9426],{"type":40,"tag":193,"props":9427,"children":9428},{"style":207},[9429],{"type":51,"value":9430},"  8 | ERROR   | [x] Opening brace should be on a new line\n",{"type":40,"tag":193,"props":9432,"children":9433},{"class":196,"line":294},[9434],{"type":40,"tag":193,"props":9435,"children":9436},{"style":201},[9437],{"type":51,"value":9388},{"type":40,"tag":193,"props":9439,"children":9440},{"class":196,"line":660},[9441],{"type":40,"tag":193,"props":9442,"children":9443},{"style":207},[9444],{"type":51,"value":9445},"PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n",{"type":40,"tag":193,"props":9447,"children":9448},{"class":196,"line":668},[9449],{"type":40,"tag":193,"props":9450,"children":9451},{"style":201},[9452],{"type":51,"value":9388},{"type":40,"tag":47,"props":9454,"children":9455},{},[9456,9458,9463,9465,9471,9473,9479],{"type":51,"value":9457},"I hope that you know I'm joking. I was seriously involved in weird discussions with developers about exceeding a task budget caused by reviewing files and making the violation fixes manually one by one. ",{"type":40,"tag":95,"props":9459,"children":9460},{},[9461],{"type":51,"value":9462},"And it wasn't a single situation so not everyone gets this",{"type":51,"value":9464}," 😒 The report that we get after using the linter presents two types of potential violations: the ones that can be automatically fixed ",{"type":40,"tag":189,"props":9466,"children":9468},{"className":9467},[],[9469],{"type":51,"value":9470},"[x]",{"type":51,"value":9472},", and the ones that can't ",{"type":40,"tag":189,"props":9474,"children":9476},{"className":9475},[],[9477],{"type":51,"value":9478},"[ ]",{"type":51,"value":265},{"type":40,"tag":174,"props":9481,"children":9483},{":tabs":9482},"[\"Auto\", \"Manual\"]",[9484,9565],{"type":40,"tag":179,"props":9485,"children":9489},{"className":3474,"code":9486,"filename":9487,"highlights":9488,"language":3478,"meta":7,"style":7},"FILE: /footmate.pro/wp-content/themes/footmate/app/Core/Hooks.php\n---------------------------------------------------------------------------------------------------------\nFOUND 4 ERRORS AND 1 WARNING AFFECTING 4 LINES\n---------------------------------------------------------------------------------------------------------\n  1 | ERROR   | [x] Header blocks must be separated by a single blank line\n  6 | WARNING | [ ] Line exceeds 120 characters; contains 122 characters\n  8 | ERROR   | [x] Opening brace should be on a new line\n---------------------------------------------------------------------------------------------------------\nPHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n---------------------------------------------------------------------------------------------------------\n","Auto",[477,543],[9490],{"type":40,"tag":189,"props":9491,"children":9492},{"__ignoreMap":7},[9493,9500,9507,9514,9521,9529,9536,9544,9551,9558],{"type":40,"tag":193,"props":9494,"children":9495},{"class":196,"line":185},[9496],{"type":40,"tag":193,"props":9497,"children":9498},{"style":207},[9499],{"type":51,"value":7697},{"type":40,"tag":193,"props":9501,"children":9502},{"class":196,"line":213},[9503],{"type":40,"tag":193,"props":9504,"children":9505},{"style":201},[9506],{"type":51,"value":9388},{"type":40,"tag":193,"props":9508,"children":9509},{"class":196,"line":233},[9510],{"type":40,"tag":193,"props":9511,"children":9512},{"style":207},[9513],{"type":51,"value":9396},{"type":40,"tag":193,"props":9515,"children":9516},{"class":196,"line":446},[9517],{"type":40,"tag":193,"props":9518,"children":9519},{"style":201},[9520],{"type":51,"value":9388},{"type":40,"tag":193,"props":9522,"children":9524},{"class":9523,"line":477},[196,197],[9525],{"type":40,"tag":193,"props":9526,"children":9527},{"style":207},[9528],{"type":51,"value":9412},{"type":40,"tag":193,"props":9530,"children":9531},{"class":196,"line":507},[9532],{"type":40,"tag":193,"props":9533,"children":9534},{"style":207},[9535],{"type":51,"value":9421},{"type":40,"tag":193,"props":9537,"children":9539},{"class":9538,"line":543},[196,197],[9540],{"type":40,"tag":193,"props":9541,"children":9542},{"style":207},[9543],{"type":51,"value":9430},{"type":40,"tag":193,"props":9545,"children":9546},{"class":196,"line":582},[9547],{"type":40,"tag":193,"props":9548,"children":9549},{"style":201},[9550],{"type":51,"value":9388},{"type":40,"tag":193,"props":9552,"children":9553},{"class":196,"line":620},[9554],{"type":40,"tag":193,"props":9555,"children":9556},{"style":207},[9557],{"type":51,"value":9445},{"type":40,"tag":193,"props":9559,"children":9560},{"class":196,"line":294},[9561],{"type":40,"tag":193,"props":9562,"children":9563},{"style":201},[9564],{"type":51,"value":9388},{"type":40,"tag":179,"props":9566,"children":9569},{"className":3474,"code":9486,"filename":9567,"highlights":9568,"language":3478,"meta":7,"style":7},"Manual",[507],[9570],{"type":40,"tag":189,"props":9571,"children":9572},{"__ignoreMap":7},[9573,9580,9587,9594,9601,9608,9616,9623,9630,9637],{"type":40,"tag":193,"props":9574,"children":9575},{"class":196,"line":185},[9576],{"type":40,"tag":193,"props":9577,"children":9578},{"style":207},[9579],{"type":51,"value":7697},{"type":40,"tag":193,"props":9581,"children":9582},{"class":196,"line":213},[9583],{"type":40,"tag":193,"props":9584,"children":9585},{"style":201},[9586],{"type":51,"value":9388},{"type":40,"tag":193,"props":9588,"children":9589},{"class":196,"line":233},[9590],{"type":40,"tag":193,"props":9591,"children":9592},{"style":207},[9593],{"type":51,"value":9396},{"type":40,"tag":193,"props":9595,"children":9596},{"class":196,"line":446},[9597],{"type":40,"tag":193,"props":9598,"children":9599},{"style":201},[9600],{"type":51,"value":9388},{"type":40,"tag":193,"props":9602,"children":9603},{"class":196,"line":477},[9604],{"type":40,"tag":193,"props":9605,"children":9606},{"style":207},[9607],{"type":51,"value":9412},{"type":40,"tag":193,"props":9609,"children":9611},{"class":9610,"line":507},[196,197],[9612],{"type":40,"tag":193,"props":9613,"children":9614},{"style":207},[9615],{"type":51,"value":9421},{"type":40,"tag":193,"props":9617,"children":9618},{"class":196,"line":543},[9619],{"type":40,"tag":193,"props":9620,"children":9621},{"style":207},[9622],{"type":51,"value":9430},{"type":40,"tag":193,"props":9624,"children":9625},{"class":196,"line":582},[9626],{"type":40,"tag":193,"props":9627,"children":9628},{"style":201},[9629],{"type":51,"value":9388},{"type":40,"tag":193,"props":9631,"children":9632},{"class":196,"line":620},[9633],{"type":40,"tag":193,"props":9634,"children":9635},{"style":207},[9636],{"type":51,"value":9445},{"type":40,"tag":193,"props":9638,"children":9639},{"class":196,"line":294},[9640],{"type":40,"tag":193,"props":9641,"children":9642},{"style":201},[9643],{"type":51,"value":9388},{"type":40,"tag":47,"props":9645,"children":9646},{},[9647,9649,9654],{"type":51,"value":9648},"The first ones are mostly simple formatting problems that can be fixed only in one way, so the tool can simply handle them for us. The second ones need more attention since they require a well-thought-out decision or manual changes. So let's try to use ",{"type":40,"tag":189,"props":9650,"children":9652},{"className":9651},[],[9653],{"type":51,"value":1944},{"type":51,"value":9655}," script to format the code for us and reduce the time needed for fixes a million times.",{"type":40,"tag":179,"props":9657,"children":9659},{"className":3474,"code":9658,"language":3478,"meta":7,"style":7},"vendor/bin/phpcbf app/Core/Hooks.php --standard=PSR12\n\nPHPCBF RESULT SUMMARY\n------------------------------------------------------------------------------------------------------------------------\nFILE                                                                                                    FIXED  REMAINING\n------------------------------------------------------------------------------------------------------------------------\n/footmate.pro/wp-content/themes/footmate/app/Core/Hooks.php     4      1\n------------------------------------------------------------------------------------------------------------------------\nA TOTAL OF 4 ERRORS WERE FIXED IN 1 FILE\n------------------------------------------------------------------------------------------------------------------------\n",[9660],{"type":40,"tag":189,"props":9661,"children":9662},{"__ignoreMap":7},[9663,9671,9678,9686,9694,9702,9709,9717,9724,9732],{"type":40,"tag":193,"props":9664,"children":9665},{"class":196,"line":185},[9666],{"type":40,"tag":193,"props":9667,"children":9668},{"style":207},[9669],{"type":51,"value":9670},"vendor/bin/phpcbf app/Core/Hooks.php --standard=PSR12\n",{"type":40,"tag":193,"props":9672,"children":9673},{"class":196,"line":213},[9674],{"type":40,"tag":193,"props":9675,"children":9676},{"emptyLinePlaceholder":35},[9677],{"type":51,"value":626},{"type":40,"tag":193,"props":9679,"children":9680},{"class":196,"line":233},[9681],{"type":40,"tag":193,"props":9682,"children":9683},{"style":207},[9684],{"type":51,"value":9685},"PHPCBF RESULT SUMMARY\n",{"type":40,"tag":193,"props":9687,"children":9688},{"class":196,"line":446},[9689],{"type":40,"tag":193,"props":9690,"children":9691},{"style":201},[9692],{"type":51,"value":9693},"------------------------------------------------------------------------------------------------------------------------\n",{"type":40,"tag":193,"props":9695,"children":9696},{"class":196,"line":477},[9697],{"type":40,"tag":193,"props":9698,"children":9699},{"style":207},[9700],{"type":51,"value":9701},"FILE                                                                                                    FIXED  REMAINING\n",{"type":40,"tag":193,"props":9703,"children":9704},{"class":196,"line":507},[9705],{"type":40,"tag":193,"props":9706,"children":9707},{"style":201},[9708],{"type":51,"value":9693},{"type":40,"tag":193,"props":9710,"children":9711},{"class":196,"line":543},[9712],{"type":40,"tag":193,"props":9713,"children":9714},{"style":207},[9715],{"type":51,"value":9716},"/footmate.pro/wp-content/themes/footmate/app/Core/Hooks.php     4      1\n",{"type":40,"tag":193,"props":9718,"children":9719},{"class":196,"line":582},[9720],{"type":40,"tag":193,"props":9721,"children":9722},{"style":201},[9723],{"type":51,"value":9693},{"type":40,"tag":193,"props":9725,"children":9726},{"class":196,"line":620},[9727],{"type":40,"tag":193,"props":9728,"children":9729},{"style":207},[9730],{"type":51,"value":9731},"A TOTAL OF 4 ERRORS WERE FIXED IN 1 FILE\n",{"type":40,"tag":193,"props":9733,"children":9734},{"class":196,"line":294},[9735],{"type":40,"tag":193,"props":9736,"children":9737},{"style":201},[9738],{"type":51,"value":9693},{"type":40,"tag":47,"props":9740,"children":9741},{},[9742,9744,9749,9751,9756],{"type":51,"value":9743},"The tool ",{"type":40,"tag":95,"props":9745,"children":9746},{},[9747],{"type":51,"value":9748},"handled all the fixable problems automatically",{"type":51,"value":9750}," and informed me that there was one problem that needed attention. Once fixed, we can fire ",{"type":40,"tag":189,"props":9752,"children":9754},{"className":9753},[],[9755],{"type":51,"value":1936},{"type":51,"value":9757}," to see that there are no more problems to solve, meaning that the code is compliant with the rules.",{"type":40,"tag":58,"props":9759,"children":9760},{},[],{"type":40,"tag":47,"props":9762,"children":9763},{},[9764],{"type":51,"value":1644},{"type":40,"tag":47,"props":9766,"children":9767},{},[9768],{"type":51,"value":1649},{"type":40,"tag":47,"props":9770,"children":9771},{},[9772],{"type":40,"tag":95,"props":9773,"children":9774},{},[9775],{"type":51,"value":1657},{"type":40,"tag":1659,"props":9777,"children":9778},{},[],{"type":40,"tag":58,"props":9780,"children":9781},{},[],{"type":40,"tag":62,"props":9783,"children":9785},{"id":9784},"how-to-ignore-php-code-sniffer-errors",[9786],{"type":51,"value":9787},"How to ignore PHP Code Sniffer errors?",{"type":40,"tag":47,"props":9789,"children":9790},{},[9791,9793],{"type":51,"value":9792},"Another important part of the tool usage is ignoring the errors in the code. Sometimes, we NEED to write the code in a specific way, even when it breaks some rules. In Poland we say ",{"type":40,"tag":95,"props":9794,"children":9795},{},[9796],{"type":51,"value":9797},"chodźby skały srały, to ma być tak i ch*j.",{"type":40,"tag":47,"props":9799,"children":9800},{},[9801,9803,9809,9811,9817,9819,9825,9827,9834],{"type":51,"value":9802},"We can simply ignore next-line errors with ",{"type":40,"tag":189,"props":9804,"children":9806},{"className":9805},[],[9807],{"type":51,"value":9808},"phpcs:ignore",{"type":51,"value":9810}," comments, code range with the ",{"type":40,"tag":189,"props":9812,"children":9814},{"className":9813},[],[9815],{"type":51,"value":9816},"phpcs:disable",{"type":51,"value":9818}," and ",{"type":40,"tag":189,"props":9820,"children":9822},{"className":9821},[],[9823],{"type":51,"value":9824},"phpcs:enable",{"type":51,"value":9826}," comments, or reduce ignoring just to specific sniffs or standards. Of course, there are many more possibilities so check out them ",{"type":40,"tag":109,"props":9828,"children":9831},{"href":9829,"rel":9830},"https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-parts-of-a-file",[113],[9832],{"type":51,"value":9833},"in the doc",{"type":51,"value":265},{"type":40,"tag":174,"props":9836,"children":9838},{":tabs":9837},"[\"Before\", \"Line\", \"Block\", \"Rule\", \"Ruleset\", \"After\"]",[9839,9941,10064,10194,10316,10439],{"type":40,"tag":179,"props":9840,"children":9844},{"className":3474,"code":9841,"filename":9842,"highlights":9843,"language":3478,"meta":7,"style":7},"vendor/bin/phpcs app/Core/Hooks.php\n\nFILE: /footmate.pro/wp-content/themes/footmate/app/Core/Hooks.php\n----------------------------------------------------------------------------------------------------------------------\nFOUND 5 ERRORS AFFECTING 4 LINES\n----------------------------------------------------------------------------------------------------------------------\n1 | ERROR | [x] Header blocks must be separated by a single blank line (PSR12.Files.FileHeader.SpacingAfterBlock)\n5 | ERROR | [x] Opening class brace must be on a line by itself (PSR2.Classes.ClassDeclaration.OpenBraceNotAlone)\n5 | ERROR | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n6 | ERROR | [x] Opening brace should be on a new line (Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine)\n9 | ERROR | [x] Expected 1 newline at end of file; 0 found (PSR2.Files.EndFileNewline.NoneFound)\n----------------------------------------------------------------------------------------------------------------------\n","Before",[582],[9845],{"type":40,"tag":189,"props":9846,"children":9847},{"__ignoreMap":7},[9848,9856,9863,9870,9878,9886,9893,9901,9910,9918,9926,9934],{"type":40,"tag":193,"props":9849,"children":9850},{"class":196,"line":185},[9851],{"type":40,"tag":193,"props":9852,"children":9853},{"style":207},[9854],{"type":51,"value":9855},"vendor/bin/phpcs app/Core/Hooks.php\n",{"type":40,"tag":193,"props":9857,"children":9858},{"class":196,"line":213},[9859],{"type":40,"tag":193,"props":9860,"children":9861},{"emptyLinePlaceholder":35},[9862],{"type":51,"value":626},{"type":40,"tag":193,"props":9864,"children":9865},{"class":196,"line":233},[9866],{"type":40,"tag":193,"props":9867,"children":9868},{"style":207},[9869],{"type":51,"value":7697},{"type":40,"tag":193,"props":9871,"children":9872},{"class":196,"line":446},[9873],{"type":40,"tag":193,"props":9874,"children":9875},{"style":201},[9876],{"type":51,"value":9877},"----------------------------------------------------------------------------------------------------------------------\n",{"type":40,"tag":193,"props":9879,"children":9880},{"class":196,"line":477},[9881],{"type":40,"tag":193,"props":9882,"children":9883},{"style":207},[9884],{"type":51,"value":9885},"FOUND 5 ERRORS AFFECTING 4 LINES\n",{"type":40,"tag":193,"props":9887,"children":9888},{"class":196,"line":507},[9889],{"type":40,"tag":193,"props":9890,"children":9891},{"style":201},[9892],{"type":51,"value":9877},{"type":40,"tag":193,"props":9894,"children":9895},{"class":196,"line":543},[9896],{"type":40,"tag":193,"props":9897,"children":9898},{"style":207},[9899],{"type":51,"value":9900},"1 | ERROR | [x] Header blocks must be separated by a single blank line (PSR12.Files.FileHeader.SpacingAfterBlock)\n",{"type":40,"tag":193,"props":9902,"children":9904},{"class":9903,"line":582},[196,197],[9905],{"type":40,"tag":193,"props":9906,"children":9907},{"style":207},[9908],{"type":51,"value":9909},"5 | ERROR | [x] Opening class brace must be on a line by itself (PSR2.Classes.ClassDeclaration.OpenBraceNotAlone)\n",{"type":40,"tag":193,"props":9911,"children":9912},{"class":196,"line":620},[9913],{"type":40,"tag":193,"props":9914,"children":9915},{"style":207},[9916],{"type":51,"value":9917},"5 | ERROR | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n",{"type":40,"tag":193,"props":9919,"children":9920},{"class":196,"line":294},[9921],{"type":40,"tag":193,"props":9922,"children":9923},{"style":207},[9924],{"type":51,"value":9925},"6 | ERROR | [x] Opening brace should be on a new line (Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine)\n",{"type":40,"tag":193,"props":9927,"children":9928},{"class":196,"line":660},[9929],{"type":40,"tag":193,"props":9930,"children":9931},{"style":207},[9932],{"type":51,"value":9933},"9 | ERROR | [x] Expected 1 newline at end of file; 0 found (PSR2.Files.EndFileNewline.NoneFound)\n",{"type":40,"tag":193,"props":9935,"children":9936},{"class":196,"line":668},[9937],{"type":40,"tag":193,"props":9938,"children":9939},{"style":201},[9940],{"type":51,"value":9877},{"type":40,"tag":179,"props":9942,"children":9945},{"className":290,"code":9943,"filename":4243,"highlights":9944,"language":295,"meta":7,"style":7},"namespace FM\\Core;\n\nclass Hooks\n{\n    // phpcs:ignore\n    public static function init(): void {\n        $foo = array();\n    }\n}\n",[477],[9946],{"type":40,"tag":189,"props":9947,"children":9948},{"__ignoreMap":7},[9949,9966,9973,9984,9991,10000,10031,10050,10057],{"type":40,"tag":193,"props":9950,"children":9951},{"class":196,"line":185},[9952,9957,9962],{"type":40,"tag":193,"props":9953,"children":9954},{"style":672},[9955],{"type":51,"value":9956},"namespace",{"type":40,"tag":193,"props":9958,"children":9959},{"style":257},[9960],{"type":51,"value":9961}," FM\\Core",{"type":40,"tag":193,"props":9963,"children":9964},{"style":207},[9965],{"type":51,"value":230},{"type":40,"tag":193,"props":9967,"children":9968},{"class":196,"line":213},[9969],{"type":40,"tag":193,"props":9970,"children":9971},{"emptyLinePlaceholder":35},[9972],{"type":51,"value":626},{"type":40,"tag":193,"props":9974,"children":9975},{"class":196,"line":233},[9976,9980],{"type":40,"tag":193,"props":9977,"children":9978},{"style":672},[9979],{"type":51,"value":3180},{"type":40,"tag":193,"props":9981,"children":9982},{"style":257},[9983],{"type":51,"value":7599},{"type":40,"tag":193,"props":9985,"children":9986},{"class":196,"line":446},[9987],{"type":40,"tag":193,"props":9988,"children":9989},{"style":207},[9990],{"type":51,"value":1389},{"type":40,"tag":193,"props":9992,"children":9994},{"class":9993,"line":477},[196,197],[9995],{"type":40,"tag":193,"props":9996,"children":9997},{"style":4180},[9998],{"type":51,"value":9999},"    // phpcs:ignore\n",{"type":40,"tag":193,"props":10001,"children":10002},{"class":196,"line":507},[10003,10007,10011,10015,10019,10023,10027],{"type":40,"tag":193,"props":10004,"children":10005},{"style":672},[10006],{"type":51,"value":7614},{"type":40,"tag":193,"props":10008,"children":10009},{"style":672},[10010],{"type":51,"value":7619},{"type":40,"tag":193,"props":10012,"children":10013},{"style":672},[10014],{"type":51,"value":7624},{"type":40,"tag":193,"props":10016,"children":10017},{"style":268},[10018],{"type":51,"value":2934},{"type":40,"tag":193,"props":10020,"children":10021},{"style":207},[10022],{"type":51,"value":7633},{"type":40,"tag":193,"props":10024,"children":10025},{"style":257},[10026],{"type":51,"value":7638},{"type":40,"tag":193,"props":10028,"children":10029},{"style":207},[10030],{"type":51,"value":210},{"type":40,"tag":193,"props":10032,"children":10033},{"class":196,"line":543},[10034,10038,10042,10046],{"type":40,"tag":193,"props":10035,"children":10036},{"style":201},[10037],{"type":51,"value":7651},{"type":40,"tag":193,"props":10039,"children":10040},{"style":305},[10041],{"type":51,"value":7656},{"type":40,"tag":193,"props":10043,"children":10044},{"style":305},[10045],{"type":51,"value":7661},{"type":40,"tag":193,"props":10047,"children":10048},{"style":207},[10049],{"type":51,"value":7666},{"type":40,"tag":193,"props":10051,"children":10052},{"class":196,"line":582},[10053],{"type":40,"tag":193,"props":10054,"children":10055},{"style":207},[10056],{"type":51,"value":3424},{"type":40,"tag":193,"props":10058,"children":10059},{"class":196,"line":620},[10060],{"type":40,"tag":193,"props":10061,"children":10062},{"style":207},[10063],{"type":51,"value":239},{"type":40,"tag":179,"props":10065,"children":10068},{"className":290,"code":10066,"filename":4155,"highlights":10067,"language":295,"meta":7,"style":7},"namespace FM\\Core;\n\nclass Hooks\n{\n    // phpcs:disable\n    public static function init(): void {\n        $foo = array();\n    }\n    // phpcs:enable\n}\n",[477,620],[10069],{"type":40,"tag":189,"props":10070,"children":10071},{"__ignoreMap":7},[10072,10087,10094,10105,10112,10121,10152,10171,10178,10187],{"type":40,"tag":193,"props":10073,"children":10074},{"class":196,"line":185},[10075,10079,10083],{"type":40,"tag":193,"props":10076,"children":10077},{"style":672},[10078],{"type":51,"value":9956},{"type":40,"tag":193,"props":10080,"children":10081},{"style":257},[10082],{"type":51,"value":9961},{"type":40,"tag":193,"props":10084,"children":10085},{"style":207},[10086],{"type":51,"value":230},{"type":40,"tag":193,"props":10088,"children":10089},{"class":196,"line":213},[10090],{"type":40,"tag":193,"props":10091,"children":10092},{"emptyLinePlaceholder":35},[10093],{"type":51,"value":626},{"type":40,"tag":193,"props":10095,"children":10096},{"class":196,"line":233},[10097,10101],{"type":40,"tag":193,"props":10098,"children":10099},{"style":672},[10100],{"type":51,"value":3180},{"type":40,"tag":193,"props":10102,"children":10103},{"style":257},[10104],{"type":51,"value":7599},{"type":40,"tag":193,"props":10106,"children":10107},{"class":196,"line":446},[10108],{"type":40,"tag":193,"props":10109,"children":10110},{"style":207},[10111],{"type":51,"value":1389},{"type":40,"tag":193,"props":10113,"children":10115},{"class":10114,"line":477},[196,197],[10116],{"type":40,"tag":193,"props":10117,"children":10118},{"style":4180},[10119],{"type":51,"value":10120},"    // phpcs:disable\n",{"type":40,"tag":193,"props":10122,"children":10123},{"class":196,"line":507},[10124,10128,10132,10136,10140,10144,10148],{"type":40,"tag":193,"props":10125,"children":10126},{"style":672},[10127],{"type":51,"value":7614},{"type":40,"tag":193,"props":10129,"children":10130},{"style":672},[10131],{"type":51,"value":7619},{"type":40,"tag":193,"props":10133,"children":10134},{"style":672},[10135],{"type":51,"value":7624},{"type":40,"tag":193,"props":10137,"children":10138},{"style":268},[10139],{"type":51,"value":2934},{"type":40,"tag":193,"props":10141,"children":10142},{"style":207},[10143],{"type":51,"value":7633},{"type":40,"tag":193,"props":10145,"children":10146},{"style":257},[10147],{"type":51,"value":7638},{"type":40,"tag":193,"props":10149,"children":10150},{"style":207},[10151],{"type":51,"value":210},{"type":40,"tag":193,"props":10153,"children":10154},{"class":196,"line":543},[10155,10159,10163,10167],{"type":40,"tag":193,"props":10156,"children":10157},{"style":201},[10158],{"type":51,"value":7651},{"type":40,"tag":193,"props":10160,"children":10161},{"style":305},[10162],{"type":51,"value":7656},{"type":40,"tag":193,"props":10164,"children":10165},{"style":305},[10166],{"type":51,"value":7661},{"type":40,"tag":193,"props":10168,"children":10169},{"style":207},[10170],{"type":51,"value":7666},{"type":40,"tag":193,"props":10172,"children":10173},{"class":196,"line":582},[10174],{"type":40,"tag":193,"props":10175,"children":10176},{"style":207},[10177],{"type":51,"value":3424},{"type":40,"tag":193,"props":10179,"children":10181},{"class":10180,"line":620},[196,197],[10182],{"type":40,"tag":193,"props":10183,"children":10184},{"style":4180},[10185],{"type":51,"value":10186},"    // phpcs:enable\n",{"type":40,"tag":193,"props":10188,"children":10189},{"class":196,"line":294},[10190],{"type":40,"tag":193,"props":10191,"children":10192},{"style":207},[10193],{"type":51,"value":239},{"type":40,"tag":179,"props":10195,"children":10199},{"className":290,"code":10196,"filename":10197,"highlights":10198,"language":295,"meta":7,"style":7},"namespace FM\\Core;\n\nclass Hooks\n{\n    // phpcs:ignore Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine\n    public static function init(): void {\n        $foo = array();\n    }\n}\n","Rule",[477],[10200],{"type":40,"tag":189,"props":10201,"children":10202},{"__ignoreMap":7},[10203,10218,10225,10236,10243,10252,10283,10302,10309],{"type":40,"tag":193,"props":10204,"children":10205},{"class":196,"line":185},[10206,10210,10214],{"type":40,"tag":193,"props":10207,"children":10208},{"style":672},[10209],{"type":51,"value":9956},{"type":40,"tag":193,"props":10211,"children":10212},{"style":257},[10213],{"type":51,"value":9961},{"type":40,"tag":193,"props":10215,"children":10216},{"style":207},[10217],{"type":51,"value":230},{"type":40,"tag":193,"props":10219,"children":10220},{"class":196,"line":213},[10221],{"type":40,"tag":193,"props":10222,"children":10223},{"emptyLinePlaceholder":35},[10224],{"type":51,"value":626},{"type":40,"tag":193,"props":10226,"children":10227},{"class":196,"line":233},[10228,10232],{"type":40,"tag":193,"props":10229,"children":10230},{"style":672},[10231],{"type":51,"value":3180},{"type":40,"tag":193,"props":10233,"children":10234},{"style":257},[10235],{"type":51,"value":7599},{"type":40,"tag":193,"props":10237,"children":10238},{"class":196,"line":446},[10239],{"type":40,"tag":193,"props":10240,"children":10241},{"style":207},[10242],{"type":51,"value":1389},{"type":40,"tag":193,"props":10244,"children":10246},{"class":10245,"line":477},[196,197],[10247],{"type":40,"tag":193,"props":10248,"children":10249},{"style":4180},[10250],{"type":51,"value":10251},"    // phpcs:ignore Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine\n",{"type":40,"tag":193,"props":10253,"children":10254},{"class":196,"line":507},[10255,10259,10263,10267,10271,10275,10279],{"type":40,"tag":193,"props":10256,"children":10257},{"style":672},[10258],{"type":51,"value":7614},{"type":40,"tag":193,"props":10260,"children":10261},{"style":672},[10262],{"type":51,"value":7619},{"type":40,"tag":193,"props":10264,"children":10265},{"style":672},[10266],{"type":51,"value":7624},{"type":40,"tag":193,"props":10268,"children":10269},{"style":268},[10270],{"type":51,"value":2934},{"type":40,"tag":193,"props":10272,"children":10273},{"style":207},[10274],{"type":51,"value":7633},{"type":40,"tag":193,"props":10276,"children":10277},{"style":257},[10278],{"type":51,"value":7638},{"type":40,"tag":193,"props":10280,"children":10281},{"style":207},[10282],{"type":51,"value":210},{"type":40,"tag":193,"props":10284,"children":10285},{"class":196,"line":543},[10286,10290,10294,10298],{"type":40,"tag":193,"props":10287,"children":10288},{"style":201},[10289],{"type":51,"value":7651},{"type":40,"tag":193,"props":10291,"children":10292},{"style":305},[10293],{"type":51,"value":7656},{"type":40,"tag":193,"props":10295,"children":10296},{"style":305},[10297],{"type":51,"value":7661},{"type":40,"tag":193,"props":10299,"children":10300},{"style":207},[10301],{"type":51,"value":7666},{"type":40,"tag":193,"props":10303,"children":10304},{"class":196,"line":582},[10305],{"type":40,"tag":193,"props":10306,"children":10307},{"style":207},[10308],{"type":51,"value":3424},{"type":40,"tag":193,"props":10310,"children":10311},{"class":196,"line":620},[10312],{"type":40,"tag":193,"props":10313,"children":10314},{"style":207},[10315],{"type":51,"value":239},{"type":40,"tag":179,"props":10317,"children":10322},{"className":10318,"code":10319,"filename":10320,"language":10321,"meta":7,"style":7},"language-xml shiki shiki-themes one-dark-pro","\u003Cruleset>\n  \u003Crule ref=\"WordPress\">\n    \u003Cexclude name=\"WordPress.Files.FileName.NotHyphenatedLowercase\" />\n  \u003C/rule>\n\u003C/ruleset>\n","Ruleset","xml",[10323],{"type":40,"tag":189,"props":10324,"children":10325},{"__ignoreMap":7},[10326,10344,10375,10407,10423],{"type":40,"tag":193,"props":10327,"children":10328},{"class":196,"line":185},[10329,10334,10339],{"type":40,"tag":193,"props":10330,"children":10331},{"style":207},[10332],{"type":51,"value":10333},"\u003C",{"type":40,"tag":193,"props":10335,"children":10336},{"style":201},[10337],{"type":51,"value":10338},"ruleset",{"type":40,"tag":193,"props":10340,"children":10341},{"style":207},[10342],{"type":51,"value":10343},">\n",{"type":40,"tag":193,"props":10345,"children":10346},{"class":196,"line":213},[10347,10352,10357,10362,10366,10371],{"type":40,"tag":193,"props":10348,"children":10349},{"style":207},[10350],{"type":51,"value":10351},"  \u003C",{"type":40,"tag":193,"props":10353,"children":10354},{"style":201},[10355],{"type":51,"value":10356},"rule",{"type":40,"tag":193,"props":10358,"children":10359},{"style":222},[10360],{"type":51,"value":10361}," ref",{"type":40,"tag":193,"props":10363,"children":10364},{"style":207},[10365],{"type":51,"value":8178},{"type":40,"tag":193,"props":10367,"children":10368},{"style":279},[10369],{"type":51,"value":10370},"\"WordPress\"",{"type":40,"tag":193,"props":10372,"children":10373},{"style":207},[10374],{"type":51,"value":10343},{"type":40,"tag":193,"props":10376,"children":10377},{"class":196,"line":233},[10378,10383,10388,10393,10397,10402],{"type":40,"tag":193,"props":10379,"children":10380},{"style":207},[10381],{"type":51,"value":10382},"    \u003C",{"type":40,"tag":193,"props":10384,"children":10385},{"style":201},[10386],{"type":51,"value":10387},"exclude",{"type":40,"tag":193,"props":10389,"children":10390},{"style":222},[10391],{"type":51,"value":10392}," name",{"type":40,"tag":193,"props":10394,"children":10395},{"style":207},[10396],{"type":51,"value":8178},{"type":40,"tag":193,"props":10398,"children":10399},{"style":279},[10400],{"type":51,"value":10401},"\"WordPress.Files.FileName.NotHyphenatedLowercase\"",{"type":40,"tag":193,"props":10403,"children":10404},{"style":207},[10405],{"type":51,"value":10406}," />\n",{"type":40,"tag":193,"props":10408,"children":10409},{"class":196,"line":446},[10410,10415,10419],{"type":40,"tag":193,"props":10411,"children":10412},{"style":207},[10413],{"type":51,"value":10414},"  \u003C/",{"type":40,"tag":193,"props":10416,"children":10417},{"style":201},[10418],{"type":51,"value":10356},{"type":40,"tag":193,"props":10420,"children":10421},{"style":207},[10422],{"type":51,"value":10343},{"type":40,"tag":193,"props":10424,"children":10425},{"class":196,"line":477},[10426,10431,10435],{"type":40,"tag":193,"props":10427,"children":10428},{"style":207},[10429],{"type":51,"value":10430},"\u003C/",{"type":40,"tag":193,"props":10432,"children":10433},{"style":201},[10434],{"type":51,"value":10338},{"type":40,"tag":193,"props":10436,"children":10437},{"style":207},[10438],{"type":51,"value":10343},{"type":40,"tag":179,"props":10440,"children":10443},{"className":3474,"code":10441,"filename":10442,"language":3478,"meta":7,"style":7},"vendor/bin/phpcs app/Core/Hooks.php\n\nFILE: /footmate.pro/wp-content/themes/footmate/app/Core/Hooks.php\n--------------------------------------------------------------------------------------------------------------------\nFOUND 5 ERRORS AFFECTING 3 LINES\n--------------------------------------------------------------------------------------------------------------------\n 1 | ERROR | [x] Header blocks must be separated by a single blank line (PSR12.Files.FileHeader.SpacingAfterBlock)\n 5 | ERROR | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n10 | ERROR | [x] Expected 1 newline at end of file; 0 found (PSR2.Files.EndFileNewline.NoneFound)\n10 | ERROR | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n--------------------------------------------------------------------------------------------------------------------\n","After",[10444],{"type":40,"tag":189,"props":10445,"children":10446},{"__ignoreMap":7},[10447,10454,10461,10468,10476,10484,10491,10499,10507,10515,10523],{"type":40,"tag":193,"props":10448,"children":10449},{"class":196,"line":185},[10450],{"type":40,"tag":193,"props":10451,"children":10452},{"style":207},[10453],{"type":51,"value":9855},{"type":40,"tag":193,"props":10455,"children":10456},{"class":196,"line":213},[10457],{"type":40,"tag":193,"props":10458,"children":10459},{"emptyLinePlaceholder":35},[10460],{"type":51,"value":626},{"type":40,"tag":193,"props":10462,"children":10463},{"class":196,"line":233},[10464],{"type":40,"tag":193,"props":10465,"children":10466},{"style":207},[10467],{"type":51,"value":7697},{"type":40,"tag":193,"props":10469,"children":10470},{"class":196,"line":446},[10471],{"type":40,"tag":193,"props":10472,"children":10473},{"style":201},[10474],{"type":51,"value":10475},"--------------------------------------------------------------------------------------------------------------------\n",{"type":40,"tag":193,"props":10477,"children":10478},{"class":196,"line":477},[10479],{"type":40,"tag":193,"props":10480,"children":10481},{"style":207},[10482],{"type":51,"value":10483},"FOUND 5 ERRORS AFFECTING 3 LINES\n",{"type":40,"tag":193,"props":10485,"children":10486},{"class":196,"line":507},[10487],{"type":40,"tag":193,"props":10488,"children":10489},{"style":201},[10490],{"type":51,"value":10475},{"type":40,"tag":193,"props":10492,"children":10493},{"class":196,"line":543},[10494],{"type":40,"tag":193,"props":10495,"children":10496},{"style":207},[10497],{"type":51,"value":10498}," 1 | ERROR | [x] Header blocks must be separated by a single blank line (PSR12.Files.FileHeader.SpacingAfterBlock)\n",{"type":40,"tag":193,"props":10500,"children":10501},{"class":196,"line":582},[10502],{"type":40,"tag":193,"props":10503,"children":10504},{"style":207},[10505],{"type":51,"value":10506}," 5 | ERROR | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n",{"type":40,"tag":193,"props":10508,"children":10509},{"class":196,"line":620},[10510],{"type":40,"tag":193,"props":10511,"children":10512},{"style":207},[10513],{"type":51,"value":10514},"10 | ERROR | [x] Expected 1 newline at end of file; 0 found (PSR2.Files.EndFileNewline.NoneFound)\n",{"type":40,"tag":193,"props":10516,"children":10517},{"class":196,"line":294},[10518],{"type":40,"tag":193,"props":10519,"children":10520},{"style":207},[10521],{"type":51,"value":10522},"10 | ERROR | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n",{"type":40,"tag":193,"props":10524,"children":10525},{"class":196,"line":660},[10526],{"type":40,"tag":193,"props":10527,"children":10528},{"style":201},[10529],{"type":51,"value":10475},{"type":40,"tag":47,"props":10531,"children":10532},{},[10533,10535,10540,10542,10547,10549,10554],{"type":51,"value":10534},"Of course, by saying \"",{"type":40,"tag":79,"props":10536,"children":10537},{},[10538],{"type":51,"value":10539},"We can use it",{"type":51,"value":10541},"\" I don't mean \"",{"type":40,"tag":79,"props":10543,"children":10544},{},[10545],{"type":51,"value":10546},"We can ignore the whole codebase",{"type":51,"value":10548},"\". ",{"type":40,"tag":95,"props":10550,"children":10551},{},[10552],{"type":51,"value":10553},"It requires a delicate balance between adherence to standards and pragmatic coding need.",{"type":51,"value":10555}," So please, be careful because the project leader might not be happy 😅",{"type":40,"tag":58,"props":10557,"children":10558},{},[],{"type":40,"tag":62,"props":10560,"children":10562},{"id":10561},"how-to-configure-php-code-sniffer",[10563],{"type":51,"value":10564},"How to configure PHP Code Sniffer?",{"type":40,"tag":47,"props":10566,"children":10567},{},[10568,10570,10582,10584,10589,10591,10597],{"type":51,"value":10569},"Let's say that, we want to have a more personalized approach to checking the PHP code for potential problems. PHP Code Sniffer ",{"type":40,"tag":95,"props":10571,"children":10572},{},[10573,10575],{"type":51,"value":10574},"allows modifying its default behavior with a wide set of ",{"type":40,"tag":109,"props":10576,"children":10579},{"href":10577,"rel":10578},"https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Usage#getting-help-from-the-command-line",[113],[10580],{"type":51,"value":10581},"command line arguments",{"type":51,"value":10583}," so we can use them to define custom workflow. We want to use ",{"type":40,"tag":189,"props":10585,"children":10587},{"className":10586},[],[10588],{"type":51,"value":8029},{"type":51,"value":10590}," coding standards, check only files located within the ",{"type":40,"tag":189,"props":10592,"children":10594},{"className":10593},[],[10595],{"type":51,"value":10596},"app",{"type":51,"value":10598}," folder, and print color output. We can use the following command.",{"type":40,"tag":179,"props":10600,"children":10602},{"className":9188,"code":10601,"language":9190,"meta":7,"style":7},"vendor/bin/phpcs app --standard=PSR12 --colors\n",[10603],{"type":40,"tag":189,"props":10604,"children":10605},{"__ignoreMap":7},[10606],{"type":40,"tag":193,"props":10607,"children":10608},{"class":196,"line":185},[10609,10613,10618,10623],{"type":40,"tag":193,"props":10610,"children":10611},{"style":268},[10612],{"type":51,"value":8384},{"type":40,"tag":193,"props":10614,"children":10615},{"style":279},[10616],{"type":51,"value":10617}," app",{"type":40,"tag":193,"props":10619,"children":10620},{"style":222},[10621],{"type":51,"value":10622}," --standard=PSR12",{"type":40,"tag":193,"props":10624,"children":10625},{"style":222},[10626],{"type":51,"value":10627}," --colors\n",{"type":40,"tag":47,"props":10629,"children":10630},{},[10631,10633,10640,10641,10647],{"type":51,"value":10632},"We can simplify it and reduce the number of arguments we need to pass in the terminal by defining ",{"type":40,"tag":109,"props":10634,"children":10637},{"href":10635,"rel":10636},"https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-file",[113],[10638],{"type":51,"value":10639},"the configuration file",{"type":51,"value":1107},{"type":40,"tag":189,"props":10642,"children":10644},{"className":10643},[],[10645],{"type":51,"value":10646},"phpcs.xml.dist",{"type":51,"value":10648}," in the theme or the plugin directory. Tool will search for this file in the current and parent directories - when no standard is specified in the command line - and use the configuration defined there.",{"type":40,"tag":179,"props":10650,"children":10652},{"className":10318,"code":10651,"filename":10646,"language":10321,"meta":7,"style":7},"\u003C?xml version=\"1.0\"?>\n\n\u003Cruleset name=\"pragmatedev\">\n  \u003Carg name=\"colors\" />\n\n  \u003Cfile>app\u003C/file>\n\n  \u003Crule ref=\"PSR12\" />\n\u003C/ruleset>\n",[10653],{"type":40,"tag":189,"props":10654,"children":10655},{"__ignoreMap":7},[10656,10687,10694,10722,10751,10758,10782,10789,10817],{"type":40,"tag":193,"props":10657,"children":10658},{"class":196,"line":185},[10659,10664,10668,10673,10677,10682],{"type":40,"tag":193,"props":10660,"children":10661},{"style":207},[10662],{"type":51,"value":10663},"\u003C?",{"type":40,"tag":193,"props":10665,"children":10666},{"style":201},[10667],{"type":51,"value":10321},{"type":40,"tag":193,"props":10669,"children":10670},{"style":222},[10671],{"type":51,"value":10672}," version",{"type":40,"tag":193,"props":10674,"children":10675},{"style":207},[10676],{"type":51,"value":8178},{"type":40,"tag":193,"props":10678,"children":10679},{"style":279},[10680],{"type":51,"value":10681},"\"1.0\"",{"type":40,"tag":193,"props":10683,"children":10684},{"style":207},[10685],{"type":51,"value":10686},"?>\n",{"type":40,"tag":193,"props":10688,"children":10689},{"class":196,"line":213},[10690],{"type":40,"tag":193,"props":10691,"children":10692},{"emptyLinePlaceholder":35},[10693],{"type":51,"value":626},{"type":40,"tag":193,"props":10695,"children":10696},{"class":196,"line":233},[10697,10701,10705,10709,10713,10718],{"type":40,"tag":193,"props":10698,"children":10699},{"style":207},[10700],{"type":51,"value":10333},{"type":40,"tag":193,"props":10702,"children":10703},{"style":201},[10704],{"type":51,"value":10338},{"type":40,"tag":193,"props":10706,"children":10707},{"style":222},[10708],{"type":51,"value":10392},{"type":40,"tag":193,"props":10710,"children":10711},{"style":207},[10712],{"type":51,"value":8178},{"type":40,"tag":193,"props":10714,"children":10715},{"style":279},[10716],{"type":51,"value":10717},"\"pragmatedev\"",{"type":40,"tag":193,"props":10719,"children":10720},{"style":207},[10721],{"type":51,"value":10343},{"type":40,"tag":193,"props":10723,"children":10724},{"class":196,"line":446},[10725,10729,10734,10738,10742,10747],{"type":40,"tag":193,"props":10726,"children":10727},{"style":207},[10728],{"type":51,"value":10351},{"type":40,"tag":193,"props":10730,"children":10731},{"style":201},[10732],{"type":51,"value":10733},"arg",{"type":40,"tag":193,"props":10735,"children":10736},{"style":222},[10737],{"type":51,"value":10392},{"type":40,"tag":193,"props":10739,"children":10740},{"style":207},[10741],{"type":51,"value":8178},{"type":40,"tag":193,"props":10743,"children":10744},{"style":279},[10745],{"type":51,"value":10746},"\"colors\"",{"type":40,"tag":193,"props":10748,"children":10749},{"style":207},[10750],{"type":51,"value":10406},{"type":40,"tag":193,"props":10752,"children":10753},{"class":196,"line":477},[10754],{"type":40,"tag":193,"props":10755,"children":10756},{"emptyLinePlaceholder":35},[10757],{"type":51,"value":626},{"type":40,"tag":193,"props":10759,"children":10760},{"class":196,"line":507},[10761,10765,10769,10774,10778],{"type":40,"tag":193,"props":10762,"children":10763},{"style":207},[10764],{"type":51,"value":10351},{"type":40,"tag":193,"props":10766,"children":10767},{"style":201},[10768],{"type":51,"value":1114},{"type":40,"tag":193,"props":10770,"children":10771},{"style":207},[10772],{"type":51,"value":10773},">app\u003C/",{"type":40,"tag":193,"props":10775,"children":10776},{"style":201},[10777],{"type":51,"value":1114},{"type":40,"tag":193,"props":10779,"children":10780},{"style":207},[10781],{"type":51,"value":10343},{"type":40,"tag":193,"props":10783,"children":10784},{"class":196,"line":543},[10785],{"type":40,"tag":193,"props":10786,"children":10787},{"emptyLinePlaceholder":35},[10788],{"type":51,"value":626},{"type":40,"tag":193,"props":10790,"children":10791},{"class":196,"line":582},[10792,10796,10800,10804,10808,10813],{"type":40,"tag":193,"props":10793,"children":10794},{"style":207},[10795],{"type":51,"value":10351},{"type":40,"tag":193,"props":10797,"children":10798},{"style":201},[10799],{"type":51,"value":10356},{"type":40,"tag":193,"props":10801,"children":10802},{"style":222},[10803],{"type":51,"value":10361},{"type":40,"tag":193,"props":10805,"children":10806},{"style":207},[10807],{"type":51,"value":8178},{"type":40,"tag":193,"props":10809,"children":10810},{"style":279},[10811],{"type":51,"value":10812},"\"PSR12\"",{"type":40,"tag":193,"props":10814,"children":10815},{"style":207},[10816],{"type":51,"value":10406},{"type":40,"tag":193,"props":10818,"children":10819},{"class":196,"line":620},[10820,10824,10828],{"type":40,"tag":193,"props":10821,"children":10822},{"style":207},[10823],{"type":51,"value":10430},{"type":40,"tag":193,"props":10825,"children":10826},{"style":201},[10827],{"type":51,"value":10338},{"type":40,"tag":193,"props":10829,"children":10830},{"style":207},[10831],{"type":51,"value":10343},{"type":40,"tag":47,"props":10833,"children":10834},{},[10835,10837,10842],{"type":51,"value":10836},"Now, we can use the ",{"type":40,"tag":189,"props":10838,"children":10840},{"className":10839},[],[10841],{"type":51,"value":8384},{"type":51,"value":10843}," command without specifying any arguments and everything works as earlier when we used CLI arguments 🎉",{"type":40,"tag":179,"props":10845,"children":10847},{"className":9188,"code":10846,"language":9190,"meta":7,"style":7},"vendor/bin/phpcs\n",[10848],{"type":40,"tag":189,"props":10849,"children":10850},{"__ignoreMap":7},[10851],{"type":40,"tag":193,"props":10852,"children":10853},{"class":196,"line":185},[10854],{"type":40,"tag":193,"props":10855,"children":10856},{"style":268},[10857],{"type":51,"value":10846},{"type":40,"tag":47,"props":10859,"children":10860},{},[10861,10863,10870,10872,10878],{"type":51,"value":10862},"The config file might be used also to make even more ",{"type":40,"tag":109,"props":10864,"children":10867},{"href":10865,"rel":10866},"https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/FAQ#i-dont-agree-with-your-coding-standards-can-i-make-php_codesniffer-enforce-my-own",[113],[10868],{"type":51,"value":10869},"personalized choices",{"type":51,"value":10871}," related to the code formatting. Let's say that we don't want to follow the ",{"type":40,"tag":109,"props":10873,"children":10876},{"href":10874,"rel":10875},"https://www.php-fig.org/psr/psr-12/#44-methods-and-functions",[113],[10877],{"type":51,"value":10356},{"type":51,"value":10879}," applied by the PSR12 standard stating that the function opening brace should be in the new line.",{"type":40,"tag":174,"props":10881,"children":10882},{":tabs":7577},[10883,10996],{"type":40,"tag":179,"props":10884,"children":10887},{"className":290,"code":10885,"filename":7582,"highlights":10886,"language":295,"meta":7,"style":7},"namespace FM\\Core;\n\nclass Hooks\n{\n    public static function init(): void {\n        $foo = array();\n    }\n}\n",[477],[10888],{"type":40,"tag":189,"props":10889,"children":10890},{"__ignoreMap":7},[10891,10906,10913,10924,10931,10963,10982,10989],{"type":40,"tag":193,"props":10892,"children":10893},{"class":196,"line":185},[10894,10898,10902],{"type":40,"tag":193,"props":10895,"children":10896},{"style":672},[10897],{"type":51,"value":9956},{"type":40,"tag":193,"props":10899,"children":10900},{"style":257},[10901],{"type":51,"value":9961},{"type":40,"tag":193,"props":10903,"children":10904},{"style":207},[10905],{"type":51,"value":230},{"type":40,"tag":193,"props":10907,"children":10908},{"class":196,"line":213},[10909],{"type":40,"tag":193,"props":10910,"children":10911},{"emptyLinePlaceholder":35},[10912],{"type":51,"value":626},{"type":40,"tag":193,"props":10914,"children":10915},{"class":196,"line":233},[10916,10920],{"type":40,"tag":193,"props":10917,"children":10918},{"style":672},[10919],{"type":51,"value":3180},{"type":40,"tag":193,"props":10921,"children":10922},{"style":257},[10923],{"type":51,"value":7599},{"type":40,"tag":193,"props":10925,"children":10926},{"class":196,"line":446},[10927],{"type":40,"tag":193,"props":10928,"children":10929},{"style":207},[10930],{"type":51,"value":1389},{"type":40,"tag":193,"props":10932,"children":10934},{"class":10933,"line":477},[196,197],[10935,10939,10943,10947,10951,10955,10959],{"type":40,"tag":193,"props":10936,"children":10937},{"style":672},[10938],{"type":51,"value":7614},{"type":40,"tag":193,"props":10940,"children":10941},{"style":672},[10942],{"type":51,"value":7619},{"type":40,"tag":193,"props":10944,"children":10945},{"style":672},[10946],{"type":51,"value":7624},{"type":40,"tag":193,"props":10948,"children":10949},{"style":268},[10950],{"type":51,"value":2934},{"type":40,"tag":193,"props":10952,"children":10953},{"style":207},[10954],{"type":51,"value":7633},{"type":40,"tag":193,"props":10956,"children":10957},{"style":257},[10958],{"type":51,"value":7638},{"type":40,"tag":193,"props":10960,"children":10961},{"style":207},[10962],{"type":51,"value":210},{"type":40,"tag":193,"props":10964,"children":10965},{"class":196,"line":507},[10966,10970,10974,10978],{"type":40,"tag":193,"props":10967,"children":10968},{"style":201},[10969],{"type":51,"value":7651},{"type":40,"tag":193,"props":10971,"children":10972},{"style":305},[10973],{"type":51,"value":7656},{"type":40,"tag":193,"props":10975,"children":10976},{"style":305},[10977],{"type":51,"value":7661},{"type":40,"tag":193,"props":10979,"children":10980},{"style":207},[10981],{"type":51,"value":7666},{"type":40,"tag":193,"props":10983,"children":10984},{"class":196,"line":543},[10985],{"type":40,"tag":193,"props":10986,"children":10987},{"style":207},[10988],{"type":51,"value":3424},{"type":40,"tag":193,"props":10990,"children":10991},{"class":196,"line":582},[10992],{"type":40,"tag":193,"props":10993,"children":10994},{"style":207},[10995],{"type":51,"value":239},{"type":40,"tag":179,"props":10997,"children":11000},{"className":3474,"code":10998,"filename":7684,"highlights":10999,"language":3478,"meta":7,"style":7},"vendor/bin/phpcs app/Core/Hooks.php\n\nFILE: /footmate.pro/wp-content/themes/footmate/app/Core/Hooks.php\n----------------------------------------------------------------------------------------------------------------------\nFOUND 1 ERROR AFFECTING 1 LINE\n----------------------------------------------------------------------------------------------------------------------\n7 | ERROR | [x] Opening brace should be on a new line\n----------------------------------------------------------------------------------------------------------------------\n",[543],[11001],{"type":40,"tag":189,"props":11002,"children":11003},{"__ignoreMap":7},[11004,11011,11018,11025,11032,11039,11046,11055],{"type":40,"tag":193,"props":11005,"children":11006},{"class":196,"line":185},[11007],{"type":40,"tag":193,"props":11008,"children":11009},{"style":207},[11010],{"type":51,"value":9855},{"type":40,"tag":193,"props":11012,"children":11013},{"class":196,"line":213},[11014],{"type":40,"tag":193,"props":11015,"children":11016},{"emptyLinePlaceholder":35},[11017],{"type":51,"value":626},{"type":40,"tag":193,"props":11019,"children":11020},{"class":196,"line":233},[11021],{"type":40,"tag":193,"props":11022,"children":11023},{"style":207},[11024],{"type":51,"value":7697},{"type":40,"tag":193,"props":11026,"children":11027},{"class":196,"line":446},[11028],{"type":40,"tag":193,"props":11029,"children":11030},{"style":201},[11031],{"type":51,"value":9877},{"type":40,"tag":193,"props":11033,"children":11034},{"class":196,"line":477},[11035],{"type":40,"tag":193,"props":11036,"children":11037},{"style":207},[11038],{"type":51,"value":7713},{"type":40,"tag":193,"props":11040,"children":11041},{"class":196,"line":507},[11042],{"type":40,"tag":193,"props":11043,"children":11044},{"style":201},[11045],{"type":51,"value":9877},{"type":40,"tag":193,"props":11047,"children":11049},{"class":11048,"line":543},[196,197],[11050],{"type":40,"tag":193,"props":11051,"children":11052},{"style":207},[11053],{"type":51,"value":11054},"7 | ERROR | [x] Opening brace should be on a new line\n",{"type":40,"tag":193,"props":11056,"children":11057},{"class":196,"line":582},[11058],{"type":40,"tag":193,"props":11059,"children":11060},{"style":201},[11061],{"type":51,"value":9877},{"type":40,"tag":47,"props":11063,"children":11064},{},[11065,11067,11072,11074],{"type":51,"value":11066},"To reflect this in the ",{"type":40,"tag":189,"props":11068,"children":11070},{"className":11069},[],[11071],{"type":51,"value":1936},{"type":51,"value":11073}," config, we need to know the unique identifier of the rule that checks this first. ",{"type":40,"tag":95,"props":11075,"children":11076},{},[11077,11079,11085,11087,11092],{"type":51,"value":11078},"We can find it out by adding the ",{"type":40,"tag":189,"props":11080,"children":11082},{"className":11081},[],[11083],{"type":51,"value":11084},"-s",{"type":51,"value":11086}," attribute to the ",{"type":40,"tag":189,"props":11088,"children":11090},{"className":11089},[],[11091],{"type":51,"value":1936},{"type":51,"value":2582},{"type":40,"tag":179,"props":11094,"children":11097},{"className":3474,"code":11095,"highlights":11096,"language":3478,"meta":7,"style":7},"vendor/bin/phpcs app/Core/Hooks.php -s\n\nFILE: /footmate.pro/wp-content/themes/footmate/app/Core/Hooks.php\n----------------------------------------------------------------------------------------------------------------------\nFOUND 1 ERROR AFFECTING 1 LINE\n----------------------------------------------------------------------------------------------------------------------\n 7 | ERROR | [x] Opening brace should be on a new line (Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine)\n----------------------------------------------------------------------------------------------------------------------\n",[185,543],[11098],{"type":40,"tag":189,"props":11099,"children":11100},{"__ignoreMap":7},[11101,11110,11117,11124,11131,11138,11145,11154],{"type":40,"tag":193,"props":11102,"children":11104},{"class":11103,"line":185},[196,197],[11105],{"type":40,"tag":193,"props":11106,"children":11107},{"style":207},[11108],{"type":51,"value":11109},"vendor/bin/phpcs app/Core/Hooks.php -s\n",{"type":40,"tag":193,"props":11111,"children":11112},{"class":196,"line":213},[11113],{"type":40,"tag":193,"props":11114,"children":11115},{"emptyLinePlaceholder":35},[11116],{"type":51,"value":626},{"type":40,"tag":193,"props":11118,"children":11119},{"class":196,"line":233},[11120],{"type":40,"tag":193,"props":11121,"children":11122},{"style":207},[11123],{"type":51,"value":7697},{"type":40,"tag":193,"props":11125,"children":11126},{"class":196,"line":446},[11127],{"type":40,"tag":193,"props":11128,"children":11129},{"style":201},[11130],{"type":51,"value":9877},{"type":40,"tag":193,"props":11132,"children":11133},{"class":196,"line":477},[11134],{"type":40,"tag":193,"props":11135,"children":11136},{"style":207},[11137],{"type":51,"value":7713},{"type":40,"tag":193,"props":11139,"children":11140},{"class":196,"line":507},[11141],{"type":40,"tag":193,"props":11142,"children":11143},{"style":201},[11144],{"type":51,"value":9877},{"type":40,"tag":193,"props":11146,"children":11148},{"class":11147,"line":543},[196,197],[11149],{"type":40,"tag":193,"props":11150,"children":11151},{"style":207},[11152],{"type":51,"value":11153}," 7 | ERROR | [x] Opening brace should be on a new line (Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine)\n",{"type":40,"tag":193,"props":11155,"children":11156},{"class":196,"line":582},[11157],{"type":40,"tag":193,"props":11158,"children":11159},{"style":201},[11160],{"type":51,"value":9877},{"type":40,"tag":47,"props":11162,"children":11163},{},[11164,11166,11172,11174,11180,11182,11187,11189,11194,11196,11201],{"type":51,"value":11165},"This specific rule has an ",{"type":40,"tag":189,"props":11167,"children":11169},{"className":11168},[],[11170],{"type":51,"value":11171},"Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine",{"type":51,"value":11173}," identifier, so we can take it and set it in the ",{"type":40,"tag":189,"props":11175,"children":11177},{"className":11176},[],[11178],{"type":51,"value":11179},"name",{"type":51,"value":11181}," attribute of the ",{"type":40,"tag":189,"props":11183,"children":11185},{"className":11184},[],[11186],{"type":51,"value":10387},{"type":51,"value":11188}," tag within the ruleset that implements this rule. Please notice that we added ",{"type":40,"tag":189,"props":11190,"children":11192},{"className":11191},[],[11193],{"type":51,"value":11084},{"type":51,"value":11195}," argument too! Now, when we lint the files with ",{"type":40,"tag":189,"props":11197,"children":11199},{"className":11198},[],[11200],{"type":51,"value":8384},{"type":51,"value":11202},", we won't see this problem anymore.",{"type":40,"tag":179,"props":11204,"children":11207},{"className":10318,"code":11205,"highlights":11206,"language":10321,"meta":7,"style":7},"\u003C?xml version=\"1.0\"?>\n\n\u003Cruleset name=\"pragmatedev\">\n  \u003Carg name=\"colors\" />\n  \u003Carg value=\"s\" />\n\n  \u003Cfile>app\u003C/file>\n\n  \u003Crule ref=\"PSR12\">\n    \u003Cexclude name=\"Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine\" />\n  \u003C/rule>\n\u003C/ruleset>\n",[477,294],[11208],{"type":40,"tag":189,"props":11209,"children":11210},{"__ignoreMap":7},[11211,11238,11245,11272,11299,11329,11336,11359,11366,11393,11422,11437],{"type":40,"tag":193,"props":11212,"children":11213},{"class":196,"line":185},[11214,11218,11222,11226,11230,11234],{"type":40,"tag":193,"props":11215,"children":11216},{"style":207},[11217],{"type":51,"value":10663},{"type":40,"tag":193,"props":11219,"children":11220},{"style":201},[11221],{"type":51,"value":10321},{"type":40,"tag":193,"props":11223,"children":11224},{"style":222},[11225],{"type":51,"value":10672},{"type":40,"tag":193,"props":11227,"children":11228},{"style":207},[11229],{"type":51,"value":8178},{"type":40,"tag":193,"props":11231,"children":11232},{"style":279},[11233],{"type":51,"value":10681},{"type":40,"tag":193,"props":11235,"children":11236},{"style":207},[11237],{"type":51,"value":10686},{"type":40,"tag":193,"props":11239,"children":11240},{"class":196,"line":213},[11241],{"type":40,"tag":193,"props":11242,"children":11243},{"emptyLinePlaceholder":35},[11244],{"type":51,"value":626},{"type":40,"tag":193,"props":11246,"children":11247},{"class":196,"line":233},[11248,11252,11256,11260,11264,11268],{"type":40,"tag":193,"props":11249,"children":11250},{"style":207},[11251],{"type":51,"value":10333},{"type":40,"tag":193,"props":11253,"children":11254},{"style":201},[11255],{"type":51,"value":10338},{"type":40,"tag":193,"props":11257,"children":11258},{"style":222},[11259],{"type":51,"value":10392},{"type":40,"tag":193,"props":11261,"children":11262},{"style":207},[11263],{"type":51,"value":8178},{"type":40,"tag":193,"props":11265,"children":11266},{"style":279},[11267],{"type":51,"value":10717},{"type":40,"tag":193,"props":11269,"children":11270},{"style":207},[11271],{"type":51,"value":10343},{"type":40,"tag":193,"props":11273,"children":11274},{"class":196,"line":446},[11275,11279,11283,11287,11291,11295],{"type":40,"tag":193,"props":11276,"children":11277},{"style":207},[11278],{"type":51,"value":10351},{"type":40,"tag":193,"props":11280,"children":11281},{"style":201},[11282],{"type":51,"value":10733},{"type":40,"tag":193,"props":11284,"children":11285},{"style":222},[11286],{"type":51,"value":10392},{"type":40,"tag":193,"props":11288,"children":11289},{"style":207},[11290],{"type":51,"value":8178},{"type":40,"tag":193,"props":11292,"children":11293},{"style":279},[11294],{"type":51,"value":10746},{"type":40,"tag":193,"props":11296,"children":11297},{"style":207},[11298],{"type":51,"value":10406},{"type":40,"tag":193,"props":11300,"children":11302},{"class":11301,"line":477},[196,197],[11303,11307,11311,11316,11320,11325],{"type":40,"tag":193,"props":11304,"children":11305},{"style":207},[11306],{"type":51,"value":10351},{"type":40,"tag":193,"props":11308,"children":11309},{"style":201},[11310],{"type":51,"value":10733},{"type":40,"tag":193,"props":11312,"children":11313},{"style":222},[11314],{"type":51,"value":11315}," value",{"type":40,"tag":193,"props":11317,"children":11318},{"style":207},[11319],{"type":51,"value":8178},{"type":40,"tag":193,"props":11321,"children":11322},{"style":279},[11323],{"type":51,"value":11324},"\"s\"",{"type":40,"tag":193,"props":11326,"children":11327},{"style":207},[11328],{"type":51,"value":10406},{"type":40,"tag":193,"props":11330,"children":11331},{"class":196,"line":507},[11332],{"type":40,"tag":193,"props":11333,"children":11334},{"emptyLinePlaceholder":35},[11335],{"type":51,"value":626},{"type":40,"tag":193,"props":11337,"children":11338},{"class":196,"line":543},[11339,11343,11347,11351,11355],{"type":40,"tag":193,"props":11340,"children":11341},{"style":207},[11342],{"type":51,"value":10351},{"type":40,"tag":193,"props":11344,"children":11345},{"style":201},[11346],{"type":51,"value":1114},{"type":40,"tag":193,"props":11348,"children":11349},{"style":207},[11350],{"type":51,"value":10773},{"type":40,"tag":193,"props":11352,"children":11353},{"style":201},[11354],{"type":51,"value":1114},{"type":40,"tag":193,"props":11356,"children":11357},{"style":207},[11358],{"type":51,"value":10343},{"type":40,"tag":193,"props":11360,"children":11361},{"class":196,"line":582},[11362],{"type":40,"tag":193,"props":11363,"children":11364},{"emptyLinePlaceholder":35},[11365],{"type":51,"value":626},{"type":40,"tag":193,"props":11367,"children":11368},{"class":196,"line":620},[11369,11373,11377,11381,11385,11389],{"type":40,"tag":193,"props":11370,"children":11371},{"style":207},[11372],{"type":51,"value":10351},{"type":40,"tag":193,"props":11374,"children":11375},{"style":201},[11376],{"type":51,"value":10356},{"type":40,"tag":193,"props":11378,"children":11379},{"style":222},[11380],{"type":51,"value":10361},{"type":40,"tag":193,"props":11382,"children":11383},{"style":207},[11384],{"type":51,"value":8178},{"type":40,"tag":193,"props":11386,"children":11387},{"style":279},[11388],{"type":51,"value":10812},{"type":40,"tag":193,"props":11390,"children":11391},{"style":207},[11392],{"type":51,"value":10343},{"type":40,"tag":193,"props":11394,"children":11396},{"class":11395,"line":294},[196,197],[11397,11401,11405,11409,11413,11418],{"type":40,"tag":193,"props":11398,"children":11399},{"style":207},[11400],{"type":51,"value":10382},{"type":40,"tag":193,"props":11402,"children":11403},{"style":201},[11404],{"type":51,"value":10387},{"type":40,"tag":193,"props":11406,"children":11407},{"style":222},[11408],{"type":51,"value":10392},{"type":40,"tag":193,"props":11410,"children":11411},{"style":207},[11412],{"type":51,"value":8178},{"type":40,"tag":193,"props":11414,"children":11415},{"style":279},[11416],{"type":51,"value":11417},"\"Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine\"",{"type":40,"tag":193,"props":11419,"children":11420},{"style":207},[11421],{"type":51,"value":10406},{"type":40,"tag":193,"props":11423,"children":11424},{"class":196,"line":660},[11425,11429,11433],{"type":40,"tag":193,"props":11426,"children":11427},{"style":207},[11428],{"type":51,"value":10414},{"type":40,"tag":193,"props":11430,"children":11431},{"style":201},[11432],{"type":51,"value":10356},{"type":40,"tag":193,"props":11434,"children":11435},{"style":207},[11436],{"type":51,"value":10343},{"type":40,"tag":193,"props":11438,"children":11439},{"class":196,"line":668},[11440,11444,11448],{"type":40,"tag":193,"props":11441,"children":11442},{"style":207},[11443],{"type":51,"value":10430},{"type":40,"tag":193,"props":11445,"children":11446},{"style":201},[11447],{"type":51,"value":10338},{"type":40,"tag":193,"props":11449,"children":11450},{"style":207},[11451],{"type":51,"value":10343},{"type":40,"tag":47,"props":11453,"children":11454},{},[11455,11457,11462,11464,11470],{"type":51,"value":11456},"This change opens up freedom in braces placement across the codebase. The users can put them as they wish now, without any consistency which seems to be risky. ",{"type":40,"tag":95,"props":11458,"children":11459},{},[11460],{"type":51,"value":11461},"The code should be consistent as much as possible!",{"type":51,"value":11463}," So if we don't want to put them in the new line, we should allow putting it only in the same line. Let's define it to our ruleset. It can be done by including the ",{"type":40,"tag":189,"props":11465,"children":11467},{"className":11466},[],[11468],{"type":51,"value":11469},"Generic.Functions.OpeningFunctionBraceKernighanRitchie",{"type":51,"value":11471}," rule.",{"type":40,"tag":174,"props":11473,"children":11475},{":tabs":11474},"[\"phpcs.dist.xml\", \"Results\"]",[11476,11757],{"type":40,"tag":179,"props":11477,"children":11481},{"className":10318,"code":11478,"filename":11479,"highlights":11480,"language":10321,"meta":7,"style":7},"\u003C?xml version=\"1.0\"?>\n\n\u003Cruleset name=\"pragmatedev\">\n  \u003Carg name=\"colors\" />\n  \u003Carg value=\"s\" />\n\n  \u003Cfile>app\u003C/file>\n\n  \u003Crule ref=\"PSR12\">\n    \u003Cexclude name=\"Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine\" />\n  \u003C/rule>\n\n  \u003Crule ref=\"Generic.Functions.OpeningFunctionBraceKernighanRitchie\" />\n\u003C/ruleset>\n","phpcs.dist.xml",[961],[11482],{"type":40,"tag":189,"props":11483,"children":11484},{"__ignoreMap":7},[11485,11512,11519,11546,11573,11600,11607,11630,11637,11664,11691,11706,11713,11742],{"type":40,"tag":193,"props":11486,"children":11487},{"class":196,"line":185},[11488,11492,11496,11500,11504,11508],{"type":40,"tag":193,"props":11489,"children":11490},{"style":207},[11491],{"type":51,"value":10663},{"type":40,"tag":193,"props":11493,"children":11494},{"style":201},[11495],{"type":51,"value":10321},{"type":40,"tag":193,"props":11497,"children":11498},{"style":222},[11499],{"type":51,"value":10672},{"type":40,"tag":193,"props":11501,"children":11502},{"style":207},[11503],{"type":51,"value":8178},{"type":40,"tag":193,"props":11505,"children":11506},{"style":279},[11507],{"type":51,"value":10681},{"type":40,"tag":193,"props":11509,"children":11510},{"style":207},[11511],{"type":51,"value":10686},{"type":40,"tag":193,"props":11513,"children":11514},{"class":196,"line":213},[11515],{"type":40,"tag":193,"props":11516,"children":11517},{"emptyLinePlaceholder":35},[11518],{"type":51,"value":626},{"type":40,"tag":193,"props":11520,"children":11521},{"class":196,"line":233},[11522,11526,11530,11534,11538,11542],{"type":40,"tag":193,"props":11523,"children":11524},{"style":207},[11525],{"type":51,"value":10333},{"type":40,"tag":193,"props":11527,"children":11528},{"style":201},[11529],{"type":51,"value":10338},{"type":40,"tag":193,"props":11531,"children":11532},{"style":222},[11533],{"type":51,"value":10392},{"type":40,"tag":193,"props":11535,"children":11536},{"style":207},[11537],{"type":51,"value":8178},{"type":40,"tag":193,"props":11539,"children":11540},{"style":279},[11541],{"type":51,"value":10717},{"type":40,"tag":193,"props":11543,"children":11544},{"style":207},[11545],{"type":51,"value":10343},{"type":40,"tag":193,"props":11547,"children":11548},{"class":196,"line":446},[11549,11553,11557,11561,11565,11569],{"type":40,"tag":193,"props":11550,"children":11551},{"style":207},[11552],{"type":51,"value":10351},{"type":40,"tag":193,"props":11554,"children":11555},{"style":201},[11556],{"type":51,"value":10733},{"type":40,"tag":193,"props":11558,"children":11559},{"style":222},[11560],{"type":51,"value":10392},{"type":40,"tag":193,"props":11562,"children":11563},{"style":207},[11564],{"type":51,"value":8178},{"type":40,"tag":193,"props":11566,"children":11567},{"style":279},[11568],{"type":51,"value":10746},{"type":40,"tag":193,"props":11570,"children":11571},{"style":207},[11572],{"type":51,"value":10406},{"type":40,"tag":193,"props":11574,"children":11575},{"class":196,"line":477},[11576,11580,11584,11588,11592,11596],{"type":40,"tag":193,"props":11577,"children":11578},{"style":207},[11579],{"type":51,"value":10351},{"type":40,"tag":193,"props":11581,"children":11582},{"style":201},[11583],{"type":51,"value":10733},{"type":40,"tag":193,"props":11585,"children":11586},{"style":222},[11587],{"type":51,"value":11315},{"type":40,"tag":193,"props":11589,"children":11590},{"style":207},[11591],{"type":51,"value":8178},{"type":40,"tag":193,"props":11593,"children":11594},{"style":279},[11595],{"type":51,"value":11324},{"type":40,"tag":193,"props":11597,"children":11598},{"style":207},[11599],{"type":51,"value":10406},{"type":40,"tag":193,"props":11601,"children":11602},{"class":196,"line":507},[11603],{"type":40,"tag":193,"props":11604,"children":11605},{"emptyLinePlaceholder":35},[11606],{"type":51,"value":626},{"type":40,"tag":193,"props":11608,"children":11609},{"class":196,"line":543},[11610,11614,11618,11622,11626],{"type":40,"tag":193,"props":11611,"children":11612},{"style":207},[11613],{"type":51,"value":10351},{"type":40,"tag":193,"props":11615,"children":11616},{"style":201},[11617],{"type":51,"value":1114},{"type":40,"tag":193,"props":11619,"children":11620},{"style":207},[11621],{"type":51,"value":10773},{"type":40,"tag":193,"props":11623,"children":11624},{"style":201},[11625],{"type":51,"value":1114},{"type":40,"tag":193,"props":11627,"children":11628},{"style":207},[11629],{"type":51,"value":10343},{"type":40,"tag":193,"props":11631,"children":11632},{"class":196,"line":582},[11633],{"type":40,"tag":193,"props":11634,"children":11635},{"emptyLinePlaceholder":35},[11636],{"type":51,"value":626},{"type":40,"tag":193,"props":11638,"children":11639},{"class":196,"line":620},[11640,11644,11648,11652,11656,11660],{"type":40,"tag":193,"props":11641,"children":11642},{"style":207},[11643],{"type":51,"value":10351},{"type":40,"tag":193,"props":11645,"children":11646},{"style":201},[11647],{"type":51,"value":10356},{"type":40,"tag":193,"props":11649,"children":11650},{"style":222},[11651],{"type":51,"value":10361},{"type":40,"tag":193,"props":11653,"children":11654},{"style":207},[11655],{"type":51,"value":8178},{"type":40,"tag":193,"props":11657,"children":11658},{"style":279},[11659],{"type":51,"value":10812},{"type":40,"tag":193,"props":11661,"children":11662},{"style":207},[11663],{"type":51,"value":10343},{"type":40,"tag":193,"props":11665,"children":11666},{"class":196,"line":294},[11667,11671,11675,11679,11683,11687],{"type":40,"tag":193,"props":11668,"children":11669},{"style":207},[11670],{"type":51,"value":10382},{"type":40,"tag":193,"props":11672,"children":11673},{"style":201},[11674],{"type":51,"value":10387},{"type":40,"tag":193,"props":11676,"children":11677},{"style":222},[11678],{"type":51,"value":10392},{"type":40,"tag":193,"props":11680,"children":11681},{"style":207},[11682],{"type":51,"value":8178},{"type":40,"tag":193,"props":11684,"children":11685},{"style":279},[11686],{"type":51,"value":11417},{"type":40,"tag":193,"props":11688,"children":11689},{"style":207},[11690],{"type":51,"value":10406},{"type":40,"tag":193,"props":11692,"children":11693},{"class":196,"line":660},[11694,11698,11702],{"type":40,"tag":193,"props":11695,"children":11696},{"style":207},[11697],{"type":51,"value":10414},{"type":40,"tag":193,"props":11699,"children":11700},{"style":201},[11701],{"type":51,"value":10356},{"type":40,"tag":193,"props":11703,"children":11704},{"style":207},[11705],{"type":51,"value":10343},{"type":40,"tag":193,"props":11707,"children":11708},{"class":196,"line":668},[11709],{"type":40,"tag":193,"props":11710,"children":11711},{"emptyLinePlaceholder":35},[11712],{"type":51,"value":626},{"type":40,"tag":193,"props":11714,"children":11716},{"class":11715,"line":961},[196,197],[11717,11721,11725,11729,11733,11738],{"type":40,"tag":193,"props":11718,"children":11719},{"style":207},[11720],{"type":51,"value":10351},{"type":40,"tag":193,"props":11722,"children":11723},{"style":201},[11724],{"type":51,"value":10356},{"type":40,"tag":193,"props":11726,"children":11727},{"style":222},[11728],{"type":51,"value":10361},{"type":40,"tag":193,"props":11730,"children":11731},{"style":207},[11732],{"type":51,"value":8178},{"type":40,"tag":193,"props":11734,"children":11735},{"style":279},[11736],{"type":51,"value":11737},"\"Generic.Functions.OpeningFunctionBraceKernighanRitchie\"",{"type":40,"tag":193,"props":11739,"children":11740},{"style":207},[11741],{"type":51,"value":10406},{"type":40,"tag":193,"props":11743,"children":11744},{"class":196,"line":2115},[11745,11749,11753],{"type":40,"tag":193,"props":11746,"children":11747},{"style":207},[11748],{"type":51,"value":10430},{"type":40,"tag":193,"props":11750,"children":11751},{"style":201},[11752],{"type":51,"value":10338},{"type":40,"tag":193,"props":11754,"children":11755},{"style":207},[11756],{"type":51,"value":10343},{"type":40,"tag":179,"props":11758,"children":11761},{"className":3474,"code":11759,"filename":11760,"language":3478,"meta":7,"style":7},"vendor/bin/phpcs\n\nFILE: /footmate.pro/wp-content/themes/footmate/app/Posts/Posts.php\n------------------------------------------------------------------------------------------\nFOUND 1 ERROR AFFECTING 1 LINE\n------------------------------------------------------------------------------------------\n11 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n------------------------------------------------------------------------------------------\nPHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n------------------------------------------------------------------------------------------\n\n\nFILE: /footmate.pro/wp-content/themes/footmate/app/App.php\n------------------------------------------------------------------------------------------\nFOUND 13 ERRORS AFFECTING 13 LINES\n------------------------------------------------------------------------------------------\n 36 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n 48 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n 53 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n 58 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n 63 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n 68 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n 73 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n 78 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n 83 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n 88 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n 92 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n 97 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n106 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n------------------------------------------------------------------------------------------\nPHPCBF CAN FIX THE 13 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n------------------------------------------------------------------------------------------\n\n\nFILE: /footmate.pro/wp-content/themes/footmate/app/Core/Widgets.php\n------------------------------------------------------------------------------------------\nFOUND 1 ERROR AFFECTING 1 LINE\n------------------------------------------------------------------------------------------\n11 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n------------------------------------------------------------------------------------------\nPHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n------------------------------------------------------------------------------------------\n\n\nFILE: /footmate.pro/wp-content/themes/footmate/app/Core/Hooks.php\n------------------------------------------------------------------------------------------\nFOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES\n------------------------------------------------------------------------------------------\n 1 | ERROR   | [x] Header blocks must be separated by a single blank line (PSR12.Files.FileHeader.SpacingAfterBlock)\n 6 | WARNING | [ ] Line exceeds 120 characters; contains 122 characters (Generic.Files.LineLength.TooLong)\n 8 | ERROR   | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n17 | ERROR   | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n23 | ERROR   | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n------------------------------------------------------------------------------------------\nPHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n------------------------------------------------------------------------------------------\n\n\nFILE: /footmate.pro/wp-content/themes/footmate/app/Core/Config.php\n------------------------------------------------------------------------------------------\nFOUND 4 ERRORS AFFECTING 4 LINES\n------------------------------------------------------------------------------------------\n10 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n38 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n53 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n58 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n------------------------------------------------------------------------------------------\nPHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n------------------------------------------------------------------------------------------\n\n\nFILE: /footmate.pro/wp-content/themes/footmate/app/Integrations/Vite.php\n------------------------------------------------------------------------------------------\nFOUND 4 ERRORS AFFECTING 4 LINES\n------------------------------------------------------------------------------------------\n 1 | ERROR | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n11 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n14 | ERROR | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n19 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n------------------------------------------------------------------------------------------\nPHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n------------------------------------------------------------------------------------------\n\n\nFILE: /footmate.pro/wp-content/themes/footmate/app/Integrations/Integrations.php\n------------------------------------------------------------------------------------------\nFOUND 2 ERRORS AFFECTING 2 LINES\n------------------------------------------------------------------------------------------\n16 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n25 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n------------------------------------------------------------------------------------------\nPHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n------------------------------------------------------------------------------------------\n\n\nFILE: /footmate.pro/wp-content/themes/footmate/app/Integrations/ESPN.php\n------------------------------------------------------------------------------------------\nFOUND 3 ERRORS AFFECTING 3 LINES\n------------------------------------------------------------------------------------------\n 1 | ERROR | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n13 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n26 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n------------------------------------------------------------------------------------------\nPHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n------------------------------------------------------------------------------------------\n\n\nFILE: /footmate.pro/wp-content/themes/footmate/app/Teams/Teams.php\n------------------------------------------------------------------------------------------\nFOUND 1 ERROR AFFECTING 1 LINE\n------------------------------------------------------------------------------------------\n11 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n------------------------------------------------------------------------------------------\nPHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n------------------------------------------------------------------------------------------\n\n\nFILE: /footmate.pro/wp-content/themes/footmate/app/Templates/Resolver.php\n------------------------------------------------------------------------------------------\nFOUND 5 ERRORS AND 1 WARNING AFFECTING 6 LINES\n------------------------------------------------------------------------------------------\n 1 | ERROR   | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n26 | ERROR   | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n30 | ERROR   | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n36 | WARNING | [ ] Line exceeds 120 characters; contains 121 characters (Generic.Files.LineLength.TooLong)\n45 | ERROR   | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n49 | ERROR   | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n------------------------------------------------------------------------------------------\nPHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n------------------------------------------------------------------------------------------\n\n\nFILE: /footmate.pro/wp-content/themes/footmate/app/Templates/Templates.php\n------------------------------------------------------------------------------------------\nFOUND 4 ERRORS AFFECTING 4 LINES\n------------------------------------------------------------------------------------------\n 1 | ERROR | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n15 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n21 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n26 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n------------------------------------------------------------------------------------------\nPHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n------------------------------------------------------------------------------------------\n\n\nFILE: /footmate.pro/wp-content/themes/footmate/app/Templates/Provider.php\n------------------------------------------------------------------------------------------\nFOUND 10 ERRORS AFFECTING 9 LINES\n------------------------------------------------------------------------------------------\n 1 | ERROR | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n17 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n22 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n22 | ERROR | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n27 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n28 | ERROR | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n29 | ERROR | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n32 | ERROR | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n34 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n39 | ERROR | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n------------------------------------------------------------------------------------------\nPHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n------------------------------------------------------------------------------------------\n\n\nFILE: /footmate.pro/wp-content/themes/footmate/app/Assets/Resolver.php\n------------------------------------------------------------------------------------------\nFOUND 4 ERRORS AFFECTING 4 LINES\n------------------------------------------------------------------------------------------\n 1 | ERROR | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n13 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n27 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n36 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n------------------------------------------------------------------------------------------\nPHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n------------------------------------------------------------------------------------------\n\n\nFILE: /footmate.pro/wp-content/themes/footmate/app/Assets/Assets.php\n------------------------------------------------------------------------------------------\nFOUND 2 ERRORS AFFECTING 2 LINES\n------------------------------------------------------------------------------------------\n 1 | ERROR | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n15 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n------------------------------------------------------------------------------------------\nPHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n------------------------------------------------------------------------------------------\n","Results",[11762],{"type":40,"tag":189,"props":11763,"children":11764},{"__ignoreMap":7},[11765,11772,11779,11787,11795,11802,11809,11817,11824,11832,11839,11846,11853,11861,11868,11876,11883,11891,11899,11907,11915,11923,11931,11939,11947,11955,11963,11971,11979,11987,11994,12002,12009,12017,12025,12034,12042,12050,12058,12066,12074,12082,12090,12098,12106,12114,12122,12131,12139,12148,12157,12166,12175,12184,12192,12200,12208,12216,12224,12233,12241,12250,12258,12267,12276,12285,12294,12302,12310,12318,12326,12334,12343,12351,12359,12366,12375,12383,12392,12401,12409,12417,12425,12433,12441,12450,12458,12467,12475,12484,12493,12501,12509,12517,12525,12533,12542,12550,12559,12567,12575,12584,12593,12601,12610,12618,12626,12634,12643,12651,12659,12667,12675,12683,12691,12699,12707,12715,12724,12732,12741,12749,12758,12767,12776,12785,12794,12803,12811,12820,12828,12836,12844,12853,12861,12869,12877,12885,12894,12903,12911,12919,12927,12935,12943,12951,12960,12968,12977,12985,12993,13002,13011,13020,13029,13038,13047,13056,13065,13074,13082,13091,13099,13107,13115,13124,13132,13140,13148,13156,13164,13172,13181,13189,13197,13205,13213,13221,13230,13238,13246,13254,13262,13270,13278,13286],{"type":40,"tag":193,"props":11766,"children":11767},{"class":196,"line":185},[11768],{"type":40,"tag":193,"props":11769,"children":11770},{"style":207},[11771],{"type":51,"value":10846},{"type":40,"tag":193,"props":11773,"children":11774},{"class":196,"line":213},[11775],{"type":40,"tag":193,"props":11776,"children":11777},{"emptyLinePlaceholder":35},[11778],{"type":51,"value":626},{"type":40,"tag":193,"props":11780,"children":11781},{"class":196,"line":233},[11782],{"type":40,"tag":193,"props":11783,"children":11784},{"style":207},[11785],{"type":51,"value":11786},"FILE: /footmate.pro/wp-content/themes/footmate/app/Posts/Posts.php\n",{"type":40,"tag":193,"props":11788,"children":11789},{"class":196,"line":446},[11790],{"type":40,"tag":193,"props":11791,"children":11792},{"style":201},[11793],{"type":51,"value":11794},"------------------------------------------------------------------------------------------\n",{"type":40,"tag":193,"props":11796,"children":11797},{"class":196,"line":477},[11798],{"type":40,"tag":193,"props":11799,"children":11800},{"style":207},[11801],{"type":51,"value":7713},{"type":40,"tag":193,"props":11803,"children":11804},{"class":196,"line":507},[11805],{"type":40,"tag":193,"props":11806,"children":11807},{"style":201},[11808],{"type":51,"value":11794},{"type":40,"tag":193,"props":11810,"children":11811},{"class":196,"line":543},[11812],{"type":40,"tag":193,"props":11813,"children":11814},{"style":207},[11815],{"type":51,"value":11816},"11 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":11818,"children":11819},{"class":196,"line":582},[11820],{"type":40,"tag":193,"props":11821,"children":11822},{"style":201},[11823],{"type":51,"value":11794},{"type":40,"tag":193,"props":11825,"children":11826},{"class":196,"line":620},[11827],{"type":40,"tag":193,"props":11828,"children":11829},{"style":207},[11830],{"type":51,"value":11831},"PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n",{"type":40,"tag":193,"props":11833,"children":11834},{"class":196,"line":294},[11835],{"type":40,"tag":193,"props":11836,"children":11837},{"style":201},[11838],{"type":51,"value":11794},{"type":40,"tag":193,"props":11840,"children":11841},{"class":196,"line":660},[11842],{"type":40,"tag":193,"props":11843,"children":11844},{"emptyLinePlaceholder":35},[11845],{"type":51,"value":626},{"type":40,"tag":193,"props":11847,"children":11848},{"class":196,"line":668},[11849],{"type":40,"tag":193,"props":11850,"children":11851},{"emptyLinePlaceholder":35},[11852],{"type":51,"value":626},{"type":40,"tag":193,"props":11854,"children":11855},{"class":196,"line":961},[11856],{"type":40,"tag":193,"props":11857,"children":11858},{"style":207},[11859],{"type":51,"value":11860},"FILE: /footmate.pro/wp-content/themes/footmate/app/App.php\n",{"type":40,"tag":193,"props":11862,"children":11863},{"class":196,"line":2115},[11864],{"type":40,"tag":193,"props":11865,"children":11866},{"style":201},[11867],{"type":51,"value":11794},{"type":40,"tag":193,"props":11869,"children":11870},{"class":196,"line":2124},[11871],{"type":40,"tag":193,"props":11872,"children":11873},{"style":207},[11874],{"type":51,"value":11875},"FOUND 13 ERRORS AFFECTING 13 LINES\n",{"type":40,"tag":193,"props":11877,"children":11878},{"class":196,"line":8601},[11879],{"type":40,"tag":193,"props":11880,"children":11881},{"style":201},[11882],{"type":51,"value":11794},{"type":40,"tag":193,"props":11884,"children":11885},{"class":196,"line":8659},[11886],{"type":40,"tag":193,"props":11887,"children":11888},{"style":207},[11889],{"type":51,"value":11890}," 36 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":11892,"children":11893},{"class":196,"line":8717},[11894],{"type":40,"tag":193,"props":11895,"children":11896},{"style":207},[11897],{"type":51,"value":11898}," 48 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":11900,"children":11901},{"class":196,"line":8765},[11902],{"type":40,"tag":193,"props":11903,"children":11904},{"style":207},[11905],{"type":51,"value":11906}," 53 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":11908,"children":11909},{"class":196,"line":8773},[11910],{"type":40,"tag":193,"props":11911,"children":11912},{"style":207},[11913],{"type":51,"value":11914}," 58 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":11916,"children":11917},{"class":196,"line":8798},[11918],{"type":40,"tag":193,"props":11919,"children":11920},{"style":207},[11921],{"type":51,"value":11922}," 63 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":11924,"children":11925},{"class":196,"line":8842},[11926],{"type":40,"tag":193,"props":11927,"children":11928},{"style":207},[11929],{"type":51,"value":11930}," 68 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":11932,"children":11933},{"class":196,"line":8896},[11934],{"type":40,"tag":193,"props":11935,"children":11936},{"style":207},[11937],{"type":51,"value":11938}," 73 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":11940,"children":11941},{"class":196,"line":8929},[11942],{"type":40,"tag":193,"props":11943,"children":11944},{"style":207},[11945],{"type":51,"value":11946}," 78 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":11948,"children":11949},{"class":196,"line":8938},[11950],{"type":40,"tag":193,"props":11951,"children":11952},{"style":207},[11953],{"type":51,"value":11954}," 83 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":11956,"children":11957},{"class":196,"line":8947},[11958],{"type":40,"tag":193,"props":11959,"children":11960},{"style":207},[11961],{"type":51,"value":11962}," 88 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":11964,"children":11965},{"class":196,"line":8955},[11966],{"type":40,"tag":193,"props":11967,"children":11968},{"style":207},[11969],{"type":51,"value":11970}," 92 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":11972,"children":11973},{"class":196,"line":9009},[11974],{"type":40,"tag":193,"props":11975,"children":11976},{"style":207},[11977],{"type":51,"value":11978}," 97 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":11980,"children":11981},{"class":196,"line":9062},[11982],{"type":40,"tag":193,"props":11983,"children":11984},{"style":207},[11985],{"type":51,"value":11986},"106 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":11988,"children":11989},{"class":196,"line":9111},[11990],{"type":40,"tag":193,"props":11991,"children":11992},{"style":201},[11993],{"type":51,"value":11794},{"type":40,"tag":193,"props":11995,"children":11996},{"class":196,"line":9160},[11997],{"type":40,"tag":193,"props":11998,"children":11999},{"style":207},[12000],{"type":51,"value":12001},"PHPCBF CAN FIX THE 13 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n",{"type":40,"tag":193,"props":12003,"children":12004},{"class":196,"line":9168},[12005],{"type":40,"tag":193,"props":12006,"children":12007},{"style":201},[12008],{"type":51,"value":11794},{"type":40,"tag":193,"props":12010,"children":12012},{"class":196,"line":12011},33,[12013],{"type":40,"tag":193,"props":12014,"children":12015},{"emptyLinePlaceholder":35},[12016],{"type":51,"value":626},{"type":40,"tag":193,"props":12018,"children":12020},{"class":196,"line":12019},34,[12021],{"type":40,"tag":193,"props":12022,"children":12023},{"emptyLinePlaceholder":35},[12024],{"type":51,"value":626},{"type":40,"tag":193,"props":12026,"children":12028},{"class":196,"line":12027},35,[12029],{"type":40,"tag":193,"props":12030,"children":12031},{"style":207},[12032],{"type":51,"value":12033},"FILE: /footmate.pro/wp-content/themes/footmate/app/Core/Widgets.php\n",{"type":40,"tag":193,"props":12035,"children":12037},{"class":196,"line":12036},36,[12038],{"type":40,"tag":193,"props":12039,"children":12040},{"style":201},[12041],{"type":51,"value":11794},{"type":40,"tag":193,"props":12043,"children":12045},{"class":196,"line":12044},37,[12046],{"type":40,"tag":193,"props":12047,"children":12048},{"style":207},[12049],{"type":51,"value":7713},{"type":40,"tag":193,"props":12051,"children":12053},{"class":196,"line":12052},38,[12054],{"type":40,"tag":193,"props":12055,"children":12056},{"style":201},[12057],{"type":51,"value":11794},{"type":40,"tag":193,"props":12059,"children":12061},{"class":196,"line":12060},39,[12062],{"type":40,"tag":193,"props":12063,"children":12064},{"style":207},[12065],{"type":51,"value":11816},{"type":40,"tag":193,"props":12067,"children":12069},{"class":196,"line":12068},40,[12070],{"type":40,"tag":193,"props":12071,"children":12072},{"style":201},[12073],{"type":51,"value":11794},{"type":40,"tag":193,"props":12075,"children":12077},{"class":196,"line":12076},41,[12078],{"type":40,"tag":193,"props":12079,"children":12080},{"style":207},[12081],{"type":51,"value":11831},{"type":40,"tag":193,"props":12083,"children":12085},{"class":196,"line":12084},42,[12086],{"type":40,"tag":193,"props":12087,"children":12088},{"style":201},[12089],{"type":51,"value":11794},{"type":40,"tag":193,"props":12091,"children":12093},{"class":196,"line":12092},43,[12094],{"type":40,"tag":193,"props":12095,"children":12096},{"emptyLinePlaceholder":35},[12097],{"type":51,"value":626},{"type":40,"tag":193,"props":12099,"children":12101},{"class":196,"line":12100},44,[12102],{"type":40,"tag":193,"props":12103,"children":12104},{"emptyLinePlaceholder":35},[12105],{"type":51,"value":626},{"type":40,"tag":193,"props":12107,"children":12109},{"class":196,"line":12108},45,[12110],{"type":40,"tag":193,"props":12111,"children":12112},{"style":207},[12113],{"type":51,"value":7697},{"type":40,"tag":193,"props":12115,"children":12117},{"class":196,"line":12116},46,[12118],{"type":40,"tag":193,"props":12119,"children":12120},{"style":201},[12121],{"type":51,"value":11794},{"type":40,"tag":193,"props":12123,"children":12125},{"class":196,"line":12124},47,[12126],{"type":40,"tag":193,"props":12127,"children":12128},{"style":207},[12129],{"type":51,"value":12130},"FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES\n",{"type":40,"tag":193,"props":12132,"children":12134},{"class":196,"line":12133},48,[12135],{"type":40,"tag":193,"props":12136,"children":12137},{"style":201},[12138],{"type":51,"value":11794},{"type":40,"tag":193,"props":12140,"children":12142},{"class":196,"line":12141},49,[12143],{"type":40,"tag":193,"props":12144,"children":12145},{"style":207},[12146],{"type":51,"value":12147}," 1 | ERROR   | [x] Header blocks must be separated by a single blank line (PSR12.Files.FileHeader.SpacingAfterBlock)\n",{"type":40,"tag":193,"props":12149,"children":12151},{"class":196,"line":12150},50,[12152],{"type":40,"tag":193,"props":12153,"children":12154},{"style":207},[12155],{"type":51,"value":12156}," 6 | WARNING | [ ] Line exceeds 120 characters; contains 122 characters (Generic.Files.LineLength.TooLong)\n",{"type":40,"tag":193,"props":12158,"children":12160},{"class":196,"line":12159},51,[12161],{"type":40,"tag":193,"props":12162,"children":12163},{"style":207},[12164],{"type":51,"value":12165}," 8 | ERROR   | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n",{"type":40,"tag":193,"props":12167,"children":12169},{"class":196,"line":12168},52,[12170],{"type":40,"tag":193,"props":12171,"children":12172},{"style":207},[12173],{"type":51,"value":12174},"17 | ERROR   | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":12176,"children":12178},{"class":196,"line":12177},53,[12179],{"type":40,"tag":193,"props":12180,"children":12181},{"style":207},[12182],{"type":51,"value":12183},"23 | ERROR   | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n",{"type":40,"tag":193,"props":12185,"children":12187},{"class":196,"line":12186},54,[12188],{"type":40,"tag":193,"props":12189,"children":12190},{"style":201},[12191],{"type":51,"value":11794},{"type":40,"tag":193,"props":12193,"children":12195},{"class":196,"line":12194},55,[12196],{"type":40,"tag":193,"props":12197,"children":12198},{"style":207},[12199],{"type":51,"value":9445},{"type":40,"tag":193,"props":12201,"children":12203},{"class":196,"line":12202},56,[12204],{"type":40,"tag":193,"props":12205,"children":12206},{"style":201},[12207],{"type":51,"value":11794},{"type":40,"tag":193,"props":12209,"children":12211},{"class":196,"line":12210},57,[12212],{"type":40,"tag":193,"props":12213,"children":12214},{"emptyLinePlaceholder":35},[12215],{"type":51,"value":626},{"type":40,"tag":193,"props":12217,"children":12219},{"class":196,"line":12218},58,[12220],{"type":40,"tag":193,"props":12221,"children":12222},{"emptyLinePlaceholder":35},[12223],{"type":51,"value":626},{"type":40,"tag":193,"props":12225,"children":12227},{"class":196,"line":12226},59,[12228],{"type":40,"tag":193,"props":12229,"children":12230},{"style":207},[12231],{"type":51,"value":12232},"FILE: /footmate.pro/wp-content/themes/footmate/app/Core/Config.php\n",{"type":40,"tag":193,"props":12234,"children":12236},{"class":196,"line":12235},60,[12237],{"type":40,"tag":193,"props":12238,"children":12239},{"style":201},[12240],{"type":51,"value":11794},{"type":40,"tag":193,"props":12242,"children":12244},{"class":196,"line":12243},61,[12245],{"type":40,"tag":193,"props":12246,"children":12247},{"style":207},[12248],{"type":51,"value":12249},"FOUND 4 ERRORS AFFECTING 4 LINES\n",{"type":40,"tag":193,"props":12251,"children":12253},{"class":196,"line":12252},62,[12254],{"type":40,"tag":193,"props":12255,"children":12256},{"style":201},[12257],{"type":51,"value":11794},{"type":40,"tag":193,"props":12259,"children":12261},{"class":196,"line":12260},63,[12262],{"type":40,"tag":193,"props":12263,"children":12264},{"style":207},[12265],{"type":51,"value":12266},"10 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":12268,"children":12270},{"class":196,"line":12269},64,[12271],{"type":40,"tag":193,"props":12272,"children":12273},{"style":207},[12274],{"type":51,"value":12275},"38 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":12277,"children":12279},{"class":196,"line":12278},65,[12280],{"type":40,"tag":193,"props":12281,"children":12282},{"style":207},[12283],{"type":51,"value":12284},"53 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":12286,"children":12288},{"class":196,"line":12287},66,[12289],{"type":40,"tag":193,"props":12290,"children":12291},{"style":207},[12292],{"type":51,"value":12293},"58 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":12295,"children":12297},{"class":196,"line":12296},67,[12298],{"type":40,"tag":193,"props":12299,"children":12300},{"style":201},[12301],{"type":51,"value":11794},{"type":40,"tag":193,"props":12303,"children":12305},{"class":196,"line":12304},68,[12306],{"type":40,"tag":193,"props":12307,"children":12308},{"style":207},[12309],{"type":51,"value":9445},{"type":40,"tag":193,"props":12311,"children":12313},{"class":196,"line":12312},69,[12314],{"type":40,"tag":193,"props":12315,"children":12316},{"style":201},[12317],{"type":51,"value":11794},{"type":40,"tag":193,"props":12319,"children":12321},{"class":196,"line":12320},70,[12322],{"type":40,"tag":193,"props":12323,"children":12324},{"emptyLinePlaceholder":35},[12325],{"type":51,"value":626},{"type":40,"tag":193,"props":12327,"children":12329},{"class":196,"line":12328},71,[12330],{"type":40,"tag":193,"props":12331,"children":12332},{"emptyLinePlaceholder":35},[12333],{"type":51,"value":626},{"type":40,"tag":193,"props":12335,"children":12337},{"class":196,"line":12336},72,[12338],{"type":40,"tag":193,"props":12339,"children":12340},{"style":207},[12341],{"type":51,"value":12342},"FILE: /footmate.pro/wp-content/themes/footmate/app/Integrations/Vite.php\n",{"type":40,"tag":193,"props":12344,"children":12346},{"class":196,"line":12345},73,[12347],{"type":40,"tag":193,"props":12348,"children":12349},{"style":201},[12350],{"type":51,"value":11794},{"type":40,"tag":193,"props":12352,"children":12354},{"class":196,"line":12353},74,[12355],{"type":40,"tag":193,"props":12356,"children":12357},{"style":207},[12358],{"type":51,"value":12249},{"type":40,"tag":193,"props":12360,"children":12361},{"class":196,"line":1055},[12362],{"type":40,"tag":193,"props":12363,"children":12364},{"style":201},[12365],{"type":51,"value":11794},{"type":40,"tag":193,"props":12367,"children":12369},{"class":196,"line":12368},76,[12370],{"type":40,"tag":193,"props":12371,"children":12372},{"style":207},[12373],{"type":51,"value":12374}," 1 | ERROR | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n",{"type":40,"tag":193,"props":12376,"children":12378},{"class":196,"line":12377},77,[12379],{"type":40,"tag":193,"props":12380,"children":12381},{"style":207},[12382],{"type":51,"value":11816},{"type":40,"tag":193,"props":12384,"children":12386},{"class":196,"line":12385},78,[12387],{"type":40,"tag":193,"props":12388,"children":12389},{"style":207},[12390],{"type":51,"value":12391},"14 | ERROR | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n",{"type":40,"tag":193,"props":12393,"children":12395},{"class":196,"line":12394},79,[12396],{"type":40,"tag":193,"props":12397,"children":12398},{"style":207},[12399],{"type":51,"value":12400},"19 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":12402,"children":12404},{"class":196,"line":12403},80,[12405],{"type":40,"tag":193,"props":12406,"children":12407},{"style":201},[12408],{"type":51,"value":11794},{"type":40,"tag":193,"props":12410,"children":12412},{"class":196,"line":12411},81,[12413],{"type":40,"tag":193,"props":12414,"children":12415},{"style":207},[12416],{"type":51,"value":9445},{"type":40,"tag":193,"props":12418,"children":12420},{"class":196,"line":12419},82,[12421],{"type":40,"tag":193,"props":12422,"children":12423},{"style":201},[12424],{"type":51,"value":11794},{"type":40,"tag":193,"props":12426,"children":12428},{"class":196,"line":12427},83,[12429],{"type":40,"tag":193,"props":12430,"children":12431},{"emptyLinePlaceholder":35},[12432],{"type":51,"value":626},{"type":40,"tag":193,"props":12434,"children":12436},{"class":196,"line":12435},84,[12437],{"type":40,"tag":193,"props":12438,"children":12439},{"emptyLinePlaceholder":35},[12440],{"type":51,"value":626},{"type":40,"tag":193,"props":12442,"children":12444},{"class":196,"line":12443},85,[12445],{"type":40,"tag":193,"props":12446,"children":12447},{"style":207},[12448],{"type":51,"value":12449},"FILE: /footmate.pro/wp-content/themes/footmate/app/Integrations/Integrations.php\n",{"type":40,"tag":193,"props":12451,"children":12453},{"class":196,"line":12452},86,[12454],{"type":40,"tag":193,"props":12455,"children":12456},{"style":201},[12457],{"type":51,"value":11794},{"type":40,"tag":193,"props":12459,"children":12461},{"class":196,"line":12460},87,[12462],{"type":40,"tag":193,"props":12463,"children":12464},{"style":207},[12465],{"type":51,"value":12466},"FOUND 2 ERRORS AFFECTING 2 LINES\n",{"type":40,"tag":193,"props":12468,"children":12470},{"class":196,"line":12469},88,[12471],{"type":40,"tag":193,"props":12472,"children":12473},{"style":201},[12474],{"type":51,"value":11794},{"type":40,"tag":193,"props":12476,"children":12478},{"class":196,"line":12477},89,[12479],{"type":40,"tag":193,"props":12480,"children":12481},{"style":207},[12482],{"type":51,"value":12483},"16 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":12485,"children":12487},{"class":196,"line":12486},90,[12488],{"type":40,"tag":193,"props":12489,"children":12490},{"style":207},[12491],{"type":51,"value":12492},"25 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":12494,"children":12496},{"class":196,"line":12495},91,[12497],{"type":40,"tag":193,"props":12498,"children":12499},{"style":201},[12500],{"type":51,"value":11794},{"type":40,"tag":193,"props":12502,"children":12504},{"class":196,"line":12503},92,[12505],{"type":40,"tag":193,"props":12506,"children":12507},{"style":207},[12508],{"type":51,"value":944},{"type":40,"tag":193,"props":12510,"children":12512},{"class":196,"line":12511},93,[12513],{"type":40,"tag":193,"props":12514,"children":12515},{"style":201},[12516],{"type":51,"value":11794},{"type":40,"tag":193,"props":12518,"children":12520},{"class":196,"line":12519},94,[12521],{"type":40,"tag":193,"props":12522,"children":12523},{"emptyLinePlaceholder":35},[12524],{"type":51,"value":626},{"type":40,"tag":193,"props":12526,"children":12528},{"class":196,"line":12527},95,[12529],{"type":40,"tag":193,"props":12530,"children":12531},{"emptyLinePlaceholder":35},[12532],{"type":51,"value":626},{"type":40,"tag":193,"props":12534,"children":12536},{"class":196,"line":12535},96,[12537],{"type":40,"tag":193,"props":12538,"children":12539},{"style":207},[12540],{"type":51,"value":12541},"FILE: /footmate.pro/wp-content/themes/footmate/app/Integrations/ESPN.php\n",{"type":40,"tag":193,"props":12543,"children":12545},{"class":196,"line":12544},97,[12546],{"type":40,"tag":193,"props":12547,"children":12548},{"style":201},[12549],{"type":51,"value":11794},{"type":40,"tag":193,"props":12551,"children":12553},{"class":196,"line":12552},98,[12554],{"type":40,"tag":193,"props":12555,"children":12556},{"style":207},[12557],{"type":51,"value":12558},"FOUND 3 ERRORS AFFECTING 3 LINES\n",{"type":40,"tag":193,"props":12560,"children":12562},{"class":196,"line":12561},99,[12563],{"type":40,"tag":193,"props":12564,"children":12565},{"style":201},[12566],{"type":51,"value":11794},{"type":40,"tag":193,"props":12568,"children":12570},{"class":196,"line":12569},100,[12571],{"type":40,"tag":193,"props":12572,"children":12573},{"style":207},[12574],{"type":51,"value":12374},{"type":40,"tag":193,"props":12576,"children":12578},{"class":196,"line":12577},101,[12579],{"type":40,"tag":193,"props":12580,"children":12581},{"style":207},[12582],{"type":51,"value":12583},"13 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":12585,"children":12587},{"class":196,"line":12586},102,[12588],{"type":40,"tag":193,"props":12589,"children":12590},{"style":207},[12591],{"type":51,"value":12592},"26 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":12594,"children":12596},{"class":196,"line":12595},103,[12597],{"type":40,"tag":193,"props":12598,"children":12599},{"style":201},[12600],{"type":51,"value":11794},{"type":40,"tag":193,"props":12602,"children":12604},{"class":196,"line":12603},104,[12605],{"type":40,"tag":193,"props":12606,"children":12607},{"style":207},[12608],{"type":51,"value":12609},"PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n",{"type":40,"tag":193,"props":12611,"children":12613},{"class":196,"line":12612},105,[12614],{"type":40,"tag":193,"props":12615,"children":12616},{"style":201},[12617],{"type":51,"value":11794},{"type":40,"tag":193,"props":12619,"children":12621},{"class":196,"line":12620},106,[12622],{"type":40,"tag":193,"props":12623,"children":12624},{"emptyLinePlaceholder":35},[12625],{"type":51,"value":626},{"type":40,"tag":193,"props":12627,"children":12629},{"class":196,"line":12628},107,[12630],{"type":40,"tag":193,"props":12631,"children":12632},{"emptyLinePlaceholder":35},[12633],{"type":51,"value":626},{"type":40,"tag":193,"props":12635,"children":12637},{"class":196,"line":12636},108,[12638],{"type":40,"tag":193,"props":12639,"children":12640},{"style":207},[12641],{"type":51,"value":12642},"FILE: /footmate.pro/wp-content/themes/footmate/app/Teams/Teams.php\n",{"type":40,"tag":193,"props":12644,"children":12646},{"class":196,"line":12645},109,[12647],{"type":40,"tag":193,"props":12648,"children":12649},{"style":201},[12650],{"type":51,"value":11794},{"type":40,"tag":193,"props":12652,"children":12654},{"class":196,"line":12653},110,[12655],{"type":40,"tag":193,"props":12656,"children":12657},{"style":207},[12658],{"type":51,"value":7713},{"type":40,"tag":193,"props":12660,"children":12662},{"class":196,"line":12661},111,[12663],{"type":40,"tag":193,"props":12664,"children":12665},{"style":201},[12666],{"type":51,"value":11794},{"type":40,"tag":193,"props":12668,"children":12670},{"class":196,"line":12669},112,[12671],{"type":40,"tag":193,"props":12672,"children":12673},{"style":207},[12674],{"type":51,"value":11816},{"type":40,"tag":193,"props":12676,"children":12678},{"class":196,"line":12677},113,[12679],{"type":40,"tag":193,"props":12680,"children":12681},{"style":201},[12682],{"type":51,"value":11794},{"type":40,"tag":193,"props":12684,"children":12686},{"class":196,"line":12685},114,[12687],{"type":40,"tag":193,"props":12688,"children":12689},{"style":207},[12690],{"type":51,"value":11831},{"type":40,"tag":193,"props":12692,"children":12694},{"class":196,"line":12693},115,[12695],{"type":40,"tag":193,"props":12696,"children":12697},{"style":201},[12698],{"type":51,"value":11794},{"type":40,"tag":193,"props":12700,"children":12702},{"class":196,"line":12701},116,[12703],{"type":40,"tag":193,"props":12704,"children":12705},{"emptyLinePlaceholder":35},[12706],{"type":51,"value":626},{"type":40,"tag":193,"props":12708,"children":12710},{"class":196,"line":12709},117,[12711],{"type":40,"tag":193,"props":12712,"children":12713},{"emptyLinePlaceholder":35},[12714],{"type":51,"value":626},{"type":40,"tag":193,"props":12716,"children":12718},{"class":196,"line":12717},118,[12719],{"type":40,"tag":193,"props":12720,"children":12721},{"style":207},[12722],{"type":51,"value":12723},"FILE: /footmate.pro/wp-content/themes/footmate/app/Templates/Resolver.php\n",{"type":40,"tag":193,"props":12725,"children":12727},{"class":196,"line":12726},119,[12728],{"type":40,"tag":193,"props":12729,"children":12730},{"style":201},[12731],{"type":51,"value":11794},{"type":40,"tag":193,"props":12733,"children":12735},{"class":196,"line":12734},120,[12736],{"type":40,"tag":193,"props":12737,"children":12738},{"style":207},[12739],{"type":51,"value":12740},"FOUND 5 ERRORS AND 1 WARNING AFFECTING 6 LINES\n",{"type":40,"tag":193,"props":12742,"children":12744},{"class":196,"line":12743},121,[12745],{"type":40,"tag":193,"props":12746,"children":12747},{"style":201},[12748],{"type":51,"value":11794},{"type":40,"tag":193,"props":12750,"children":12752},{"class":196,"line":12751},122,[12753],{"type":40,"tag":193,"props":12754,"children":12755},{"style":207},[12756],{"type":51,"value":12757}," 1 | ERROR   | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n",{"type":40,"tag":193,"props":12759,"children":12761},{"class":196,"line":12760},123,[12762],{"type":40,"tag":193,"props":12763,"children":12764},{"style":207},[12765],{"type":51,"value":12766},"26 | ERROR   | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n",{"type":40,"tag":193,"props":12768,"children":12770},{"class":196,"line":12769},124,[12771],{"type":40,"tag":193,"props":12772,"children":12773},{"style":207},[12774],{"type":51,"value":12775},"30 | ERROR   | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":12777,"children":12779},{"class":196,"line":12778},125,[12780],{"type":40,"tag":193,"props":12781,"children":12782},{"style":207},[12783],{"type":51,"value":12784},"36 | WARNING | [ ] Line exceeds 120 characters; contains 121 characters (Generic.Files.LineLength.TooLong)\n",{"type":40,"tag":193,"props":12786,"children":12788},{"class":196,"line":12787},126,[12789],{"type":40,"tag":193,"props":12790,"children":12791},{"style":207},[12792],{"type":51,"value":12793},"45 | ERROR   | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":12795,"children":12797},{"class":196,"line":12796},127,[12798],{"type":40,"tag":193,"props":12799,"children":12800},{"style":207},[12801],{"type":51,"value":12802},"49 | ERROR   | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n",{"type":40,"tag":193,"props":12804,"children":12806},{"class":196,"line":12805},128,[12807],{"type":40,"tag":193,"props":12808,"children":12809},{"style":201},[12810],{"type":51,"value":11794},{"type":40,"tag":193,"props":12812,"children":12814},{"class":196,"line":12813},129,[12815],{"type":40,"tag":193,"props":12816,"children":12817},{"style":207},[12818],{"type":51,"value":12819},"PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n",{"type":40,"tag":193,"props":12821,"children":12823},{"class":196,"line":12822},130,[12824],{"type":40,"tag":193,"props":12825,"children":12826},{"style":201},[12827],{"type":51,"value":11794},{"type":40,"tag":193,"props":12829,"children":12831},{"class":196,"line":12830},131,[12832],{"type":40,"tag":193,"props":12833,"children":12834},{"emptyLinePlaceholder":35},[12835],{"type":51,"value":626},{"type":40,"tag":193,"props":12837,"children":12839},{"class":196,"line":12838},132,[12840],{"type":40,"tag":193,"props":12841,"children":12842},{"emptyLinePlaceholder":35},[12843],{"type":51,"value":626},{"type":40,"tag":193,"props":12845,"children":12847},{"class":196,"line":12846},133,[12848],{"type":40,"tag":193,"props":12849,"children":12850},{"style":207},[12851],{"type":51,"value":12852},"FILE: /footmate.pro/wp-content/themes/footmate/app/Templates/Templates.php\n",{"type":40,"tag":193,"props":12854,"children":12856},{"class":196,"line":12855},134,[12857],{"type":40,"tag":193,"props":12858,"children":12859},{"style":201},[12860],{"type":51,"value":11794},{"type":40,"tag":193,"props":12862,"children":12864},{"class":196,"line":12863},135,[12865],{"type":40,"tag":193,"props":12866,"children":12867},{"style":207},[12868],{"type":51,"value":12249},{"type":40,"tag":193,"props":12870,"children":12872},{"class":196,"line":12871},136,[12873],{"type":40,"tag":193,"props":12874,"children":12875},{"style":201},[12876],{"type":51,"value":11794},{"type":40,"tag":193,"props":12878,"children":12880},{"class":196,"line":12879},137,[12881],{"type":40,"tag":193,"props":12882,"children":12883},{"style":207},[12884],{"type":51,"value":12374},{"type":40,"tag":193,"props":12886,"children":12888},{"class":196,"line":12887},138,[12889],{"type":40,"tag":193,"props":12890,"children":12891},{"style":207},[12892],{"type":51,"value":12893},"15 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":12895,"children":12897},{"class":196,"line":12896},139,[12898],{"type":40,"tag":193,"props":12899,"children":12900},{"style":207},[12901],{"type":51,"value":12902},"21 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":12904,"children":12906},{"class":196,"line":12905},140,[12907],{"type":40,"tag":193,"props":12908,"children":12909},{"style":207},[12910],{"type":51,"value":12592},{"type":40,"tag":193,"props":12912,"children":12914},{"class":196,"line":12913},141,[12915],{"type":40,"tag":193,"props":12916,"children":12917},{"style":201},[12918],{"type":51,"value":11794},{"type":40,"tag":193,"props":12920,"children":12922},{"class":196,"line":12921},142,[12923],{"type":40,"tag":193,"props":12924,"children":12925},{"style":207},[12926],{"type":51,"value":9445},{"type":40,"tag":193,"props":12928,"children":12930},{"class":196,"line":12929},143,[12931],{"type":40,"tag":193,"props":12932,"children":12933},{"style":201},[12934],{"type":51,"value":11794},{"type":40,"tag":193,"props":12936,"children":12938},{"class":196,"line":12937},144,[12939],{"type":40,"tag":193,"props":12940,"children":12941},{"emptyLinePlaceholder":35},[12942],{"type":51,"value":626},{"type":40,"tag":193,"props":12944,"children":12946},{"class":196,"line":12945},145,[12947],{"type":40,"tag":193,"props":12948,"children":12949},{"emptyLinePlaceholder":35},[12950],{"type":51,"value":626},{"type":40,"tag":193,"props":12952,"children":12954},{"class":196,"line":12953},146,[12955],{"type":40,"tag":193,"props":12956,"children":12957},{"style":207},[12958],{"type":51,"value":12959},"FILE: /footmate.pro/wp-content/themes/footmate/app/Templates/Provider.php\n",{"type":40,"tag":193,"props":12961,"children":12963},{"class":196,"line":12962},147,[12964],{"type":40,"tag":193,"props":12965,"children":12966},{"style":201},[12967],{"type":51,"value":11794},{"type":40,"tag":193,"props":12969,"children":12971},{"class":196,"line":12970},148,[12972],{"type":40,"tag":193,"props":12973,"children":12974},{"style":207},[12975],{"type":51,"value":12976},"FOUND 10 ERRORS AFFECTING 9 LINES\n",{"type":40,"tag":193,"props":12978,"children":12980},{"class":196,"line":12979},149,[12981],{"type":40,"tag":193,"props":12982,"children":12983},{"style":201},[12984],{"type":51,"value":11794},{"type":40,"tag":193,"props":12986,"children":12988},{"class":196,"line":12987},150,[12989],{"type":40,"tag":193,"props":12990,"children":12991},{"style":207},[12992],{"type":51,"value":12374},{"type":40,"tag":193,"props":12994,"children":12996},{"class":196,"line":12995},151,[12997],{"type":40,"tag":193,"props":12998,"children":12999},{"style":207},[13000],{"type":51,"value":13001},"17 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":13003,"children":13005},{"class":196,"line":13004},152,[13006],{"type":40,"tag":193,"props":13007,"children":13008},{"style":207},[13009],{"type":51,"value":13010},"22 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":13012,"children":13014},{"class":196,"line":13013},153,[13015],{"type":40,"tag":193,"props":13016,"children":13017},{"style":207},[13018],{"type":51,"value":13019},"22 | ERROR | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n",{"type":40,"tag":193,"props":13021,"children":13023},{"class":196,"line":13022},154,[13024],{"type":40,"tag":193,"props":13025,"children":13026},{"style":207},[13027],{"type":51,"value":13028},"27 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":13030,"children":13032},{"class":196,"line":13031},155,[13033],{"type":40,"tag":193,"props":13034,"children":13035},{"style":207},[13036],{"type":51,"value":13037},"28 | ERROR | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n",{"type":40,"tag":193,"props":13039,"children":13041},{"class":196,"line":13040},156,[13042],{"type":40,"tag":193,"props":13043,"children":13044},{"style":207},[13045],{"type":51,"value":13046},"29 | ERROR | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n",{"type":40,"tag":193,"props":13048,"children":13050},{"class":196,"line":13049},157,[13051],{"type":40,"tag":193,"props":13052,"children":13053},{"style":207},[13054],{"type":51,"value":13055},"32 | ERROR | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n",{"type":40,"tag":193,"props":13057,"children":13059},{"class":196,"line":13058},158,[13060],{"type":40,"tag":193,"props":13061,"children":13062},{"style":207},[13063],{"type":51,"value":13064},"34 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":13066,"children":13068},{"class":196,"line":13067},159,[13069],{"type":40,"tag":193,"props":13070,"children":13071},{"style":207},[13072],{"type":51,"value":13073},"39 | ERROR | [x] Whitespace found at end of line (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)\n",{"type":40,"tag":193,"props":13075,"children":13077},{"class":196,"line":13076},160,[13078],{"type":40,"tag":193,"props":13079,"children":13080},{"style":201},[13081],{"type":51,"value":11794},{"type":40,"tag":193,"props":13083,"children":13085},{"class":196,"line":13084},161,[13086],{"type":40,"tag":193,"props":13087,"children":13088},{"style":207},[13089],{"type":51,"value":13090},"PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY\n",{"type":40,"tag":193,"props":13092,"children":13094},{"class":196,"line":13093},162,[13095],{"type":40,"tag":193,"props":13096,"children":13097},{"style":201},[13098],{"type":51,"value":11794},{"type":40,"tag":193,"props":13100,"children":13102},{"class":196,"line":13101},163,[13103],{"type":40,"tag":193,"props":13104,"children":13105},{"emptyLinePlaceholder":35},[13106],{"type":51,"value":626},{"type":40,"tag":193,"props":13108,"children":13110},{"class":196,"line":13109},164,[13111],{"type":40,"tag":193,"props":13112,"children":13113},{"emptyLinePlaceholder":35},[13114],{"type":51,"value":626},{"type":40,"tag":193,"props":13116,"children":13118},{"class":196,"line":13117},165,[13119],{"type":40,"tag":193,"props":13120,"children":13121},{"style":207},[13122],{"type":51,"value":13123},"FILE: /footmate.pro/wp-content/themes/footmate/app/Assets/Resolver.php\n",{"type":40,"tag":193,"props":13125,"children":13127},{"class":196,"line":13126},166,[13128],{"type":40,"tag":193,"props":13129,"children":13130},{"style":201},[13131],{"type":51,"value":11794},{"type":40,"tag":193,"props":13133,"children":13135},{"class":196,"line":13134},167,[13136],{"type":40,"tag":193,"props":13137,"children":13138},{"style":207},[13139],{"type":51,"value":12249},{"type":40,"tag":193,"props":13141,"children":13143},{"class":196,"line":13142},168,[13144],{"type":40,"tag":193,"props":13145,"children":13146},{"style":201},[13147],{"type":51,"value":11794},{"type":40,"tag":193,"props":13149,"children":13151},{"class":196,"line":13150},169,[13152],{"type":40,"tag":193,"props":13153,"children":13154},{"style":207},[13155],{"type":51,"value":12374},{"type":40,"tag":193,"props":13157,"children":13159},{"class":196,"line":13158},170,[13160],{"type":40,"tag":193,"props":13161,"children":13162},{"style":207},[13163],{"type":51,"value":12583},{"type":40,"tag":193,"props":13165,"children":13167},{"class":196,"line":13166},171,[13168],{"type":40,"tag":193,"props":13169,"children":13170},{"style":207},[13171],{"type":51,"value":13028},{"type":40,"tag":193,"props":13173,"children":13175},{"class":196,"line":13174},172,[13176],{"type":40,"tag":193,"props":13177,"children":13178},{"style":207},[13179],{"type":51,"value":13180},"36 | ERROR | [x] Opening brace should be on the same line as the declaration (Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine)\n",{"type":40,"tag":193,"props":13182,"children":13184},{"class":196,"line":13183},173,[13185],{"type":40,"tag":193,"props":13186,"children":13187},{"style":201},[13188],{"type":51,"value":11794},{"type":40,"tag":193,"props":13190,"children":13192},{"class":196,"line":13191},174,[13193],{"type":40,"tag":193,"props":13194,"children":13195},{"style":207},[13196],{"type":51,"value":9445},{"type":40,"tag":193,"props":13198,"children":13200},{"class":196,"line":13199},175,[13201],{"type":40,"tag":193,"props":13202,"children":13203},{"style":201},[13204],{"type":51,"value":11794},{"type":40,"tag":193,"props":13206,"children":13208},{"class":196,"line":13207},176,[13209],{"type":40,"tag":193,"props":13210,"children":13211},{"emptyLinePlaceholder":35},[13212],{"type":51,"value":626},{"type":40,"tag":193,"props":13214,"children":13216},{"class":196,"line":13215},177,[13217],{"type":40,"tag":193,"props":13218,"children":13219},{"emptyLinePlaceholder":35},[13220],{"type":51,"value":626},{"type":40,"tag":193,"props":13222,"children":13224},{"class":196,"line":13223},178,[13225],{"type":40,"tag":193,"props":13226,"children":13227},{"style":207},[13228],{"type":51,"value":13229},"FILE: /footmate.pro/wp-content/themes/footmate/app/Assets/Assets.php\n",{"type":40,"tag":193,"props":13231,"children":13233},{"class":196,"line":13232},179,[13234],{"type":40,"tag":193,"props":13235,"children":13236},{"style":201},[13237],{"type":51,"value":11794},{"type":40,"tag":193,"props":13239,"children":13241},{"class":196,"line":13240},180,[13242],{"type":40,"tag":193,"props":13243,"children":13244},{"style":207},[13245],{"type":51,"value":12466},{"type":40,"tag":193,"props":13247,"children":13249},{"class":196,"line":13248},181,[13250],{"type":40,"tag":193,"props":13251,"children":13252},{"style":201},[13253],{"type":51,"value":11794},{"type":40,"tag":193,"props":13255,"children":13257},{"class":196,"line":13256},182,[13258],{"type":40,"tag":193,"props":13259,"children":13260},{"style":207},[13261],{"type":51,"value":12374},{"type":40,"tag":193,"props":13263,"children":13265},{"class":196,"line":13264},183,[13266],{"type":40,"tag":193,"props":13267,"children":13268},{"style":207},[13269],{"type":51,"value":12893},{"type":40,"tag":193,"props":13271,"children":13273},{"class":196,"line":13272},184,[13274],{"type":40,"tag":193,"props":13275,"children":13276},{"style":201},[13277],{"type":51,"value":11794},{"type":40,"tag":193,"props":13279,"children":13281},{"class":196,"line":13280},185,[13282],{"type":40,"tag":193,"props":13283,"children":13284},{"style":207},[13285],{"type":51,"value":944},{"type":40,"tag":193,"props":13287,"children":13289},{"class":196,"line":13288},186,[13290],{"type":40,"tag":193,"props":13291,"children":13292},{"style":201},[13293],{"type":51,"value":11794},{"type":40,"tag":47,"props":13295,"children":13296},{},[13297,13299,13304],{"type":51,"value":13298},"Now, our code looks like shit 😅 There are tons of errors across all the PHP files because we used a different approach earlier. But no worry! Just run the ",{"type":40,"tag":189,"props":13300,"children":13302},{"className":13301},[],[13303],{"type":51,"value":1944},{"type":51,"value":13305}," and your whole codebase will be formatted automatically.",{"type":40,"tag":58,"props":13307,"children":13308},{},[],{"type":40,"tag":62,"props":13310,"children":13312},{"id":13311},"how-to-use-php-code-sniffer-with-vs-code",[13313],{"type":51,"value":13314},"How to use PHP Code Sniffer with VS Code?",{"type":40,"tag":47,"props":13316,"children":13317},{},[13318,13320,13327],{"type":51,"value":13319},"Let's face it. CLI usage is great, but I'm lazy, so I don't want to run linter whenever I want to check the code for potential problems. As you remember from the previous article I like to see the problems just while writing! That's where extensions come in handy. I use VS Code editor which provides a ",{"type":40,"tag":109,"props":13321,"children":13324},{"href":13322,"rel":13323},"https://marketplace.visualstudio.com/items?itemName=obliviousharmony.vscode-php-codesniffer",[113],[13325],{"type":51,"value":13326},"plugin",{"type":51,"value":13328}," for adding PHP Code Sniffer support.",{"type":40,"tag":47,"props":13330,"children":13331},{},[13332,13334,13340],{"type":51,"value":13333},"At first install the ",{"type":40,"tag":109,"props":13335,"children":13337},{"href":13322,"rel":13336},[113],[13338],{"type":51,"value":13339},"extension",{"type":51,"value":13341},". Then go to the plugin settings and set the following items:",{"type":40,"tag":13343,"props":13344,"children":13345},"ul",{},[13346,13365],{"type":40,"tag":13347,"props":13348,"children":13349},"li",{},[13350,13356,13358,13363],{"type":40,"tag":189,"props":13351,"children":13353},{"className":13352},[],[13354],{"type":51,"value":13355},"PHP Code Sniffer: Auto Executable",{"type":51,"value":13357}," This setting enables searching for the ",{"type":40,"tag":189,"props":13359,"children":13361},{"className":13360},[],[13362],{"type":51,"value":1936},{"type":51,"value":13364}," script in the current and the parent directories.",{"type":40,"tag":13347,"props":13366,"children":13367},{},[13368,13374],{"type":40,"tag":189,"props":13369,"children":13371},{"className":13370},[],[13372],{"type":51,"value":13373},"PHP Code Sniffer: Standard",{"type":51,"value":13375}," This setting defines that the plugin should search for the configuration file in the current and parent directories.",{"type":40,"tag":47,"props":13377,"children":13378},{},[13379],{"type":40,"tag":2789,"props":13380,"children":13382},{"alt":2791,"src":13381},"https://cdn.pragmate.dev/wp-content/uploads/2024/03/03f2b391-aefc-4fe7-b39a-8710922fab89.png",[],{"type":40,"tag":47,"props":13384,"children":13385},{},[13386],{"type":51,"value":13387},"Now, if you open the PHP file, you'll see all the problems immediately as you write. So skipping the violations \"because you haven't noticed them\" is impossible now. Any red highlight means that the code is not compliant with the rules and needs to be fixed, before pushing the results to the repository. That's a great boost for you and the team.",{"type":40,"tag":47,"props":13389,"children":13390},{},[13391],{"type":51,"value":13392},"You can write code that is clean by default, but now you can also write code that looks like shit and then run the command to format a code for you. I use this often.",{"type":40,"tag":47,"props":13394,"children":13395},{},[13396],{"type":40,"tag":2789,"props":13397,"children":13399},{"alt":2791,"src":13398},"https://cdn.pragmate.dev/wp-content/uploads/2024/03/aa188281-9899-488f-a8e7-8832428e4f7c.png",[],{"type":40,"tag":58,"props":13401,"children":13402},{},[],{"type":40,"tag":62,"props":13404,"children":13406},{"id":13405},"how-to-work-with-php-code-sniffer-docs",[13407],{"type":51,"value":13408},"How to work with PHP Code Sniffer docs?",{"type":40,"tag":47,"props":13410,"children":13411},{},[13412,13414,13419,13421,13428],{"type":51,"value":13413},"There is one big problem that has always bothered me. ",{"type":40,"tag":95,"props":13415,"children":13416},{},[13417],{"type":51,"value":13418},"How do I know which rule to use for my needs?",{"type":51,"value":13420}," Here, things become more complicated, because of the docs that are still in progress. I have problems finding the rules I could use to build my standards or their explanations, and I know ",{"type":40,"tag":109,"props":13422,"children":13425},{"href":13423,"rel":13424},"https://github.com/squizlabs/PHP_CodeSniffer/issues/1752#issuecomment-750927206",[113],[13426],{"type":51,"value":13427},"I'm not the only one",{"type":51,"value":265},{"type":40,"tag":47,"props":13430,"children":13431},{},[13432,13434,13439,13441,13446],{"type":51,"value":13433},"We can list all the sniffs in the specific coding standard by adding the ",{"type":40,"tag":189,"props":13435,"children":13437},{"className":13436},[],[13438],{"type":51,"value":8141},{"type":51,"value":13440}," attribute with ",{"type":40,"tag":189,"props":13442,"children":13444},{"className":13443},[],[13445],{"type":51,"value":1936},{"type":51,"value":13447}," command, but there are no explanations so we need to check them manually.",{"type":40,"tag":179,"props":13449,"children":13451},{"className":3474,"code":13450,"language":3478,"meta":7,"style":7},"vendor/bin/phpcs --standard=PEAR -e\n\nThe PEAR standard contains 28 sniffs\n\nGeneric (9 sniffs)\n------------------\n  Generic.Commenting.DocComment\n  Generic.ControlStructures.InlineControlStructure\n  Generic.Files.LineEndings\n  Generic.Files.LineLength\n  Generic.Functions.FunctionCallArgumentSpacing\n  Generic.NamingConventions.UpperCaseConstantName\n  Generic.PHP.DisallowShortOpenTag\n  Generic.PHP.LowerCaseConstant\n  Generic.WhiteSpace.DisallowTabIndent\n\n...\n",[13452],{"type":40,"tag":189,"props":13453,"children":13454},{"__ignoreMap":7},[13455,13463,13470,13478,13485,13493,13501,13509,13517,13525,13533,13541,13549,13557,13565,13573,13580],{"type":40,"tag":193,"props":13456,"children":13457},{"class":196,"line":185},[13458],{"type":40,"tag":193,"props":13459,"children":13460},{"style":207},[13461],{"type":51,"value":13462},"vendor/bin/phpcs --standard=PEAR -e\n",{"type":40,"tag":193,"props":13464,"children":13465},{"class":196,"line":213},[13466],{"type":40,"tag":193,"props":13467,"children":13468},{"emptyLinePlaceholder":35},[13469],{"type":51,"value":626},{"type":40,"tag":193,"props":13471,"children":13472},{"class":196,"line":233},[13473],{"type":40,"tag":193,"props":13474,"children":13475},{"style":207},[13476],{"type":51,"value":13477},"The PEAR standard contains 28 sniffs\n",{"type":40,"tag":193,"props":13479,"children":13480},{"class":196,"line":446},[13481],{"type":40,"tag":193,"props":13482,"children":13483},{"emptyLinePlaceholder":35},[13484],{"type":51,"value":626},{"type":40,"tag":193,"props":13486,"children":13487},{"class":196,"line":477},[13488],{"type":40,"tag":193,"props":13489,"children":13490},{"style":207},[13491],{"type":51,"value":13492},"Generic (9 sniffs)\n",{"type":40,"tag":193,"props":13494,"children":13495},{"class":196,"line":507},[13496],{"type":40,"tag":193,"props":13497,"children":13498},{"style":201},[13499],{"type":51,"value":13500},"------------------\n",{"type":40,"tag":193,"props":13502,"children":13503},{"class":196,"line":543},[13504],{"type":40,"tag":193,"props":13505,"children":13506},{"style":207},[13507],{"type":51,"value":13508},"  Generic.Commenting.DocComment\n",{"type":40,"tag":193,"props":13510,"children":13511},{"class":196,"line":582},[13512],{"type":40,"tag":193,"props":13513,"children":13514},{"style":207},[13515],{"type":51,"value":13516},"  Generic.ControlStructures.InlineControlStructure\n",{"type":40,"tag":193,"props":13518,"children":13519},{"class":196,"line":620},[13520],{"type":40,"tag":193,"props":13521,"children":13522},{"style":207},[13523],{"type":51,"value":13524},"  Generic.Files.LineEndings\n",{"type":40,"tag":193,"props":13526,"children":13527},{"class":196,"line":294},[13528],{"type":40,"tag":193,"props":13529,"children":13530},{"style":207},[13531],{"type":51,"value":13532},"  Generic.Files.LineLength\n",{"type":40,"tag":193,"props":13534,"children":13535},{"class":196,"line":660},[13536],{"type":40,"tag":193,"props":13537,"children":13538},{"style":207},[13539],{"type":51,"value":13540},"  Generic.Functions.FunctionCallArgumentSpacing\n",{"type":40,"tag":193,"props":13542,"children":13543},{"class":196,"line":668},[13544],{"type":40,"tag":193,"props":13545,"children":13546},{"style":207},[13547],{"type":51,"value":13548},"  Generic.NamingConventions.UpperCaseConstantName\n",{"type":40,"tag":193,"props":13550,"children":13551},{"class":196,"line":961},[13552],{"type":40,"tag":193,"props":13553,"children":13554},{"style":207},[13555],{"type":51,"value":13556},"  Generic.PHP.DisallowShortOpenTag\n",{"type":40,"tag":193,"props":13558,"children":13559},{"class":196,"line":2115},[13560],{"type":40,"tag":193,"props":13561,"children":13562},{"style":207},[13563],{"type":51,"value":13564},"  Generic.PHP.LowerCaseConstant\n",{"type":40,"tag":193,"props":13566,"children":13567},{"class":196,"line":2124},[13568],{"type":40,"tag":193,"props":13569,"children":13570},{"style":207},[13571],{"type":51,"value":13572},"  Generic.WhiteSpace.DisallowTabIndent\n",{"type":40,"tag":193,"props":13574,"children":13575},{"class":196,"line":8601},[13576],{"type":40,"tag":193,"props":13577,"children":13578},{"emptyLinePlaceholder":35},[13579],{"type":51,"value":626},{"type":40,"tag":193,"props":13581,"children":13582},{"class":196,"line":8659},[13583],{"type":40,"tag":193,"props":13584,"children":13585},{"style":207},[13586],{"type":51,"value":13587},"...\n",{"type":40,"tag":47,"props":13589,"children":13590},{},[13591,13593,13599],{"type":51,"value":13592},"We can show more docs by using the ",{"type":40,"tag":189,"props":13594,"children":13596},{"className":13595},[],[13597],{"type":51,"value":13598},"vendor/bin/phpcs --standard=PEAR --generator=text",{"type":51,"value":13600}," command which provides more useful info but the sniff codes are not available there. If we find a useful pattern, we need to spend time and search for the sniff code again.",{"type":40,"tag":179,"props":13602,"children":13604},{"className":3474,"code":13603,"language":3478,"meta":7,"style":7},"vendor/bin/phpcs --standard=PEAR --generator=text\n\n---------------------------------------------\n| GENERIC CODING STANDARD: CONSTRUCTOR NAME |\n---------------------------------------------\n\nConstructors should be named __construct, not after the class.\n\n----------------------------------------- CODE COMPARISON ------------------------------------------\n| Valid: The constructor is named __construct.   | Invalid: The old style class name constructor   |\n|                                                | is used.                                        |\n----------------------------------------------------------------------------------------------------\n| class Foo                                      | class Foo                                       |\n| {                                              | {                                               |\n|     function __construct()                     |     function Foo()                              |\n|     {                                          |     {                                           |\n|     }                                          |     }                                           |\n| }                                              | }                                               |\n----------------------------------------------------------------------------------------------------\n",[13605],{"type":40,"tag":189,"props":13606,"children":13607},{"__ignoreMap":7},[13608,13616,13623,13631,13639,13646,13653,13661,13668,13676,13684,13692,13700,13708,13716,13724,13732,13740,13748],{"type":40,"tag":193,"props":13609,"children":13610},{"class":196,"line":185},[13611],{"type":40,"tag":193,"props":13612,"children":13613},{"style":207},[13614],{"type":51,"value":13615},"vendor/bin/phpcs --standard=PEAR --generator=text\n",{"type":40,"tag":193,"props":13617,"children":13618},{"class":196,"line":213},[13619],{"type":40,"tag":193,"props":13620,"children":13621},{"emptyLinePlaceholder":35},[13622],{"type":51,"value":626},{"type":40,"tag":193,"props":13624,"children":13625},{"class":196,"line":233},[13626],{"type":40,"tag":193,"props":13627,"children":13628},{"style":201},[13629],{"type":51,"value":13630},"---------------------------------------------\n",{"type":40,"tag":193,"props":13632,"children":13633},{"class":196,"line":446},[13634],{"type":40,"tag":193,"props":13635,"children":13636},{"style":207},[13637],{"type":51,"value":13638},"| GENERIC CODING STANDARD: CONSTRUCTOR NAME |\n",{"type":40,"tag":193,"props":13640,"children":13641},{"class":196,"line":477},[13642],{"type":40,"tag":193,"props":13643,"children":13644},{"style":201},[13645],{"type":51,"value":13630},{"type":40,"tag":193,"props":13647,"children":13648},{"class":196,"line":507},[13649],{"type":40,"tag":193,"props":13650,"children":13651},{"emptyLinePlaceholder":35},[13652],{"type":51,"value":626},{"type":40,"tag":193,"props":13654,"children":13655},{"class":196,"line":543},[13656],{"type":40,"tag":193,"props":13657,"children":13658},{"style":207},[13659],{"type":51,"value":13660},"Constructors should be named __construct, not after the class.\n",{"type":40,"tag":193,"props":13662,"children":13663},{"class":196,"line":582},[13664],{"type":40,"tag":193,"props":13665,"children":13666},{"emptyLinePlaceholder":35},[13667],{"type":51,"value":626},{"type":40,"tag":193,"props":13669,"children":13670},{"class":196,"line":620},[13671],{"type":40,"tag":193,"props":13672,"children":13673},{"style":201},[13674],{"type":51,"value":13675},"----------------------------------------- CODE COMPARISON ------------------------------------------\n",{"type":40,"tag":193,"props":13677,"children":13678},{"class":196,"line":294},[13679],{"type":40,"tag":193,"props":13680,"children":13681},{"style":207},[13682],{"type":51,"value":13683},"| Valid: The constructor is named __construct.   | Invalid: The old style class name constructor   |\n",{"type":40,"tag":193,"props":13685,"children":13686},{"class":196,"line":660},[13687],{"type":40,"tag":193,"props":13688,"children":13689},{"style":207},[13690],{"type":51,"value":13691},"|                                                | is used.                                        |\n",{"type":40,"tag":193,"props":13693,"children":13694},{"class":196,"line":668},[13695],{"type":40,"tag":193,"props":13696,"children":13697},{"style":201},[13698],{"type":51,"value":13699},"----------------------------------------------------------------------------------------------------\n",{"type":40,"tag":193,"props":13701,"children":13702},{"class":196,"line":961},[13703],{"type":40,"tag":193,"props":13704,"children":13705},{"style":207},[13706],{"type":51,"value":13707},"| class Foo                                      | class Foo                                       |\n",{"type":40,"tag":193,"props":13709,"children":13710},{"class":196,"line":2115},[13711],{"type":40,"tag":193,"props":13712,"children":13713},{"style":207},[13714],{"type":51,"value":13715},"| {                                              | {                                               |\n",{"type":40,"tag":193,"props":13717,"children":13718},{"class":196,"line":2124},[13719],{"type":40,"tag":193,"props":13720,"children":13721},{"style":207},[13722],{"type":51,"value":13723},"|     function __construct()                     |     function Foo()                              |\n",{"type":40,"tag":193,"props":13725,"children":13726},{"class":196,"line":8601},[13727],{"type":40,"tag":193,"props":13728,"children":13729},{"style":207},[13730],{"type":51,"value":13731},"|     {                                          |     {                                           |\n",{"type":40,"tag":193,"props":13733,"children":13734},{"class":196,"line":8659},[13735],{"type":40,"tag":193,"props":13736,"children":13737},{"style":207},[13738],{"type":51,"value":13739},"|     }                                          |     }                                           |\n",{"type":40,"tag":193,"props":13741,"children":13742},{"class":196,"line":8717},[13743],{"type":40,"tag":193,"props":13744,"children":13745},{"style":207},[13746],{"type":51,"value":13747},"| }                                              | }                                               |\n",{"type":40,"tag":193,"props":13749,"children":13750},{"class":196,"line":8765},[13751],{"type":40,"tag":193,"props":13752,"children":13753},{"style":201},[13754],{"type":51,"value":13699},{"type":40,"tag":47,"props":13756,"children":13757},{},[13758,13760,13766],{"type":51,"value":13759},"We can merge both and use available sniff codes to generate docs just for them with ",{"type":40,"tag":189,"props":13761,"children":13763},{"className":13762},[],[13764],{"type":51,"value":13765},"bin/phpcs --standard=PEAR --generator=text --sniffs=PEAR.Files.IncludingFile",{"type":51,"value":13767}," command. But let's face it - that's far away from being intuitive.",{"type":40,"tag":1058,"props":13769,"children":13771},{"id":13770},"proposition",[13772],{"type":51,"value":13773},"Proposition",{"type":40,"tag":47,"props":13775,"children":13776},{},[13777,13779,13785,13787,13793,13795,13802],{"type":51,"value":13778},"I've decided to give it a try and ",{"type":40,"tag":109,"props":13780,"children":13782},{"href":9217,"rel":13781},[113],[13783],{"type":51,"value":13784},"propose a solution",{"type":51,"value":13786}," that includes sniff codes also in the documentation generated with ",{"type":40,"tag":189,"props":13788,"children":13790},{"className":13789},[],[13791],{"type":51,"value":13792},"--generator",{"type":51,"value":13794}," attribute to make the search process easier, but after discussion with ",{"type":40,"tag":109,"props":13796,"children":13799},{"href":13797,"rel":13798},"https://github.com/jrfnl",[113],[13800],{"type":51,"value":13801},"@jrfnl",{"type":51,"value":13803}," - the head of the PHP Code Sniffer project - we agreed that there are also other important concerns related to docs that need to be2 handled together, so we need to think about this wider and find a more global solution.",{"type":40,"tag":47,"props":13805,"children":13806},{},[13807],{"type":40,"tag":2789,"props":13808,"children":13810},{"alt":2791,"src":13809},"https://cdn.pragmate.dev/wp-content/uploads/2024/02/4dac69db-7382-4c8a-b67d-92242b434414.png",[],{"type":40,"tag":47,"props":13812,"children":13813},{},[13814,13816,13828,13830,13835],{"type":51,"value":13815},"I need it now, so ",{"type":40,"tag":95,"props":13817,"children":13818},{},[13819,13821],{"type":51,"value":13820},"I've decided to create ",{"type":40,"tag":109,"props":13822,"children":13825},{"href":13823,"rel":13824},"https://pragmate.dev/php/phpcs/#what-are-available-coding-standards",[113],[13826],{"type":51,"value":13827},"a simple tool",{"type":51,"value":13829}," - a bash script that iterates through all the default coding standards, gets all the sniffs available there, generates the docs for each of them, and adds more things not available by default like sniff codes, or links to sniff files in GitHub. ",{"type":40,"tag":95,"props":13831,"children":13832},{},[13833],{"type":51,"value":13834},"It simply generates all the things I wished to have when starting my journey with the tool.",{"type":51,"value":13836}," I use it to generate markdown file which I use as a doc.",{"type":40,"tag":47,"props":13838,"children":13839},{},[13840],{"type":51,"value":13841},"Thanks to this, I'm able to check a lot of available rules in one place one by one and search for some I want to have in my codebase - what I've done for this project. I can also find error explanations more easily and that's a huge improvement.",{"type":40,"tag":47,"props":13843,"children":13844},{},[13845],{"type":51,"value":13846},"It's not ideal, because not all the sniffs have docs, and for sure, that's something that should be available within the official project, but that's where I want to ask you for help!",{"type":40,"tag":1058,"props":13848,"children":13850},{"id":13849},"contributions",[13851],{"type":51,"value":13852},"Contributions",{"type":40,"tag":47,"props":13854,"children":13855},{},[13856,13858,13864,13866,13871,13873,13880,13882,13896],{"type":51,"value":13857},"To make the rules discoverage better and have documentation like ",{"type":40,"tag":109,"props":13859,"children":13861},{"href":3154,"rel":13860},[113],[13862],{"type":51,"value":13863},"other popular linters",{"type":51,"value":13865}," which helps rather than rejects, ",{"type":40,"tag":95,"props":13867,"children":13868},{},[13869],{"type":51,"value":13870},"we need to work together!",{"type":51,"value":13872}," @jrfnl already ",{"type":40,"tag":109,"props":13874,"children":13877},{"href":13875,"rel":13876},"https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/317#issuecomment-1915719380",[113],[13878],{"type":51,"value":13879},"has a lot of good ideas",{"type":51,"value":13881}," for handling the docs, but they are nothing without the docs themselves. The docs coverage is already nice, but ",{"type":40,"tag":95,"props":13883,"children":13884},{},[13885,13887,13894],{"type":51,"value":13886},"there are still ",{"type":40,"tag":109,"props":13888,"children":13891},{"href":13889,"rel":13890},"https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/148",[113],[13892],{"type":51,"value":13893},"many of them",{"type":51,"value":13895}," missing",{"type":51,"value":265},{"type":40,"tag":47,"props":13898,"children":13899},{},[13900],{"type":40,"tag":2789,"props":13901,"children":13903},{"alt":2791,"src":13902},"https://cdn.pragmate.dev/wp-content/uploads/2024/02/4910a3f9-b57c-4f34-a535-59e92ac42bc9.png",[],{"type":40,"tag":47,"props":13905,"children":13906},{},[13907],{"type":51,"value":13908},"PHP Code Sniffer is installed approximately 150,000 times per day! So, if we can find 56 eager devs from this group who appreciate this tool (which isn't that many), it would address the most needed thing right now - the missing documentation for some sniffs - and open the way to make the tool better and easier to use, especially for newcomers.",{"type":40,"tag":47,"props":13910,"children":13911},{},[13912,13914,13919,13920,13930],{"type":51,"value":13913},"Consider the tool I created as a preview of what the documentation could look like and how helpful it might be with a small group of people contributing. Your help makes the difference! ",{"type":40,"tag":95,"props":13915,"children":13916},{},[13917],{"type":51,"value":13918},"If you're interested, just check out the link to the",{"type":51,"value":1091},{"type":40,"tag":109,"props":13921,"children":13923},{"href":13889,"rel":13922},[113],[13924,13929],{"type":40,"tag":95,"props":13925,"children":13926},{},[13927],{"type":51,"value":13928},"proper issue on GitHub",{"type":51,"value":322},{"type":51,"value":13931}," choose the sniffs you want to create docs for, and help make the tool better!",{"type":40,"tag":58,"props":13933,"children":13934},{},[],{"type":40,"tag":47,"props":13936,"children":13937},{},[13938,13939,13944,13945,13951,13952,13957],{"type":51,"value":2801},{"type":40,"tag":109,"props":13940,"children":13942},{"href":2804,"rel":13941},[113],[13943],{"type":51,"value":2808},{"type":51,"value":1076},{"type":40,"tag":109,"props":13946,"children":13949},{"href":13947,"rel":13948},"https://www.youtube.com/watch?v=0OelE2c4wVs",[113],[13950],{"type":51,"value":5338},{"type":51,"value":5340},{"type":40,"tag":109,"props":13953,"children":13955},{"href":2435,"rel":13954},[113],[13956],{"type":51,"value":2816},{"type":51,"value":2818},{"type":40,"tag":2820,"props":13959,"children":13960},{},[13961],{"type":51,"value":2824},{"title":7,"searchDepth":213,"depth":213,"links":13963},[13964,13965,13966,13967,13968,13969,13970,13971],{"id":7469,"depth":213,"text":7472},{"id":8094,"depth":213,"text":8097},{"id":9258,"depth":213,"text":9261},{"id":9328,"depth":213,"text":9331},{"id":9784,"depth":213,"text":9787},{"id":10561,"depth":213,"text":10564},{"id":13311,"depth":213,"text":13314},{"id":13405,"depth":213,"text":13408,"children":13972},[13973,13974],{"id":13770,"depth":233,"text":13773},{"id":13849,"depth":233,"text":13852},"content:php:phpcs:index.md","php/phpcs/index.md","php/phpcs/index",1783067303124]