From 93a1cbcfbc3b7cacd8a93784c61d3b8db8fa23be Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Wed, 27 Sep 2023 11:07:01 -0600 Subject: [PATCH] feat: add support for nano-staged (#302) --- defaultRules.md | 1 + index.js | 1 + tests/snapshots/cli.js.snap | Bin 3992 -> 3992 bytes tests/snapshots/main.js.md | 2 ++ tests/snapshots/main.js.snap | Bin 1386 -> 1399 bytes 5 files changed, 4 insertions(+) diff --git a/defaultRules.md b/defaultRules.md index 76e762d2..b2e8e22f 100644 --- a/defaultRules.md +++ b/defaultRules.md @@ -60,6 +60,7 @@ _Note: when a specific key order is used, any other keys will be sorted in the e | pre-commit | | | commitlint | Key sort | | lint-staged | | +| nano-staged | | | config | Key sort | | nodemonConfig | Key sort | | browserify | Key sort | diff --git a/index.js b/index.js index 66ee62cb..26dfe9d4 100755 --- a/index.js +++ b/index.js @@ -254,6 +254,7 @@ const fields = [ { key: 'pre-commit' }, { key: 'commitlint', over: sortObject }, { key: 'lint-staged' }, + { key: 'nano-staged' }, { key: 'config', over: sortObject }, { key: 'nodemonConfig', over: sortObject }, { key: 'browserify', over: sortObject }, diff --git a/tests/snapshots/cli.js.snap b/tests/snapshots/cli.js.snap index 34c5643c25d6eed749f90066087550d89cddf2e6..87200f1f73316f2f0bb08f4cb3182fd580383e0c 100644 GIT binary patch delta 3970 zcmV-|4}I{MADAC9K~_N^Q*L2!b7*gLAa*kf0{~7B+kQ9AZg5y%ew96O7-$Qc9bGM_ z{vRH#K2ASehG z6qTson|ZUxTyJ;1J6_up^kIAFx99r5|NH;{&3kiSU#}#`cdK_VIw)!>O%gLoHZAnT zrIgU#o)o1_PfAV4GHO!R)SC__5-}}yMd+0h<8{IGJyp#y4*2 zy+({{JfHh^>eQ(m-@@@>j-Sl)x598b`MzNqABidbs{ZNy1)nzerG~YvA{twsFWAzE z53`a+b{_f+pC2=K+OS$tV%PE^^SdcirogCZTex@|ADPB;+*g3Jfo;6y=p)5PALV$S z<4=T5D1R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9..b5b91c3a 100644 --- a/tests/snapshots/main.js.md +++ b/tests/snapshots/main.js.md @@ -72,6 +72,7 @@ Generated by [AVA](https://avajs.dev). "mocha": "mocha",␊ "module": "module",␊ "name": "name",␊ + "nano-staged": "nano-staged",␊ "nodemonConfig": "nodemonConfig",␊ "npmPackageJsonLintConfig": "npmPackageJsonLintConfig",␊ "npmpackagejsonlint": "npmpackagejsonlint",␊ @@ -170,6 +171,7 @@ Generated by [AVA](https://avajs.dev). "pre-commit": "pre-commit",␊ "commitlint": "commitlint",␊ "lint-staged": "lint-staged",␊ + "nano-staged": "nano-staged",␊ "config": "config",␊ "nodemonConfig": "nodemonConfig",␊ "browserify": "browserify",␊ diff --git a/tests/snapshots/main.js.snap b/tests/snapshots/main.js.snap index 9b2f65da3e3bdab5b6dfb995c984e9a4afca9e1d..06dbbaa1449d129d63e763ee0bfe954c7efd0062 100644 GIT binary patch literal 1399 zcmV--1&I1VRzV0h!FV_?wR8YO%cg+Z)?kY2v39c{ zvA0)ckROW(00000000BMSj~>)G!RZ^m>IOoYG(z~UPmjA^c~F!0V@PzS)`GWIJy&e z+S87mjh&utAr4%454iCnyb14tT~$e(zfNW}Fw(T^`@TxI?YQi6{jpg~o$SnSe{w6V z9K8@nD7x9@;MP&({{QmTpCs$Xm zJ~hdf=j_#WYkuZ=mRPZ8R%rEl&y_XaVZfoMF`RU?kge=im%yTh>>hr}H-Oh{&8271 zATG_gK@u!vxwX8!NlH=Rk97(35egL7)R>hAqP&G{sqYMjuGMD9i_IaBJPK7Kg|UH- z7(J>CJLX$rR4Vz`yx=P3DiJiQAscw7FuKl$9t?h_HSJkupT6d+V}p1XA?6!bkn zq^ga`PywrEZ7J53rLPQNSJ!3N!DI9&DiB-)IPDEB9gHbt-f+wMUciy3fmiPqBRaK^ z^nHIO`xN?#(uGVjaUmq#6p|f&U^z#}>=l{BTds_o#{TS$3*BdaWXZ1M3k3LV zgv9Sb13AfH&Y(rcEq0+`I%*U6j7iDM!veAXH7trP#wD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