eslint-plugin-sort-decorators 0.2.5 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.badges/code/coverage-branches.svg +1 -1
- package/.badges/code/coverage-functions.svg +1 -1
- package/.badges/code/coverage-jest coverage.svg +1 -1
- package/.badges/code/coverage-lines.svg +1 -1
- package/.badges/code/coverage-statements.svg +1 -1
- package/.badges/code/coverage.svg +1 -1
- package/README.md +44 -1
- package/dist/index.d.ts +102 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/docs/rules/sort-on-accessors.md +3 -1
- package/docs/rules/sort-on-classes.md +3 -1
- package/docs/rules/sort-on-methods.md +3 -1
- package/docs/rules/sort-on-parameters.md +3 -1
- package/docs/rules/sort-on-properties.md +3 -1
- package/package.json +32 -31
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg"
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="131" height="20" role="img" aria-label="branches: 86.74%"><title>branches: 86.74%</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="131" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="78" height="20" fill="#555"/><rect x="78" width="53" height="20" fill="#dfb317"/><rect width="131" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><image x="5" y="3" width="14" height="14" href="data:image/svg+xml;base64,PHN2ZyBmaWxsPSJ3aGl0ZXNtb2tlIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+SmVzdDwvdGl0bGU+PHBhdGggZD0iTTIyLjI1MSAxMS44MmE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2IDMuNzQ1bC4yNjQuMTM5LjI4NC0uMTA0YzEuMjE2LS40MzEgMi4zNDItMS4xMzMgMy4zMzYtMi4wNzFhOS4zMzQgOS4zMzQgMCAwIDAgMS40NDUtMS43MTZjLjE2LjAyNy4zMi4wMzQuNDguMDM0YTMuMTE3IDMuMTE3IDAgMCAwIDMuMDA4LTIuMzI3aDEuMTY3YTMuMTA5IDMuMTA5IDAgMCAwIDMuMDEgMi4zMjdjLjU3NiAwIDEuMTEtLjE2IDEuNTctLjQzLjE4LjUyLjIzNiAxLjA2My4xMzkgMS42MDV6Ii8+PC9zdmc+"/><text aria-hidden="true" x="485" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="510">branches</text><text x="485" y="140" transform="scale(.1)" fill="#fff" textLength="510">branches</text><text aria-hidden="true" x="1035" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">86.74%</text><text x="1035" y="140" transform="scale(.1)" fill="#fff" textLength="430">86.74%</text></g></svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg"
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="121" height="20" role="img" aria-label="functions: 100%"><title>functions: 100%</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="121" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="78" height="20" fill="#555"/><rect x="78" width="43" height="20" fill="#4c1"/><rect width="121" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><image x="5" y="3" width="14" height="14" href="data:image/svg+xml;base64,PHN2ZyBmaWxsPSJ3aGl0ZXNtb2tlIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3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LjE2LjE1Mi4wNTYuMzEyLjA5OC40NzkuMTI2LS4yNjQgMS40NzMuNDg2IDIuOTk0IDEuOTQ2IDMuNzQ1bC4yNjQuMTM5LjI4NC0uMTA0YzEuMjE2LS40MzEgMi4zNDItMS4xMzMgMy4zMzYtMi4wNzFhOS4zMzQgOS4zMzQgMCAwIDAgMS40NDUtMS43MTZjLjE2LjAyNy4zMi4wMzQuNDguMDM0YTMuMTE3IDMuMTE3IDAgMCAwIDMuMDA4LTIuMzI3aDEuMTY3YTMuMTA5IDMuMTA5IDAgMCAwIDMuMDEgMi4zMjdjLjU3NiAwIDEuMTEtLjE2IDEuNTctLjQzLjE4LjUyLjIzNiAxLjA2My4xMzkgMS42MDV6Ii8+PC9zdmc+"/><text aria-hidden="true" x="485" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="510">functions</text><text x="485" y="140" transform="scale(.1)" fill="#fff" textLength="510">functions</text><text aria-hidden="true" x="985" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="330">100%</text><text x="985" y="140" transform="scale(.1)" fill="#fff" textLength="330">100%</text></g></svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg"
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="155" height="20" role="img" aria-label="jest coverage: 96.35%"><title>jest coverage: 96.35%</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="155" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="102" height="20" fill="#555"/><rect x="102" width="53" height="20" fill="#4c1"/><rect width="155" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><image x="5" y="3" width="14" height="14" href="data:image/svg+xml;base64,PHN2ZyBmaWxsPSJ3aGl0ZXN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TIuMTY3LTEuMDE1LjYzMi0xLjk2NiAxLjA3Ny0yLjg3Ny4wMjgtLjA1NS4wNDktLjEwNC4wNzctLjE2LjE1Mi4wNTYuMzEyLjA5OC40NzkuMTI2LS4yNjQgMS40NzMuNDg2IDIuOTk0IDEuOTQ2IDMuNzQ1bC4yNjQuMTM5LjI4NC0uMTA0YzEuMjE2LS40MzEgMi4zNDItMS4xMzMgMy4zMzYtMi4wNzFhOS4zMzQgOS4zMzQgMCAwIDAgMS40NDUtMS43MTZjLjE2LjAyNy4zMi4wMzQuNDguMDM0YTMuMTE3IDMuMTE3IDAgMCAwIDMuMDA4LTIuMzI3aDEuMTY3YTMuMTA5IDMuMTA5IDAgMCAwIDMuMDEgMi4zMjdjLjU3NiAwIDEuMTEtLjE2IDEuNTctLjQzLjE4LjUyLjIzNiAxLjA2My4xMzkgMS42MDV6Ii8+PC9zdmc+"/><text aria-hidden="true" x="605" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="750">jest coverage</text><text x="605" y="140" transform="scale(.1)" fill="#fff" textLength="750">jest coverage</text><text aria-hidden="true" x="1275" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">96.35%</text><text x="1275" y="140" transform="scale(.1)" fill="#fff" textLength="430">96.35%</text></g></svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg"
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="105" height="20" role="img" aria-label="lines: 99.29%"><title>lines: 99.29%</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="105" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="52" height="20" fill="#555"/><rect x="52" width="53" height="20" fill="#4c1"/><rect width="105" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><image x="5" y="3" width="14" height="14" href="data:image/svg+xml;base64,PHN2ZyBmaWxsPSJ3aGl0ZXNtb2tlIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+SmVzdDwvdGl0bGU+PHBhdGggZD0iTTIyLjI1MSAxMS44MmEzLjExNyAzLjExNyAwIDAgMC0yLjMyOC0zLjAxTDIyLjkxMSAwSDguMTA0TDExLjEgOC44MzhhMy4xMTYgMy4xMTYgMCAwIDAtMi4yNDQgMi45ODhjMCAxLjA0My41MiAxLjk2NyAxLjMxMyAyLjUzNmE4LjI3OSA4LjI3OSAwIDAgMS0xLjA4NCAxLjI0NCA4LjE0IDguMTQgMCAwIDEtMi41NSAxLjY0N2MtLjgzNC0uNTYzLTEuMTk1LTEuNTU2LS44NjktMi40NDZhMy4xMSAzLjExIDAgMCAwLS45MS02LjA4IDMuMTE3IDMuMTE3IDAgMCAwLTMuMTEzIDMuMTEzYzAgLjg0OC4zNDcgMS42MjYuOTAzIDIuMTgyLS4wNDguMDk3LS4wOTcuMTk1LS4xNDYuMjk5LS40NjUuOTU5LS45OTMgMi4wNDMtMS4xOTUgMy4yNTktLjQwMyAyLjQzMi4yNTcgNC4zODQgMS44NDkgNS40ODlBNS4wOTMgNS4wOTMgMCAwIDAgNS45OTkgMjRjMS44MjcgMCAzLjY4Mi0uOTE3IDUuNDc1LTEuODA3IDEuMjc5LS42MzIgMi41OTktMS4yOTIgMy44OTgtMS42MTIuNDgtLjExOC45OC0uMTg3IDEuNTA4LS4yNjQgMS4wNy0uMTUzIDIuMTc1LS4zMTIgMy4xNjgtLjg5YTQuNDgyIDQuNDgyIDAgMCAwIDIuMTgyLTMuMDkxYy4xNzQtLjk5NCAwLTEuOTk0LS40NDQtMi44Ny4yOTgtLjQ4LjQ2NS0xLjA0Mi40NjUtMS42NDd6bS0xLjM1N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jQ1IDMuNjQ1IDAgMCAxLTIuMTU0LS42ODhjLTEuNTI5LTEuMDU2LTEuNDUzLTMuMDM2LTEuMjcyLTQuMTIuMTY3LTEuMDE1LjYzMi0xLjk2NiAxLjA3Ny0yLjg3Ny4wMjgtLjA1NS4wNDktLjEwNC4wNzctLjE2LjE1Mi4wNTYuMzEyLjA5OC40NzkuMTI2LS4yNjQgMS40NzMuNDg2IDIuOTk0IDEuOTQ2IDMuNzQ1bC4yNjQuMTM5LjI4NC0uMTA0YzEuMjE2LS40MzEgMi4zNDItMS4xMzMgMy4zMzYtMi4wNzFhOS4zMzQgOS4zMzQgMCAwIDAgMS40NDUtMS43MTZjLjE2LjAyNy4zMi4wMzQuNDguMDM0YTMuMTE3IDMuMTE3IDAgMCAwIDMuMDA4LTIuMzI3aDEuMTY3YTMuMTA5IDMuMTA5IDAgMCAwIDMuMDEgMi4zMjdjLjU3NiAwIDEuMTEtLjE2IDEuNTctLjQzLjE4LjUyLjIzNiAxLjA2My4xMzkgMS42MDV6Ii8+PC9zdmc+"/><text aria-hidden="true" x="355" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="250">lines</text><text x="355" y="140" transform="scale(.1)" fill="#fff" textLength="250">lines</text><text aria-hidden="true" x="775" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">99.29%</text><text x="775" y="140" transform="scale(.1)" fill="#fff" textLength="430">99.29%</text></g></svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg"
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="141" height="20" role="img" aria-label="statements: 99.36%"><title>statements: 99.36%</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="141" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="88" height="20" fill="#555"/><rect x="88" width="53" height="20" fill="#4c1"/><rect width="141" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><image x="5" y="3" width="14" height="14" href="data:image/svg+xml;base64,PHN2ZyBmaWxsPSJ3aGl0ZXNtb2tlIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+SmVzdDwvdGl0bGU+PHBhdGggZD0iTTIyLjI1MSAxMS44MmEzLjExNyAzLjExNyAwIDAgMC0yLjMyOC0zLjAxTDIyLjkxMSAwSDguMTA0TDExLjEgOC44MzhhMy4xMTYgMy4xMTYgMCAwIDAtMi4yNDQgMi45ODhjMCAxLjA0My41MiAxLjk2NyAxLjMxMyAyLjUzNmE4LjI3OSA4LjI3OSAwIDAgMS0xLjA4NCAxLjI0NCA4LjE0IDguMTQgMCAwIDEtMi41NSAxLjY0N2MtLjgzNC0uNTYzLTEuMTk1LTEuNTU2LS44NjktMi40NDZhMy4xMSAzLjExIDAgMCAwLS45MS02LjA4IDMuMTE3IDMuMTE3IDAgMCAwLTMuMTEzIDMuMTEzYzAgLjg0OC4zNDcgMS42MjYuOTAzIDIuMTgyLS4wNDguMDk3LS4wOTcuMTk1LS4xNDYuMjk5LS40NjUuOTU5LS45OTMgMi4wNDMtMS4xOTUgMy4yNTktLjQwMyAyLjQzMi4yNTcgNC4zODQgMS44NDkgNS40ODlBNS4wOTMgNS4wOTMgMCAwIDAgNS45OTkgMjRjMS44MjcgMCAzLjY4Mi0uOTE3IDUuNDc1LTEuODA3IDEuMjc5LS42MzIgMi41OTktMS4yOTIgMy44OTgtMS42MTIuNDgtLjExOC45OC0uMTg3IDEuNTA4LS4yNjQgMS4wNy0uMTUzIDIuMTc1LS4zMTIgMy4xNjgtLjg5YTQuNDgyIDQuNDgyIDAgMCAwIDIuMTgyLTMuMDkxYy4xNzQtLjk5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U1LTIuODM0IDEuMDUtNC4xODIgMS43MTctMS43MjQuODU0LTMuMzUgMS42Ni00Ljg1NyAxLjY2YTMuNjQ1IDMuNjQ1IDAgMCAxLTIuMTU0LS42ODhjLTEuNTI5LTEuMDU2LTEuNDUzLTMuMDM2LTEuMjcyLTQuMTIuMTY3LTEuMDE1LjYzMi0xLjk2NiAxLjA3Ny0yLjg3Ny4wMjgtLjA1NS4wNDktLjEwNC4wNzctLjE2LjE1Mi4wNTYuMzEyLjA5OC40NzkuMTI2LS4yNjQgMS40NzMuNDg2IDIuOTk0IDEuOTQ2IDMuNzQ1bC4yNjQuMTM5LjI4NC0uMTA0YzEuMjE2LS40MzEgMi4zNDItMS4xMzMgMy4zMzYtMi4wNzFhOS4zMzQgOS4zMzQgMCAwIDAgMS40NDUtMS43MTZjLjE2LjAyNy4zMi4wMzQuNDguMDM0YTMuMTE3IDMuMTE3IDAgMCAwIDMuMDA4LTIuMzI3aDEuMTY3YTMuMTA5IDMuMTA5IDAgMCAwIDMuMDEgMi4zMjdjLjU3NiAwIDEuMTEtLjE2IDEuNTctLjQzLjE4LjUyLjIzNiAxLjA2My4xMzkgMS42MDV6Ii8+PC9zdmc+"/><text aria-hidden="true" x="535" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="610">statements</text><text x="535" y="140" transform="scale(.1)" fill="#fff" textLength="610">statements</text><text aria-hidden="true" x="1135" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">99.36%</text><text x="1135" y="140" transform="scale(.1)" fill="#fff" textLength="430">99.36%</text></g></svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg"
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="155" height="20" role="img" aria-label="jest coverage: 96.35%"><title>jest coverage: 96.35%</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="155" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="102" height="20" fill="#555"/><rect x="102" width="53" height="20" fill="#4c1"/><rect width="155" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><image x="5" y="3" width="14" height="14" href="data:image/svg+xml;base64,PHN2ZyBmaWxsPSJ3aGl0ZXNtb2tlIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+SmVzdDwvdGl0bGU+PHBhdGggZD0iTTIyLjI1MSAxMS44MmEzLjExNyAzLjExNyAwIDAgMC0yLjMyOC0zLjAxTDIyLjkxMSAwSDguMTA0TDExLjEgOC44MzhhMy4xMTYgMy4xMTYgMCAwIDAtMi4yNDQgMi45ODhjMCAxLjA0My41MiAxLjk2NyAxLjMxMyAyLjUzNmE4LjI3OSA4LjI3OSAwIDAgMS0xLjA4NCAxLjI0NCA4LjE0IDguMTQgMCAwIDEtMi41NSAxLjY0N2MtLjgzNC0uNTYzLTEuMTk1LTEuNTU2LS44NjktMi40NDZhMy4xMSAzLjExIDAgMCAwLS45MS02LjA4IDMuMTE3IDMuMTE3IDAgMCAwLTMuMTEzIDMuMTEzYzAgLjg0OC4zNDcgMS42MjYuOTAzIDIuMTgyLS4wNDguMDk3LS4wOTcuMTk1LS4xNDYuMjk5LS40NjUuOTU5LS45OTMgMi4wNDMtMS4xOTUgMy4yNTktLjQwMyAyLjQzMi4yNTcgNC4zODQgMS44NDkgNS40ODlBNS4wOTMgNS4wOTMgMCAwIDAgNS45OTkgMjRjMS44MjcgMCAzLjY4Mi0uOTE3IDUuNDc1LTEuODA3IDEuMjc5LS42MzIgMi41OTktMS4yOTIgMy44OTgtMS42MTIuNDgtLjExOC45OC0uMTg3IDEuNTA4LS4yNjQgMS4wNy0uMTU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jc1OC40MzgtMS42ODkuNTc3LTIuNjY5LjcxNmExNy4yOSAxNy4yOSAwIDAgMC0xLjY0LjI5MWMtMS40NDUuMzU1LTIuODM0IDEuMDUtNC4xODIgMS43MTctMS43MjQuODU0LTMuMzUgMS42Ni00Ljg1NyAxLjY2YTMuNjQ1IDMuNjQ1IDAgMCAxLTIuMTU0LS42ODhjLTEuNTI5LTEuMDU2LTEuNDUzLTMuMDM2LTEuMjcyLTQuMTIuMTY3LTEuMDE1LjYzMi0xLjk2NiAxLjA3Ny0yLjg3Ny4wMjgtLjA1NS4wNDktLjEwNC4wNzctLjE2LjE1Mi4wNTYuMzEyLjA5OC40NzkuMTI2LS4yNjQgMS40NzMuNDg2IDIuOTk0IDEuOTQ2IDMuNzQ1bC4yNjQuMTM5LjI4NC0uMTA0YzEuMjE2LS40MzEgMi4zNDItMS4xMzMgMy4zMzYtMi4wNzFhOS4zMzQgOS4zMzQgMCAwIDAgMS40NDUtMS43MTZjLjE2LjAyNy4zMi4wMzQuNDguMDM0YTMuMTE3IDMuMTE3IDAgMCAwIDMuMDA4LTIuMzI3aDEuMTY3YTMuMTA5IDMuMTA5IDAgMCAwIDMuMDEgMi4zMjdjLjU3NiAwIDEuMTEtLjE2IDEuNTctLjQzLjE4LjUyLjIzNiAxLjA2My4xMzkgMS42MDV6Ii8+PC9zdmc+"/><text aria-hidden="true" x="605" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="750">jest coverage</text><text x="605" y="140" transform="scale(.1)" fill="#fff" textLength="750">jest coverage</text><text aria-hidden="true" x="1275" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">96.35%</text><text x="1275" y="140" transform="scale(.1)" fill="#fff" textLength="430">96.35%</text></g></svg>
|
package/README.md
CHANGED
|
@@ -24,7 +24,50 @@ Next, install `eslint-plugin-sort-decorators`:
|
|
|
24
24
|
npm i --save-dev eslint-plugin-sort-decorators
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
## Usage
|
|
27
|
+
## Usage - Flat Config (Eslint >= 9)
|
|
28
|
+
|
|
29
|
+
As this plugin only works with _typescript_,
|
|
30
|
+
the parser must be set:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import * as tsParser from "@typescript-eslint/parser"
|
|
34
|
+
import eslintSortDecorators from "eslint-plugin-sort-decorators";
|
|
35
|
+
|
|
36
|
+
export default [
|
|
37
|
+
// other configurations
|
|
38
|
+
{
|
|
39
|
+
files: ["**/*.ts"],
|
|
40
|
+
plugins: { "sort-decorators": eslintSortDecorators },
|
|
41
|
+
languageOptions: { parser: tsParser },
|
|
42
|
+
|
|
43
|
+
rules: {
|
|
44
|
+
'sort-decorators/sort-on-classes': 'error',
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
// other configurations
|
|
48
|
+
]
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Or simply use a configuration preset:
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
import eslintSortDecorators from "eslint-plugin-sort-decorators";
|
|
55
|
+
|
|
56
|
+
export default [
|
|
57
|
+
// other configurations
|
|
58
|
+
eslintSortDecorators.configs["flat/recommended"],
|
|
59
|
+
// other configurations
|
|
60
|
+
]
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Configuration presets (Flat config)
|
|
64
|
+
|
|
65
|
+
| Name | Description |
|
|
66
|
+
|:-------------------------------------|:---------------------------------------------------------------|
|
|
67
|
+
| `plugin:sort-decorators/flat/recommended` | Enables all rules with a `warn` security level. |
|
|
68
|
+
| `plugin:sort-decorators/flat/strict` | Enables all rules with a `error` security level and `autoFix`. |
|
|
69
|
+
|
|
70
|
+
## Usage - Legacy (Eslint < 9)
|
|
28
71
|
|
|
29
72
|
As this plugin only works with _typescript_,
|
|
30
73
|
the parser must be set in a [.eslintrc](https://eslint.org/docs/latest/use/configure/configuration-files#configuration-file-formats)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import * as eslint from 'eslint';
|
|
2
|
+
import { ESLintUtils, TSESLint } from '@typescript-eslint/utils';
|
|
3
|
+
import * as tsParser from '@typescript-eslint/parser';
|
|
4
|
+
|
|
5
|
+
type SortRuleMessageIds = "incorrect-order";
|
|
6
|
+
|
|
7
|
+
interface SortRuleOptions {
|
|
8
|
+
autoFix?: boolean;
|
|
9
|
+
caseSensitive?: boolean;
|
|
10
|
+
direction?: "asc" | "desc";
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type SortRule = ESLintUtils.RuleWithMetaAndName<[SortRuleOptions], SortRuleMessageIds>;
|
|
14
|
+
interface SortRuleParams {
|
|
15
|
+
createRule: SortRule["create"];
|
|
16
|
+
description: SortRule["meta"]["docs"]["description"];
|
|
17
|
+
name: SortRule["name"];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare const plugin: {
|
|
21
|
+
configs: {
|
|
22
|
+
recommended: {
|
|
23
|
+
readonly parser: "@typescript-eslint/parser";
|
|
24
|
+
readonly plugins: ["sort-decorators"];
|
|
25
|
+
readonly rules: {
|
|
26
|
+
readonly "sort-decorators/sort-on-accessors": eslint.Linter.RuleEntry<[SortRuleParams]>;
|
|
27
|
+
readonly "sort-decorators/sort-on-classes": eslint.Linter.RuleEntry<[SortRuleParams]>;
|
|
28
|
+
readonly "sort-decorators/sort-on-methods": eslint.Linter.RuleEntry<[SortRuleParams]>;
|
|
29
|
+
readonly "sort-decorators/sort-on-parameters": eslint.Linter.RuleEntry<[SortRuleParams]>;
|
|
30
|
+
readonly "sort-decorators/sort-on-properties": eslint.Linter.RuleEntry<[SortRuleParams]>;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
strict: {
|
|
34
|
+
readonly parser: "@typescript-eslint/parser";
|
|
35
|
+
readonly plugins: ["sort-decorators"];
|
|
36
|
+
readonly rules: {
|
|
37
|
+
readonly "sort-decorators/sort-on-accessors": eslint.Linter.RuleEntry<[SortRuleParams]>;
|
|
38
|
+
readonly "sort-decorators/sort-on-classes": eslint.Linter.RuleEntry<[SortRuleParams]>;
|
|
39
|
+
readonly "sort-decorators/sort-on-methods": eslint.Linter.RuleEntry<[SortRuleParams]>;
|
|
40
|
+
readonly "sort-decorators/sort-on-parameters": eslint.Linter.RuleEntry<[SortRuleParams]>;
|
|
41
|
+
readonly "sort-decorators/sort-on-properties": eslint.Linter.RuleEntry<[SortRuleParams]>;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
"flat/recommended": {
|
|
45
|
+
readonly files: ["**/*.ts", "**/*.tsx"];
|
|
46
|
+
readonly languageOptions: {
|
|
47
|
+
readonly parser: typeof tsParser;
|
|
48
|
+
};
|
|
49
|
+
readonly plugins: undefined;
|
|
50
|
+
readonly rules: {
|
|
51
|
+
readonly "sort-decorators/sort-on-accessors": eslint.Linter.RuleEntry<[SortRuleParams]>;
|
|
52
|
+
readonly "sort-decorators/sort-on-classes": eslint.Linter.RuleEntry<[SortRuleParams]>;
|
|
53
|
+
readonly "sort-decorators/sort-on-methods": eslint.Linter.RuleEntry<[SortRuleParams]>;
|
|
54
|
+
readonly "sort-decorators/sort-on-parameters": eslint.Linter.RuleEntry<[SortRuleParams]>;
|
|
55
|
+
readonly "sort-decorators/sort-on-properties": eslint.Linter.RuleEntry<[SortRuleParams]>;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
"flat/strict": {
|
|
59
|
+
readonly files: ["**/*.ts", "**/*.tsx"];
|
|
60
|
+
readonly languageOptions: {
|
|
61
|
+
readonly parser: typeof tsParser;
|
|
62
|
+
};
|
|
63
|
+
readonly plugins: undefined;
|
|
64
|
+
readonly rules: {
|
|
65
|
+
readonly "sort-decorators/sort-on-accessors": eslint.Linter.RuleEntry<[SortRuleParams]>;
|
|
66
|
+
readonly "sort-decorators/sort-on-classes": eslint.Linter.RuleEntry<[SortRuleParams]>;
|
|
67
|
+
readonly "sort-decorators/sort-on-methods": eslint.Linter.RuleEntry<[SortRuleParams]>;
|
|
68
|
+
readonly "sort-decorators/sort-on-parameters": eslint.Linter.RuleEntry<[SortRuleParams]>;
|
|
69
|
+
readonly "sort-decorators/sort-on-properties": eslint.Linter.RuleEntry<[SortRuleParams]>;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
rules: {
|
|
74
|
+
"sort-on-accessors": TSESLint.RuleModule<"incorrect-order", [SortRuleOptions], {
|
|
75
|
+
requiresTypeChecking: boolean;
|
|
76
|
+
}, TSESLint.RuleListener> & {
|
|
77
|
+
name: string;
|
|
78
|
+
};
|
|
79
|
+
"sort-on-classes": TSESLint.RuleModule<"incorrect-order", [SortRuleOptions], {
|
|
80
|
+
requiresTypeChecking: boolean;
|
|
81
|
+
}, TSESLint.RuleListener> & {
|
|
82
|
+
name: string;
|
|
83
|
+
};
|
|
84
|
+
"sort-on-methods": TSESLint.RuleModule<"incorrect-order", [SortRuleOptions], {
|
|
85
|
+
requiresTypeChecking: boolean;
|
|
86
|
+
}, TSESLint.RuleListener> & {
|
|
87
|
+
name: string;
|
|
88
|
+
};
|
|
89
|
+
"sort-on-parameters": TSESLint.RuleModule<"incorrect-order", [SortRuleOptions], {
|
|
90
|
+
requiresTypeChecking: boolean;
|
|
91
|
+
}, TSESLint.RuleListener> & {
|
|
92
|
+
name: string;
|
|
93
|
+
};
|
|
94
|
+
"sort-on-properties": TSESLint.RuleModule<"incorrect-order", [SortRuleOptions], {
|
|
95
|
+
requiresTypeChecking: boolean;
|
|
96
|
+
}, TSESLint.RuleListener> & {
|
|
97
|
+
name: string;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export { plugin as default };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function
|
|
1
|
+
"use strict";function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(e){if(Array.isArray(e))return e}function t(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function n(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function o(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var o=true;var i=false;var a,c;try{for(t=t.call(e);!(o=(a=t.next()).done);o=true){n.push(a.value);if(r&&n.length===r)break}}catch(e){i=true;c=e}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(i)throw c}}return n}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};var o=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}o.forEach(function(r){t(e,r,n[r])})}return e}function c(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(r){n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})}t.push.apply(t,n)}return t}function u(e,r){r=r!=null?r:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(r))}else{c(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e,r){if(e==null)return{};var t={},n,o,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){n=Reflect.ownKeys(e);for(i=0;i<n.length;i++){o=n[i];if(r.indexOf(o)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,o))continue;t[o]=e[o]}return t}t=f(e,r);if(Object.getOwnPropertySymbols){n=Object.getOwnPropertySymbols(e);for(i=0;i<n.length;i++){o=n[i];if(r.indexOf(o)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,o))continue;t[o]=e[o]}}return t}function f(e,r){if(e==null)return{};var t={},n=Object.getOwnPropertyNames(e),o,i;for(i=0;i<n.length;i++){o=n[i];if(r.indexOf(o)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,o))continue;t[o]=e[o]}return t}function l(e,t){return r(e)||o(e,t)||p(e,t)||i()}function d(e){return r(e)||n(e)||p(e)||i()}function p(r,t){if(!r)return;if(typeof r==="string")return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor)n=r.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}var v=require("@typescript-eslint/parser"),y=require("@typescript-eslint/utils");function m(e){if(e&&e.__esModule)return e;var r=Object.create(null);if(e){Object.keys(e).forEach(function(t){if(t!=="default"){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:true,get:function r(){return e[t]}})}})}r.default=e;return Object.freeze(r)}var b=m(v);var O={$schema:"http://json-schema.org/draft-07/schema#",additionalProperties:false,description:"Options for the sort rule",properties:{autoFix:{default:false,description:"Automatically fix the order.\nWhen set to `true`, only one error is reported and the whole set of decorators is fixed.",type:"boolean"},caseSensitive:{default:true,description:"If true, enforce properties to be in case-sensitive order.",type:"boolean"},direction:{default:"asc",description:"Specify the direction of the ordering.",enum:["asc","desc"],type:"string"}},type:"object"};var g=y.ESLintUtils.RuleCreator(function(e){return e});function h(e){return g({create:e.createRule,defaultOptions:[{autoFix:false,caseSensitive:true,direction:"asc"}],meta:{schema:[O],docs:{description:e.description,requiresTypeChecking:false},fixable:"code",messages:{"incorrect-order":"Expected decorators to be in sorted order. `@{{ after }}` should be before `@{{ previous }}`."},type:"layout"},name:e.name})}function S(e){var r=function e(e){switch(e.type){case y.TSESTree.AST_NODE_TYPES.CallExpression:return r(e.callee);case y.TSESTree.AST_NODE_TYPES.Identifier:return e.name}throw new Error("Not a valid decorator.")};return r(e.expression)}function E(e,r,t){var n=t.autoFix,o=t.caseSensitive,i=t.direction,a=function e(e){var r=S(e);return o?r:r.toLowerCase()},c=function e(e,r){var t;return t=l(i==="desc"?[r,e]:[e,r],2),e=t[0],r=t[1],t,e===r?0:e<r?-1:1},u=r.map(function(e){return{name:a(e),node:e}}),s=function r(r,t){var n=e.sourceCode,o=n.getText(),i=t.slice().sort(function(e,r){var t=e.name,n=r.name;return c(t,n)}).map(function(e){var r=e.node;return r}),a=i.map(function(e,r){var a=r===i.length-1?"":o.slice(t[r].node.range[1],t[r+1].node.range[0]);return n.getText(e)+a});return r.replaceTextRange([t[0].node.range[0],t[t.length-1].node.range[1]],a.join(""))},f=function r(r){if(r.length<=1)return;var t=d(r),o=t[0],i=o.name,a=t.slice(1);var u=true,l=false,p=undefined;try{for(var v=a[Symbol.iterator](),y;!(u=(y=v.next()).done);u=true){var m=y.value,b=m.name,O=m.node;if(c(i,b)>0){e.report({data:{after:b,previous:i},fix:n?function(e){return s(e,r)}:void 0,messageId:"incorrect-order",node:O});return}}}catch(e){l=true;p=e}finally{try{if(!u&&v.return!=null){v.return()}}finally{if(l){throw p}}}n&&f(r.slice(1))};f(u)}var j="sort-on-accessors",x=h({createRule:function e(e,r){var t=l(r,1),n=t[0];var o=n.autoFix,i=function e(e){var r=e.parent;return(r===null||r===void 0?void 0:r.type)===y.AST_NODE_TYPES.MethodDefinition&&r.kind==="get"?r:false};return o?{Decorator:function r(r){var t=i(r);if(!t)return;var o=t.decorators;o[0]===r&&E(e,o,n)}}:{Decorator:function r(r){var t=i(r);if(!t)return;var o=t.decorators,a=o.findIndex(function(e){return e===r});E(e,o.slice(a),n)}}},description:"Enforces order of accessors decorators",name:j});var P="sort-on-classes",D=h({createRule:function e(e,r){var t=l(r,1),n=t[0];var o=n.autoFix;return o?{ClassDeclaration:function r(r){var t=r.decorators;E(e,t!==null&&t!==void 0?t:[],n)}}:{Decorator:function r(r){var t=r.parent;if((t===null||t===void 0?void 0:t.type)!==y.AST_NODE_TYPES.ClassDeclaration)return;var o=t.decorators,i=o.findIndex(function(e){return e===r});E(e,o.slice(i),n)}}},description:"Enforces order of class decorators",name:P});var T="sort-on-methods",w=h({createRule:function e(e,r){var t=l(r,1),n=t[0];var o=n.autoFix;return o?{MethodDefinition:function r(r){var t=r.decorators,o=r.kind;o==="method"&&E(e,t!==null&&t!==void 0?t:[],n)}}:{Decorator:function r(r){var t=r.parent;if((t===null||t===void 0?void 0:t.type)!==y.AST_NODE_TYPES.MethodDefinition)return;var o=t.decorators,i=o.findIndex(function(e){return e===r});E(e,o.slice(i),n)}}},description:"Enforces order of methods decorators",name:T});var _="sort-on-parameters",A=h({createRule:function e(e,r){var t=l(r,1),n=t[0];var o=n.autoFix,i=function e(e){var r;var t=e.parent;return(t===null||t===void 0?void 0:t.type)===y.AST_NODE_TYPES.TSParameterProperty||(t===null||t===void 0?void 0:t.type)===y.AST_NODE_TYPES.Identifier&&((r=t.parent)===null||r===void 0?void 0:r.type)===y.AST_NODE_TYPES.FunctionExpression?t:false};return o?{Decorator:function r(r){var t=i(r);if(!t)return;var o=t.decorators;o[0]===r&&E(e,o,n)}}:{Decorator:function r(r){var t=i(r);if(!t)return;var o=t.decorators,a=o.findIndex(function(e){return e===r});E(e,o.slice(a),n)}}},description:"Enforces order of parameters decorators",name:_});var I="sort-on-properties",N=h({createRule:function e(e,r){var t=l(r,1),n=t[0];var o=n.autoFix;return o?{PropertyDefinition:function r(r){var t=r.decorators;E(e,t!==null&&t!==void 0?t:[],n)}}:{Decorator:function r(r){var t=r.parent;if((t===null||t===void 0?void 0:t.type)!==y.AST_NODE_TYPES.PropertyDefinition)return;var o=t.decorators,i=o.findIndex(function(e){return e===r});E(e,o.slice(i),n)}}},description:"Enforces order of properties decorators",name:I});var R="sort-decorators";function F(e){var r;return{parser:"@typescript-eslint/parser",plugins:[R],rules:(r={},t(r,"".concat(R,"/").concat(j),e),t(r,"".concat(R,"/").concat(P),e),t(r,"".concat(R,"/").concat(T),e),t(r,"".concat(R,"/").concat(_),e),t(r,"".concat(R,"/").concat(I),e),r)}}var Y=F("warn");var C=F(["error",{autoFix:true}]);function k(e){var r=e.parser,t=s(e,["parser"]);return u(a({},t),{files:["**/*.ts","**/*.tsx"],languageOptions:{parser:b},plugins:void 0})}var M;var q={configs:{recommended:Y,strict:C,"flat/recommended":k(Y),"flat/strict":k(C)},rules:(M={},t(M,j,x),t(M,P,D),t(M,T,w),t(M,_,A),t(M,I,N),M)};q.configs["flat/recommended"].plugins=q.configs["flat/strict"].plugins=t({},R,q);var K=q;module.exports=K;//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/rules/sort-on-accessors.ts","../src/lib/sort-rule/sort-rule.ts","../src/lib/sort-rule/sort-rule.options.schema.json","../src/lib/decorator/get-decorator-name.ts","../src/lib/sort-rule/sort-rule.listener.ts","../src/rules/sort-on-classes.ts","../src/rules/sort-on-methods.ts","../src/rules/sort-on-parameters.ts","../src/rules/sort-on-properties.ts","../src/configs/common.ts","../src/configs/recommended.ts","../src/configs/strict.ts","../src/index.ts"],"names":["AST_NODE_TYPES","ESLintUtils","sort_rule_options_schema_default","sortRuleCreator","name","createSortRule","rule","getDecoratorName","decorator","getName","expression","sortRuleListener","context","decorators","options","autoFix","caseSensitive","direction","compare","a","b","decoratorsWithName","createFix","fixer","sourceCode","sourceText","sorted","node","newText","child","i","textAfter","sortRule","currentName","remaining","SORT_ON_ACCESSORS_NAME","sortOnAccessors","optionsWithDefault","getDecorated","parent","nodeIndex","SORT_ON_CLASSES_NAME","sortOnClasses","SORT_ON_METHODS_NAME","sortOnMethods","kind","SORT_ON_PARAMETERS_NAME","sortOnParameters","SORT_ON_PROPERTIES_NAME","sortOnProperties","PLUGIN_NAME","createConfiguration","ruleEntry","recommended","strict","src_default"],"mappings":"AAAA,OAAS,kBAAAA,MAAsB,2BCA/B,OAAS,eAAAC,MAA6B,2BCAtC,I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ACN,CAAC,GAAGA,CAAW,IAAIf,CAAsB,EAAE,EAAGiB,EAC9C,CAAC,GAAGF,CAAW,IAAIT,CAAoB,EAAE,EAAGW,EAC5C,CAAC,GAAGF,CAAW,IAAIP,CAAoB,EAAE,EAAGS,EAC5C,CAAC,GAAGF,CAAW,IAAIJ,CAAuB,EAAE,EAAGM,EAC/C,CAAC,GAAGF,CAAW,IAAIF,CAAuB,EAAE,EAAGI,CAChD,CACD,CACD,CC5BO,IAAMC,EAAcF,EAAoB,MAAM,ECA9C,IAAMG,EAASH,EAAoB,CAAC,QAAS,CAAE,QAAS,EAAK,CAAC,CAAC,ECctE,IAAOI,GAAQ,CACd,QAAS,CACR,YAAqBF,EACrB,OAAgBC,CACjB,EACA,MAAO,CACN,CAACnB,CAAsB,EAAGC,EAC1B,CAACK,CAAoB,EAAGC,EACxB,CAACC,CAAoB,EAAGC,EACxB,CAACE,CAAuB,EAAGC,EAC3B,CAACC,CAAuB,EAAGC,CAC5B,CACD","sourcesContent":["import { AST_NODE_TYPES } from \"@typescript-eslint/types\";\nimport { TSESTree } from \"@typescript-eslint/utils\";\n\nimport { createSortRule, sortRuleListener } from \"../lib/sort-rule\";\n\nexport const SORT_ON_ACCESSORS_NAME = \"sort-on-accessors\";\n\nexport const sortOnAccessors = createSortRule({\n\tcreate: (context, [optionsWithDefault]) => {\n\t\tconst { autoFix } = optionsWithDefault;\n\n\t\tconst getDecorated = (node: TSESTree.Decorator) => {\n\t\t\tconst { parent } = node;\n\n\t\t\t// Only get the decorated node, if it is an accessor\n\t\t\tif (parent?.type === AST_NODE_TYPES.MethodDefinition && parent.kind === \"get\") {\n\t\t\t\treturn parent;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t};\n\n\t\treturn autoFix\n\t\t\t? {\n\t\t\t\t\t// TODO: a selector for the accessors only\n\t\t\t\t\tDecorator(node) {\n\t\t\t\t\t\tconst parent = getDecorated(node);\n\t\t\t\t\t\tif (!parent) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- the current node comes from there\n\t\t\t\t\t\tconst decorators = parent.decorators!;\n\n\t\t\t\t\t\t// Run the listener only when on the first node\n\t\t\t\t\t\tif (decorators[0] === node) {\n\t\t\t\t\t\t\tsortRuleListener(context, decorators, optionsWithDefault);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t }\n\t\t\t: {\n\t\t\t\t\tDecorator(node) {\n\t\t\t\t\t\tconst parent = getDecorated(node);\n\t\t\t\t\t\tif (!parent) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- the current node comes from there\n\t\t\t\t\t\tconst decorators = parent.decorators!;\n\n\t\t\t\t\t\t// Get only the decorators after the current one\n\t\t\t\t\t\tconst nodeIndex = decorators.findIndex(decorator => decorator === node);\n\t\t\t\t\t\tsortRuleListener(context, decorators.slice(nodeIndex), optionsWithDefault);\n\t\t\t\t\t}\n\t\t\t };\n\t},\n\tmeta: {\n\t\tdocs: {\n\t\t\tdescription: \"Enforces order of accessors decorators\"\n\t\t}\n\t},\n\tname: SORT_ON_ACCESSORS_NAME\n});\n","import { ESLintUtils, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { SortRuleMessageIds } from \"./sort-rule.message-ids\";\nimport { SortRuleOptions } from \"./sort-rule.options\";\nimport schema from \"./sort-rule.options.schema.json\";\n\ntype SortRule = ESLintUtils.RuleWithMetaAndName<\n\t[SortRuleOptions],\n\tSortRuleMessageIds,\n\tTSESLint.RuleListener\n>;\n\ninterface SortRuleMeta\n\textends Omit<SortRule[\"meta\"], \"docs\" | \"fixable\" | \"messages\" | \"schema\" | \"type\"> {\n\tdocs: Omit<SortRule[\"meta\"][\"docs\"], \"recommended\">;\n}\n\n/**\n * The information to create a \"sort-decorators\" rule\n */\nexport interface SortRuleWithMetaAndName extends Omit<SortRule, \"defaultOptions\" | \"meta\"> {\n\tmeta: SortRuleMeta;\n}\n\nconst sortRuleCreator = ESLintUtils.RuleCreator(name => name);\n\n/**\n * @param rule the parameter to create a rule\n * @returns the created rule\n */\nexport function createSortRule(rule: SortRuleWithMetaAndName) {\n\treturn sortRuleCreator({\n\t\t...rule,\n\t\tdefaultOptions: [{ autoFix: false, caseSensitive: true, direction: \"asc\" }],\n\t\tmeta: {\n\t\t\tschema: [schema],\n\n\t\t\t...rule.meta,\n\t\t\tdocs: {\n\t\t\t\trequiresTypeChecking: false,\n\n\t\t\t\t...rule.meta.docs,\n\t\t\t\trecommended: \"warn\"\n\t\t\t},\n\t\t\tfixable: \"code\",\n\t\t\tmessages: {\n\t\t\t\t\"incorrect-order\":\n\t\t\t\t\t\"Expected decorators to be in sorted order. `@{{ after }}` should be before `@{{ previous }}`.\"\n\t\t\t},\n\t\t\ttype: \"layout\"\n\t\t}\n\t});\n}\n","{\n\t\"$schema\": \"http://json-schema.org/draft-07/schema#\",\n\t\"additionalProperties\": false,\n\t\"properties\": {\n\t\t\"autoFix\": {\n\t\t\t\"default\": false,\n\t\t\t\"description\": \"Automatically fix the order.\\nWhen set to `true`, only one error is reported and the whole set of decorators is fixed.\",\n\t\t\t\"type\": \"boolean\"\n\t\t},\n\t\t\"caseSensitive\": {\n\t\t\t\"default\": true,\n\t\t\t\"description\": \"If true, enforce properties to be in case-sensitive order.\",\n\t\t\t\"type\": \"boolean\"\n\t\t},\n\t\t\"direction\": {\n\t\t\t\"default\": \"asc\",\n\t\t\t\"description\": \"Specify the direction of the ordering.\",\n\t\t\t\"enum\": [\"asc\", \"desc\"],\n\t\t\t\"type\": \"string\"\n\t\t}\n\t},\n\t\"type\": \"object\"\n}\n","import { LeftHandSideExpression } from \"@typescript-eslint/types/dist/generated/ast-spec\";\nimport { AST_NODE_TYPES, TSESTree } from \"@typescript-eslint/utils\";\n\n/**\n * @param decorator the decorator node to get the name from\n * @returns the name of the given decorator\n */\nexport function getDecoratorName(decorator: TSESTree.Decorator): string {\n\tconst getName = (expression: LeftHandSideExpression): string => {\n\t\tswitch (expression.type) {\n\t\t\tcase AST_NODE_TYPES.CallExpression:\n\t\t\t\treturn getName(expression.callee);\n\n\t\t\tcase AST_NODE_TYPES.Identifier:\n\t\t\t\treturn expression.name;\n\t\t}\n\n\t\tthrow new Error(\"Not a valid decorator.\");\n\t};\n\n\treturn getName(decorator.expression);\n}\n","import { TSESTree, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { SortRuleMessageIds } from \"./sort-rule.message-ids\";\nimport { SortRuleOptions } from \"./sort-rule.options\";\nimport { getDecoratorName } from \"../decorator\";\n\n/**\n * The rule listener for sorting the decorators\n *\n * @param context the context the rule is listening\n * @param decorators the decorators to test (and fix)\n * @param options the rule options\n */\nexport function sortRuleListener(\n\tcontext: TSESLint.RuleContext<SortRuleMessageIds, [SortRuleOptions]>,\n\tdecorators: TSESTree.Decorator[],\n\toptions: SortRuleOptions\n) {\n\tconst { autoFix, caseSensitive, direction } = options;\n\n\t// Get the name of a decorator given the options\n\tconst getName = (decorator: TSESTree.Decorator) => {\n\t\tconst name = getDecoratorName(decorator);\n\t\treturn caseSensitive ? name : name.toLowerCase();\n\t};\n\n\t// The comparator of names\n\tconst compare = (a: string, b: string) => {\n\t\t// swap parameters when the direction is reverted\n\t\t[a, b] = direction === \"desc\" ? [b, a] : [a, b];\n\n\t\t// `localCompare` messes with the upperCase\n\t\tif (a === b) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn a < b ? -1 : 1;\n\t};\n\n\t// Get the decorator names only once\n\tconst decoratorsWithName = decorators.map(decorator => ({\n\t\tname: getName(decorator),\n\t\tnode: decorator\n\t}));\n\n\tconst createFix = (fixer: TSESLint.RuleFixer, decorators: typeof decoratorsWithName) => {\n\t\t// Chunk of code strongly inspired from:\n\t\t// https://github.com/mthadley/eslint-plugin-sort-destructure-keys/blob/ccb0d52cb48a55668aff209e1cec4197a16bd23b/lib/rules/sort-destructure-keys.js#L158\n\n\t\tconst sourceCode = context.getSourceCode();\n\t\tconst sourceText = sourceCode.getText();\n\n\t\tconst sorted = decorators\n\t\t\t.slice()\n\t\t\t.sort(({ name: a }, { name: b }) => compare(a, b))\n\t\t\t.map(({ node }) => node);\n\n\t\tconst newText = sorted.map((child, i) => {\n\t\t\tconst textAfter =\n\t\t\t\ti === sorted.length - 1\n\t\t\t\t\t? // If it's the last item, there's no text after to append.\n\t\t\t\t\t \"\"\n\t\t\t\t\t: // Otherwise, we need to grab the text after the original node.\n\t\t\t\t\t sourceText.slice(\n\t\t\t\t\t\t\tdecorators[i].node.range[1], // End index of the current node .\n\t\t\t\t\t\t\tdecorators[i + 1].node.range[0] // Start index of the next node.\n\t\t\t\t\t );\n\n\t\t\treturn sourceCode.getText(child) + textAfter;\n\t\t});\n\n\t\treturn fixer.replaceTextRange(\n\t\t\t[decorators[0].node.range[0], decorators[decorators.length - 1].node.range[1]],\n\t\t\tnewText.join(\"\")\n\t\t);\n\t};\n\n\tconst sortRule = (decorators: typeof decoratorsWithName) => {\n\t\tif (decorators.length <= 1) {\n\t\t\t// Nothing to test when there is less than 1 decorator\n\t\t\treturn;\n\t\t}\n\n\t\tconst [{ name: currentName }, ...remaining] = decorators;\n\n\t\tfor (const { name, node } of remaining) {\n\t\t\tif (compare(currentName, name) > 0) {\n\t\t\t\tcontext.report({\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tafter: name,\n\t\t\t\t\t\tprevious: currentName\n\t\t\t\t\t},\n\t\t\t\t\tfix: autoFix ? fixer => createFix(fixer, decorators) : undefined,\n\t\t\t\t\tmessageId: \"incorrect-order\",\n\t\t\t\t\tnode\n\t\t\t\t});\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (autoFix) {\n\t\t\t// On autoFix, all decorators are tested to be able to fix them all\n\t\t\tsortRule(decorators.slice(1));\n\t\t}\n\t};\n\n\tsortRule(decoratorsWithName);\n}\n","import { AST_NODE_TYPES } from \"@typescript-eslint/types\";\n\nimport { createSortRule, sortRuleListener } from \"../lib/sort-rule\";\n\nexport const SORT_ON_CLASSES_NAME = \"sort-on-classes\";\n\nexport const sortOnClasses = createSortRule({\n\tcreate: (context, [optionsWithDefault]) => {\n\t\tconst { autoFix } = optionsWithDefault;\n\n\t\treturn autoFix\n\t\t\t? {\n\t\t\t\t\tClassDeclaration({ decorators }) {\n\t\t\t\t\t\tsortRuleListener(context, decorators ?? [], optionsWithDefault);\n\t\t\t\t\t}\n\t\t\t }\n\t\t\t: {\n\t\t\t\t\tDecorator(node) {\n\t\t\t\t\t\tconst { parent } = node;\n\t\t\t\t\t\tif (parent?.type !== AST_NODE_TYPES.ClassDeclaration) {\n\t\t\t\t\t\t\t// Only for classes decorators\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- the current node comes from there\n\t\t\t\t\t\tconst decorators = parent.decorators!;\n\n\t\t\t\t\t\t// Get only the decorators after the current one\n\t\t\t\t\t\tconst nodeIndex = decorators.findIndex(decorator => decorator === node);\n\t\t\t\t\t\tsortRuleListener(context, decorators.slice(nodeIndex), optionsWithDefault);\n\t\t\t\t\t}\n\t\t\t };\n\t},\n\tmeta: {\n\t\tdocs: {\n\t\t\tdescription: \"Enforces order of class decorators\"\n\t\t}\n\t},\n\tname: SORT_ON_CLASSES_NAME\n});\n","import { AST_NODE_TYPES } from \"@typescript-eslint/types\";\n\nimport { createSortRule, sortRuleListener } from \"../lib/sort-rule\";\n\nexport const SORT_ON_METHODS_NAME = \"sort-on-methods\";\n\nexport const sortOnMethods = createSortRule({\n\tcreate: (context, [optionsWithDefault]) => {\n\t\tconst { autoFix } = optionsWithDefault;\n\n\t\treturn autoFix\n\t\t\t? {\n\t\t\t\t\tMethodDefinition({ decorators, kind }) {\n\t\t\t\t\t\tif (kind !== \"method\") {\n\t\t\t\t\t\t\t// Ignore if not a method\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsortRuleListener(context, decorators ?? [], optionsWithDefault);\n\t\t\t\t\t}\n\t\t\t }\n\t\t\t: {\n\t\t\t\t\tDecorator(node) {\n\t\t\t\t\t\tconst { parent } = node;\n\t\t\t\t\t\tif (parent?.type !== AST_NODE_TYPES.MethodDefinition) {\n\t\t\t\t\t\t\t// Only for methods decorators\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- the current node comes from there\n\t\t\t\t\t\tconst decorators = parent.decorators!;\n\n\t\t\t\t\t\t// Get only the decorators after the current one\n\t\t\t\t\t\tconst nodeIndex = decorators.findIndex(decorator => decorator === node);\n\t\t\t\t\t\tsortRuleListener(context, decorators.slice(nodeIndex), optionsWithDefault);\n\t\t\t\t\t}\n\t\t\t };\n\t},\n\tmeta: {\n\t\tdocs: {\n\t\t\tdescription: \"Enforces order of methods decorators\"\n\t\t}\n\t},\n\tname: SORT_ON_METHODS_NAME\n});\n","import { AST_NODE_TYPES } from \"@typescript-eslint/types\";\nimport { TSESTree } from \"@typescript-eslint/utils\";\n\nimport { createSortRule, sortRuleListener } from \"../lib/sort-rule\";\n\nexport const SORT_ON_PARAMETERS_NAME = \"sort-on-parameters\";\n\nexport const sortOnParameters = createSortRule({\n\tcreate: (context, [optionsWithDefault]) => {\n\t\tconst { autoFix } = optionsWithDefault;\n\n\t\tconst getDecorated = (node: TSESTree.Decorator) => {\n\t\t\tconst { parent } = node;\n\n\t\t\t// Only get the decorated node, if it is on a method\n\t\t\tif (\n\t\t\t\tparent?.type === AST_NODE_TYPES.TSParameterProperty ||\n\t\t\t\t(parent?.type === AST_NODE_TYPES.Identifier &&\n\t\t\t\t\tparent.parent?.type === AST_NODE_TYPES.FunctionExpression)\n\t\t\t) {\n\t\t\t\treturn parent;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t};\n\n\t\treturn autoFix\n\t\t\t? {\n\t\t\t\t\t// TODO: a selector for the parameters only\n\t\t\t\t\tDecorator(node) {\n\t\t\t\t\t\tconst parent = getDecorated(node);\n\t\t\t\t\t\tif (!parent) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- the current node comes from there\n\t\t\t\t\t\tconst decorators = parent.decorators!;\n\n\t\t\t\t\t\t// Run the listener only when on the first node\n\t\t\t\t\t\tif (decorators[0] === node) {\n\t\t\t\t\t\t\tsortRuleListener(context, decorators, optionsWithDefault);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t }\n\t\t\t: {\n\t\t\t\t\tDecorator(node) {\n\t\t\t\t\t\tconst parent = getDecorated(node);\n\t\t\t\t\t\tif (!parent) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- the current node comes from there\n\t\t\t\t\t\tconst decorators = parent.decorators!;\n\n\t\t\t\t\t\t// Get only the decorators after the current one\n\t\t\t\t\t\tconst nodeIndex = decorators.findIndex(decorator => decorator === node);\n\t\t\t\t\t\tsortRuleListener(context, decorators.slice(nodeIndex), optionsWithDefault);\n\t\t\t\t\t}\n\t\t\t };\n\t},\n\tmeta: {\n\t\tdocs: {\n\t\t\tdescription: \"Enforces order of parameters decorators\"\n\t\t}\n\t},\n\tname: SORT_ON_PARAMETERS_NAME\n});\n","import { AST_NODE_TYPES } from \"@typescript-eslint/types\";\n\nimport { createSortRule, sortRuleListener } from \"../lib/sort-rule\";\n\nexport const SORT_ON_PROPERTIES_NAME = \"sort-on-properties\";\n\nexport const sortOnProperties = createSortRule({\n\tcreate: (context, [optionsWithDefault]) => {\n\t\tconst { autoFix } = optionsWithDefault;\n\n\t\treturn autoFix\n\t\t\t? {\n\t\t\t\t\tPropertyDefinition({ decorators }) {\n\t\t\t\t\t\tsortRuleListener(context, decorators ?? [], optionsWithDefault);\n\t\t\t\t\t}\n\t\t\t }\n\t\t\t: {\n\t\t\t\t\tDecorator(node) {\n\t\t\t\t\t\tconst { parent } = node;\n\t\t\t\t\t\tif (parent?.type !== AST_NODE_TYPES.PropertyDefinition) {\n\t\t\t\t\t\t\t// Only for property decorator\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- the current node comes from there\n\t\t\t\t\t\tconst decorators = parent.decorators!;\n\n\t\t\t\t\t\t// Get only the decorators after the current one\n\t\t\t\t\t\tconst nodeIndex = decorators.findIndex(decorator => decorator === node);\n\t\t\t\t\t\tsortRuleListener(context, decorators.slice(nodeIndex), optionsWithDefault);\n\t\t\t\t\t}\n\t\t\t };\n\t},\n\tmeta: {\n\t\tdocs: {\n\t\t\tdescription: \"Enforces order of properties decorators\"\n\t\t}\n\t},\n\tname: SORT_ON_PROPERTIES_NAME\n});\n","import { TSESLint } from \"@typescript-eslint/utils\";\nimport { Linter } from \"eslint\";\n\nimport { SortRuleOptions } from \"../lib/sort-rule\";\nimport {\n\tSORT_ON_ACCESSORS_NAME,\n\tSORT_ON_CLASSES_NAME,\n\tSORT_ON_METHODS_NAME,\n\tSORT_ON_PARAMETERS_NAME,\n\tSORT_ON_PROPERTIES_NAME\n} from \"../rules\";\n\nexport const PLUGIN_NAME = \"sort-decorators\";\n\n/**\n * @param ruleEntry the rule entry to set to all rules\n * @returns A configuration with all its rules set with the given entry\n */\nexport function createConfiguration(ruleEntry: Linter.RuleEntry<[SortRuleOptions]>) {\n\treturn {\n\t\tparser: \"@typescript-eslint/parser\",\n\t\tplugins: [PLUGIN_NAME],\n\t\trules: {\n\t\t\t[`${PLUGIN_NAME}/${SORT_ON_ACCESSORS_NAME}`]: ruleEntry,\n\t\t\t[`${PLUGIN_NAME}/${SORT_ON_CLASSES_NAME}`]: ruleEntry,\n\t\t\t[`${PLUGIN_NAME}/${SORT_ON_METHODS_NAME}`]: ruleEntry,\n\t\t\t[`${PLUGIN_NAME}/${SORT_ON_PARAMETERS_NAME}`]: ruleEntry,\n\t\t\t[`${PLUGIN_NAME}/${SORT_ON_PROPERTIES_NAME}`]: ruleEntry\n\t\t}\n\t} as const satisfies TSESLint.Linter.Config;\n}\n","import { createConfiguration } from \"./common\";\n\nexport const recommended = createConfiguration(\"warn\");\n","import { createConfiguration } from \"./common\";\n\nexport const strict = createConfiguration([\"error\", { autoFix: true }]);\n","import { TSESLint } from \"@typescript-eslint/utils\";\n\nimport * as configs from \"./configs\";\nimport {\n\tSORT_ON_ACCESSORS_NAME,\n\tSORT_ON_CLASSES_NAME,\n\tSORT_ON_METHODS_NAME,\n\tSORT_ON_PARAMETERS_NAME,\n\tSORT_ON_PROPERTIES_NAME,\n\tsortOnAccessors,\n\tsortOnClasses,\n\tsortOnMethods,\n\tsortOnParameters,\n\tsortOnProperties\n} from \"./rules\";\n\nexport default {\n\tconfigs: {\n\t\trecommended: configs.recommended,\n\t\tstrict: configs.strict\n\t},\n\trules: {\n\t\t[SORT_ON_ACCESSORS_NAME]: sortOnAccessors,\n\t\t[SORT_ON_CLASSES_NAME]: sortOnClasses,\n\t\t[SORT_ON_METHODS_NAME]: sortOnMethods,\n\t\t[SORT_ON_PARAMETERS_NAME]: sortOnParameters,\n\t\t[SORT_ON_PROPERTIES_NAME]: sortOnProperties\n\t}\n} satisfies TSESLint.Linter.Plugin;\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/eslint-plugin-sort-decorators/eslint-plugin-sort-decorators/dist/index.js","../src/lib/sort-rule/sort-rule.options.schema.json","../src/lib/sort-rule/sort-rule.ts","../src/lib/decorator/get-decorator-name.ts","../src/lib/sort-rule/sort-rule.listener.ts","../src/rules/sort-on-accessors.ts","../src/rules/sort-on-classes.ts","../src/rules/sort-on-methods.ts","../src/rules/sort-on-parameters.ts","../src/rules/sort-on-properties.ts","../src/configs/common.ts","../src/configs/recommended.ts","../src/configs/strict.ts","../src/index.ts"],"names":["Q","require","utils","_interopNamespace","e","__esModule","n","Object","create","keys","forEach","k","d","getOwnPropertyDescriptor","defineProperty","get","enumerable","default","freeze","Q__namespace","sort_rule_options_schema_default","$schema","additionalProperties","description","properties","autoFix","type","caseSensitive","direction","enum","sortRuleCreator","ESLintUtils","RuleCreator","name","createSortRule","rule","createRule","defaultOptions","meta","schema","docs","requiresTypeChecking","fixable","messages","getDecoratorName","decorator","getName","expression","TSESTree","AST_NODE_TYPES","CallExpression","callee","Identifier","Error","sortRuleListener","context","decorators","options","toLowerCase","compare","a","b","decoratorsWithName","map","node","createFix","fixer","sourceCode","sourceText","getText","sorted","slice","sort","newText","child","i","textAfter","length","range","replaceTextRange","join","sortRule","currentName","remaining","report","data","after","previous","fix","messageId","SORT_ON_ACCESSORS_NAME","sortOnAccessors","optionsWithDefault","getDecorated","parent","MethodDefinition","kind","Decorator","nodeIndex","findIndex","SORT_ON_CLASSES_NAME","sortOnClasses","ClassDeclaration","SORT_ON_METHODS_NAME","sortOnMethods","SORT_ON_PARAMETERS_NAME","sortOnParameters","TSParameterProperty","FunctionExpression","SORT_ON_PROPERTIES_NAME","sortOnProperties","PropertyDefinition","PLUGIN_NAME","createConfiguration","ruleEntry","parser","plugins","rules","recommended","strict","toV9","configV8","_","configV9","files","languageOptions","tsParser","plugin","configs","index_default","module","exports","qe"],"mappings":"AAAA,swFAAa,IAAIA,EAAEC,QAAQ,6BAA6BC,EAAMD,QAAQ,4BAA4B,SAASE,EAAkBC,CAAC,EAAE,GAAGA,GAAGA,EAAEC,UAAU,CAAC,OAAOD,EAAE,IAAIE,EAAEC,OAAOC,MAAM,CAAC,MAAM,GAAGJ,EAAE,CAACG,OAAOE,IAAI,CAACL,GAAGM,OAAO,CAAC,SAASC,CAAC,EAAE,GAAGA,IAAI,UAAU,CAAC,IAAIC,EAAEL,OAAOM,wBAAwB,CAACT,EAAEO,GAAGJ,OAAOO,cAAc,CAACR,EAAEK,EAAEC,EAAEG,GAAG,CAACH,EAAE,CAACI,WAA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EAAoB,CAAC,QAAS,CAAExF,QAAS,IAAK,EAAE,ECgBtE,SAAS+F,EAAKC,CAAAA,EACb,IAAQN,AAAQO,EAAmBD,EAA3BN,OAAcQ,IAAaF,cAEnC,OAAO,OACHE,IACHC,MAAO,CAAC,UAAW,WAAU,CAC7BC,gBAAiB,CAAEV,OAAQW,CAAS,EAEpCV,QAAS,KAAA,GAEX,KAYQ,EAVR,IAAMW,EAAS,CACdC,QAAS,CAERV,YAAqBA,EACrBC,OAAgBA,EAGhB,mBAAoBC,EAAaF,GACjC,cAAeE,EAAaD,EAC7B,EACAF,KAAA,EAAO,KACN,EADM,EACL3B,EAAyBC,GAC1B,EAFM,EAELS,EAAuBC,GACxB,EAHM,EAGLE,EAAuBC,GACxB,EAJM,EAILC,EAA0BC,GAC3B,EALM,EAKLG,EAA0BC,GALrB,EAOR,CAGAiB,CAAAA,EAAOC,OAAA,CAAQ,mBAAkB,CAAEZ,OAAA,CAAUW,EAAOC,OAAA,CAAQ,cAAa,CAAEZ,OAAA,CAC1E,KAACJ,EAAce,GAChB,IAEOE,EAAQF,CbrDfG,CAAAA,OAAOC,OAAO,CAACC","sourcesContent":["'use strict';var Q=require('@typescript-eslint/parser'),utils=require('@typescript-eslint/utils');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var Q__namespace=/*#__PURE__*/_interopNamespace(Q);var D={$schema:\"http://json-schema.org/draft-07/schema#\",additionalProperties:false,description:\"Options for the sort rule\",properties:{autoFix:{default:false,description:\"Automatically fix the order.\\nWhen set to `true`, only one error is reported and the whole set of decorators is fixed.\",type:\"boolean\"},caseSensitive:{default:true,description:\"If true, enforce properties to be in case-sensitive order.\",type:\"boolean\"},direction:{default:\"asc\",description:\"Specify the direction of the ordering.\",enum:[\"asc\",\"desc\"],type:\"string\"}},type:\"object\"};var G=utils.ESLintUtils.RuleCreator(e=>e);function f(e){return G({create:e.createRule,defaultOptions:[{autoFix:false,caseSensitive:true,direction:\"asc\"}],meta:{schema:[D],docs:{description:e.description,requiresTypeChecking:false},fixable:\"code\",messages:{\"incorrect-order\":\"Expected decorators to be in sorted order. `@{{ after }}` should be before `@{{ previous }}`.\"},type:\"layout\"},name:e.name})}function F(e){let o=c=>{switch(c.type){case utils.TSESTree.AST_NODE_TYPES.CallExpression:return o(c.callee);case utils.TSESTree.AST_NODE_TYPES.Identifier:return c.name}throw new Error(\"Not a valid decorator.\")};return o(e.expression)}function p(e,o,c){let{autoFix:s,caseSensitive:t,direction:r}=c,n=a=>{let i=F(a);return t?i:i.toLowerCase()},m=(a,i)=>([a,i]=r===\"desc\"?[i,a]:[a,i],a===i?0:a<i?-1:1),S=o.map(a=>({name:n(a),node:a})),j=(a,i)=>{let{sourceCode:x}=e,g=x.getText(),N=i.slice().sort(({name:u},{name:l})=>m(u,l)).map(({node:u})=>u),C=N.map((u,l)=>{let k=l===N.length-1?\"\":g.slice(i[l].node.range[1],i[l+1].node.range[0]);return x.getText(u)+k});return a.replaceTextRange([i[0].node.range[0],i[i.length-1].node.range[1]],C.join(\"\"))},h=a=>{if(a.length<=1)return;let[{name:i},...x]=a;for(let{name:g,node:N}of x)if(m(i,g)>0){e.report({data:{after:g,previous:i},fix:s?C=>j(C,a):void 0,messageId:\"incorrect-order\",node:N});return}s&&h(a.slice(1));};h(S);}var E=\"sort-on-accessors\",$=f({createRule:(e,[o])=>{let{autoFix:c}=o,s=t=>{let{parent:r}=t;return r?.type===utils.AST_NODE_TYPES.MethodDefinition&&r.kind===\"get\"?r:false};return c?{Decorator(t){let r=s(t);if(!r)return;let n=r.decorators;n[0]===t&&p(e,n,o);}}:{Decorator(t){let r=s(t);if(!r)return;let n=r.decorators,m=n.findIndex(S=>S===t);p(e,n.slice(m),o);}}},description:\"Enforces order of accessors decorators\",name:E});var R=\"sort-on-classes\",v=f({createRule:(e,[o])=>{let{autoFix:c}=o;return c?{ClassDeclaration({decorators:s}){p(e,s??[],o);}}:{Decorator(s){let{parent:t}=s;if(t?.type!==utils.AST_NODE_TYPES.ClassDeclaration)return;let r=t.decorators,n=r.findIndex(m=>m===s);p(e,r.slice(n),o);}}},description:\"Enforces order of class decorators\",name:R});var T=\"sort-on-methods\",w=f({createRule:(e,[o])=>{let{autoFix:c}=o;return c?{MethodDefinition({decorators:s,kind:t}){t===\"method\"&&p(e,s??[],o);}}:{Decorator(s){let{parent:t}=s;if(t?.type!==utils.AST_NODE_TYPES.MethodDefinition)return;let r=t.decorators,n=r.findIndex(m=>m===s);p(e,r.slice(n),o);}}},description:\"Enforces order of methods decorators\",name:T});var O=\"sort-on-parameters\",Y=f({createRule:(e,[o])=>{let{autoFix:c}=o,s=t=>{let{parent:r}=t;return r?.type===utils.AST_NODE_TYPES.TSParameterProperty||r?.type===utils.AST_NODE_TYPES.Identifier&&r.parent?.type===utils.AST_NODE_TYPES.FunctionExpression?r:false};return c?{Decorator(t){let r=s(t);if(!r)return;let n=r.decorators;n[0]===t&&p(e,n,o);}}:{Decorator(t){let r=s(t);if(!r)return;let n=r.decorators,m=n.findIndex(S=>S===t);p(e,n.slice(m),o);}}},description:\"Enforces order of parameters decorators\",name:O});var _=\"sort-on-properties\",b=f({createRule:(e,[o])=>{let{autoFix:c}=o;return c?{PropertyDefinition({decorators:s}){p(e,s??[],o);}}:{Decorator(s){let{parent:t}=s;if(t?.type!==utils.AST_NODE_TYPES.PropertyDefinition)return;let r=t.decorators,n=r.findIndex(m=>m===s);p(e,r.slice(n),o);}}},description:\"Enforces order of properties decorators\",name:_});var d=\"sort-decorators\";function A(e){return {parser:\"@typescript-eslint/parser\",plugins:[d],rules:{[`${d}/${E}`]:e,[`${d}/${R}`]:e,[`${d}/${T}`]:e,[`${d}/${O}`]:e,[`${d}/${_}`]:e}}}var M=A(\"warn\");var P=A([\"error\",{autoFix:true}]);function U(e){let{parser:o,...c}=e;return {...c,files:[\"**/*.ts\",\"**/*.tsx\"],languageOptions:{parser:Q__namespace},plugins:void 0}}var y={configs:{recommended:M,strict:P,\"flat/recommended\":U(M),\"flat/strict\":U(P)},rules:{[E]:$,[R]:v,[T]:w,[O]:Y,[_]:b}};y.configs[\"flat/recommended\"].plugins=y.configs[\"flat/strict\"].plugins={[d]:y};var qe=y;\nmodule.exports=qe;//# sourceMappingURL=index.js.map\n","{\n\t\"$schema\": \"http://json-schema.org/draft-07/schema#\",\n\t\"additionalProperties\": false,\n\t\"description\": \"Options for the sort rule\",\n\t\"properties\": {\n\t\t\"autoFix\": {\n\t\t\t\"default\": false,\n\t\t\t\"description\": \"Automatically fix the order.\\nWhen set to `true`, only one error is reported and the whole set of decorators is fixed.\",\n\t\t\t\"type\": \"boolean\"\n\t\t},\n\t\t\"caseSensitive\": {\n\t\t\t\"default\": true,\n\t\t\t\"description\": \"If true, enforce properties to be in case-sensitive order.\",\n\t\t\t\"type\": \"boolean\"\n\t\t},\n\t\t\"direction\": {\n\t\t\t\"default\": \"asc\",\n\t\t\t\"description\": \"Specify the direction of the ordering.\",\n\t\t\t\"enum\": [\"asc\", \"desc\"],\n\t\t\t\"type\": \"string\"\n\t\t}\n\t},\n\t\"type\": \"object\"\n}\n","import { ESLintUtils } from \"@typescript-eslint/utils\";\n\nimport { SortRuleMessageIds } from \"./sort-rule.message-ids\";\nimport { SortRuleOptions } from \"./sort-rule.options\";\nimport schema from \"./sort-rule.options.schema.json\";\n\ntype SortRule = ESLintUtils.RuleWithMetaAndName<[SortRuleOptions], SortRuleMessageIds>;\n\n/** The information to create a \"sort-decorators\" rule */\nexport interface SortRuleParams {\n\tcreateRule: SortRule[\"create\"];\n\tdescription: SortRule[\"meta\"][\"docs\"][\"description\"];\n\tname: SortRule[\"name\"];\n}\n\nconst sortRuleCreator = ESLintUtils.RuleCreator<{ requiresTypeChecking: boolean }>(name => name);\n\n/**\n * @param rule the parameter to create a rule\n * @returns the created rule\n */\nexport function createSortRule(rule: SortRuleParams) {\n\treturn sortRuleCreator({\n\t\tcreate: rule.createRule,\n\t\tdefaultOptions: [{ autoFix: false, caseSensitive: true, direction: \"asc\" }],\n\t\tmeta: {\n\t\t\tschema: [schema as never],\n\n\t\t\tdocs: { description: rule.description, requiresTypeChecking: false },\n\t\t\tfixable: \"code\",\n\t\t\tmessages: {\n\t\t\t\t\"incorrect-order\":\n\t\t\t\t\t\"Expected decorators to be in sorted order. `@{{ after }}` should be before `@{{ previous }}`.\",\n\t\t\t},\n\t\t\ttype: \"layout\",\n\t\t},\n\t\tname: rule.name,\n\t});\n}\n","import { TSESTree } from \"@typescript-eslint/utils\";\n\n/**\n * @param decorator the decorator node to get the name from\n * @returns the name of the given decorator\n */\nexport function getDecoratorName(decorator: TSESTree.Decorator): string {\n\tconst getName = (expression: typeof decorator.expression): string => {\n\t\tswitch (expression.type) {\n\t\t\tcase TSESTree.AST_NODE_TYPES.CallExpression:\n\t\t\t\treturn getName(expression.callee as never);\n\n\t\t\tcase TSESTree.AST_NODE_TYPES.Identifier:\n\t\t\t\treturn expression.name;\n\t\t}\n\n\t\tthrow new Error(\"Not a valid decorator.\");\n\t};\n\n\treturn getName(decorator.expression);\n}\n","import { TSESTree, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { SortRuleMessageIds } from \"./sort-rule.message-ids\";\nimport { SortRuleOptions } from \"./sort-rule.options\";\nimport { getDecoratorName } from \"../decorator\";\n\n/**\n * The rule listener for sorting the decorators\n *\n * @param context the context the rule is listening\n * @param decorators the decorators to test (and fix)\n * @param options the rule options\n */\nexport function sortRuleListener(\n\tcontext: TSESLint.RuleContext<SortRuleMessageIds, [SortRuleOptions]>,\n\tdecorators: TSESTree.Decorator[],\n\toptions: SortRuleOptions,\n) {\n\tconst { autoFix, caseSensitive, direction } = options;\n\n\t// Get the name of a decorator given the options\n\tconst getName = (decorator: TSESTree.Decorator) => {\n\t\tconst name = getDecoratorName(decorator);\n\t\treturn caseSensitive ? name : name.toLowerCase();\n\t};\n\n\t// The comparator of names\n\tconst compare = (a: string, b: string) => {\n\t\t// swap parameters when the direction is reverted\n\t\t[a, b] = direction === \"desc\" ? [b, a] : [a, b];\n\n\t\t// `localCompare` messes with the upperCase\n\t\tif (a === b) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn a < b ? -1 : 1;\n\t};\n\n\t// Get the decorator names only once\n\tconst decoratorsWithName = decorators.map(decorator => ({\n\t\tname: getName(decorator),\n\t\tnode: decorator,\n\t}));\n\n\tconst createFix = (fixer: TSESLint.RuleFixer, decorators: typeof decoratorsWithName) => {\n\t\t// Chunk of code strongly inspired from:\n\t\t// https://github.com/mthadley/eslint-plugin-sort-destructure-keys/blob/ccb0d52cb48a55668aff209e1cec4197a16bd23b/lib/rules/sort-destructure-keys.js#L158\n\n\t\tconst { sourceCode } = context;\n\t\tconst sourceText = sourceCode.getText();\n\n\t\tconst sorted = decorators\n\t\t\t.slice()\n\t\t\t.sort(({ name: a }, { name: b }) => compare(a, b))\n\t\t\t.map(({ node }) => node);\n\n\t\tconst newText = sorted.map((child, i) => {\n\t\t\tconst textAfter =\n\t\t\t\ti === sorted.length - 1\n\t\t\t\t\t? // If it's the last item, there's no text after to append.\n\t\t\t\t\t\t\"\"\n\t\t\t\t\t: // Otherwise, we need to grab the text after the original node.\n\t\t\t\t\t\tsourceText.slice(\n\t\t\t\t\t\t\tdecorators[i].node.range[1], // End index of the current node .\n\t\t\t\t\t\t\tdecorators[i + 1].node.range[0], // Start index of the next node.\n\t\t\t\t\t\t);\n\n\t\t\treturn sourceCode.getText(child) + textAfter;\n\t\t});\n\n\t\treturn fixer.replaceTextRange(\n\t\t\t[decorators[0].node.range[0], decorators[decorators.length - 1].node.range[1]],\n\t\t\tnewText.join(\"\"),\n\t\t);\n\t};\n\n\tconst sortRule = (decorators: typeof decoratorsWithName) => {\n\t\tif (decorators.length <= 1) {\n\t\t\t// Nothing to test when there is less than 1 decorator\n\t\t\treturn;\n\t\t}\n\n\t\tconst [{ name: currentName }, ...remaining] = decorators;\n\n\t\tfor (const { name, node } of remaining) {\n\t\t\tif (compare(currentName, name) > 0) {\n\t\t\t\tcontext.report({\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tafter: name,\n\t\t\t\t\t\tprevious: currentName,\n\t\t\t\t\t},\n\t\t\t\t\tfix: autoFix ? fixer => createFix(fixer, decorators) : undefined,\n\t\t\t\t\tmessageId: \"incorrect-order\",\n\t\t\t\t\tnode,\n\t\t\t\t});\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (autoFix) {\n\t\t\t// On autoFix, all decorators are tested to be able to fix them all\n\t\t\tsortRule(decorators.slice(1));\n\t\t}\n\t};\n\n\tsortRule(decoratorsWithName);\n}\n","import { AST_NODE_TYPES, TSESTree } from \"@typescript-eslint/utils\";\n\nimport { createSortRule, sortRuleListener } from \"../lib/sort-rule\";\n\nexport const SORT_ON_ACCESSORS_NAME = \"sort-on-accessors\";\n\nexport const sortOnAccessors = createSortRule({\n\tcreateRule: (context, [optionsWithDefault]) => {\n\t\tconst { autoFix } = optionsWithDefault;\n\n\t\tconst getDecorated = (node: TSESTree.Decorator) => {\n\t\t\tconst { parent } = node;\n\n\t\t\t// Only get the decorated node, if it is an accessor\n\t\t\tif (parent?.type === AST_NODE_TYPES.MethodDefinition && parent.kind === \"get\") {\n\t\t\t\treturn parent;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t};\n\n\t\treturn autoFix\n\t\t\t? {\n\t\t\t\t\t// TODO: a selector for the accessors only\n\t\t\t\t\tDecorator(node) {\n\t\t\t\t\t\tconst parent = getDecorated(node);\n\t\t\t\t\t\tif (!parent) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst decorators = parent.decorators;\n\n\t\t\t\t\t\t// Run the listener only when on the first node\n\t\t\t\t\t\tif (decorators[0] === node) {\n\t\t\t\t\t\t\tsortRuleListener(context, decorators, optionsWithDefault);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t: {\n\t\t\t\t\tDecorator(node) {\n\t\t\t\t\t\tconst parent = getDecorated(node);\n\t\t\t\t\t\tif (!parent) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst decorators = parent.decorators;\n\n\t\t\t\t\t\t// Get only the decorators after the current one\n\t\t\t\t\t\tconst nodeIndex = decorators.findIndex(decorator => decorator === node);\n\t\t\t\t\t\tsortRuleListener(context, decorators.slice(nodeIndex), optionsWithDefault);\n\t\t\t\t\t},\n\t\t\t\t};\n\t},\n\tdescription: \"Enforces order of accessors decorators\",\n\tname: SORT_ON_ACCESSORS_NAME,\n});\n","import { AST_NODE_TYPES } from \"@typescript-eslint/utils\";\n\nimport { createSortRule, sortRuleListener } from \"../lib/sort-rule\";\n\nexport const SORT_ON_CLASSES_NAME = \"sort-on-classes\";\n\nexport const sortOnClasses = createSortRule({\n\tcreateRule: (context, [optionsWithDefault]) => {\n\t\tconst { autoFix } = optionsWithDefault;\n\n\t\treturn autoFix\n\t\t\t? {\n\t\t\t\t\tClassDeclaration({ decorators }) {\n\t\t\t\t\t\tsortRuleListener(context, decorators ?? [], optionsWithDefault);\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t: {\n\t\t\t\t\tDecorator(node) {\n\t\t\t\t\t\tconst { parent } = node;\n\t\t\t\t\t\tif (parent?.type !== AST_NODE_TYPES.ClassDeclaration) {\n\t\t\t\t\t\t\t// Only for classes decorators\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst decorators = parent.decorators;\n\n\t\t\t\t\t\t// Get only the decorators after the current one\n\t\t\t\t\t\tconst nodeIndex = decorators.findIndex(decorator => decorator === node);\n\t\t\t\t\t\tsortRuleListener(context, decorators.slice(nodeIndex), optionsWithDefault);\n\t\t\t\t\t},\n\t\t\t\t};\n\t},\n\tdescription: \"Enforces order of class decorators\",\n\tname: SORT_ON_CLASSES_NAME,\n});\n","import { AST_NODE_TYPES } from \"@typescript-eslint/utils\";\n\nimport { createSortRule, sortRuleListener } from \"../lib/sort-rule\";\n\nexport const SORT_ON_METHODS_NAME = \"sort-on-methods\";\n\nexport const sortOnMethods = createSortRule({\n\tcreateRule: (context, [optionsWithDefault]) => {\n\t\tconst { autoFix } = optionsWithDefault;\n\n\t\treturn autoFix\n\t\t\t? {\n\t\t\t\t\tMethodDefinition({ decorators, kind }) {\n\t\t\t\t\t\tif (kind !== \"method\") {\n\t\t\t\t\t\t\t// Ignore if not a method\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsortRuleListener(context, decorators ?? [], optionsWithDefault);\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t: {\n\t\t\t\t\tDecorator(node) {\n\t\t\t\t\t\tconst { parent } = node;\n\t\t\t\t\t\tif (parent?.type !== AST_NODE_TYPES.MethodDefinition) {\n\t\t\t\t\t\t\t// Only for methods decorators\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst decorators = parent.decorators;\n\n\t\t\t\t\t\t// Get only the decorators after the current one\n\t\t\t\t\t\tconst nodeIndex = decorators.findIndex(decorator => decorator === node);\n\t\t\t\t\t\tsortRuleListener(context, decorators.slice(nodeIndex), optionsWithDefault);\n\t\t\t\t\t},\n\t\t\t\t};\n\t},\n\tdescription: \"Enforces order of methods decorators\",\n\tname: SORT_ON_METHODS_NAME,\n});\n","import { AST_NODE_TYPES, TSESTree } from \"@typescript-eslint/utils\";\n\nimport { createSortRule, sortRuleListener } from \"../lib/sort-rule\";\n\nexport const SORT_ON_PARAMETERS_NAME = \"sort-on-parameters\";\n\nexport const sortOnParameters = createSortRule({\n\tcreateRule: (context, [optionsWithDefault]) => {\n\t\tconst { autoFix } = optionsWithDefault;\n\n\t\tconst getDecorated = (node: TSESTree.Decorator) => {\n\t\t\tconst { parent } = node;\n\n\t\t\t// Only get the decorated node, if it is on a method\n\t\t\tif (\n\t\t\t\tparent?.type === AST_NODE_TYPES.TSParameterProperty ||\n\t\t\t\t(parent?.type === AST_NODE_TYPES.Identifier &&\n\t\t\t\t\tparent.parent?.type === AST_NODE_TYPES.FunctionExpression)\n\t\t\t) {\n\t\t\t\treturn parent;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t};\n\n\t\treturn autoFix\n\t\t\t? {\n\t\t\t\t\t// TODO: a selector for the parameters only\n\t\t\t\t\tDecorator(node) {\n\t\t\t\t\t\tconst parent = getDecorated(node);\n\t\t\t\t\t\tif (!parent) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst decorators = parent.decorators;\n\n\t\t\t\t\t\t// Run the listener only when on the first node\n\t\t\t\t\t\tif (decorators[0] === node) {\n\t\t\t\t\t\t\tsortRuleListener(context, decorators, optionsWithDefault);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t: {\n\t\t\t\t\tDecorator(node) {\n\t\t\t\t\t\tconst parent = getDecorated(node);\n\t\t\t\t\t\tif (!parent) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst decorators = parent.decorators;\n\n\t\t\t\t\t\t// Get only the decorators after the current one\n\t\t\t\t\t\tconst nodeIndex = decorators.findIndex(decorator => decorator === node);\n\t\t\t\t\t\tsortRuleListener(context, decorators.slice(nodeIndex), optionsWithDefault);\n\t\t\t\t\t},\n\t\t\t\t};\n\t},\n\tdescription: \"Enforces order of parameters decorators\",\n\tname: SORT_ON_PARAMETERS_NAME,\n});\n","import { AST_NODE_TYPES } from \"@typescript-eslint/utils\";\n\nimport { createSortRule, sortRuleListener } from \"../lib/sort-rule\";\n\nexport const SORT_ON_PROPERTIES_NAME = \"sort-on-properties\";\n\nexport const sortOnProperties = createSortRule({\n\tcreateRule: (context, [optionsWithDefault]) => {\n\t\tconst { autoFix } = optionsWithDefault;\n\n\t\treturn autoFix\n\t\t\t? {\n\t\t\t\t\tPropertyDefinition({ decorators }) {\n\t\t\t\t\t\tsortRuleListener(context, decorators ?? [], optionsWithDefault);\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t: {\n\t\t\t\t\tDecorator(node) {\n\t\t\t\t\t\tconst { parent } = node;\n\t\t\t\t\t\tif (parent?.type !== AST_NODE_TYPES.PropertyDefinition) {\n\t\t\t\t\t\t\t// Only for property decorator\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst decorators = parent.decorators;\n\n\t\t\t\t\t\t// Get only the decorators after the current one\n\t\t\t\t\t\tconst nodeIndex = decorators.findIndex(decorator => decorator === node);\n\t\t\t\t\t\tsortRuleListener(context, decorators.slice(nodeIndex), optionsWithDefault);\n\t\t\t\t\t},\n\t\t\t\t};\n\t},\n\tdescription: \"Enforces order of properties decorators\",\n\tname: SORT_ON_PROPERTIES_NAME,\n});\n","import type { TSESLint } from \"@typescript-eslint/utils\";\nimport type { Linter } from \"eslint\";\n\nimport { SortRuleParams } from \"../lib/sort-rule\";\nimport {\n\tSORT_ON_ACCESSORS_NAME,\n\tSORT_ON_CLASSES_NAME,\n\tSORT_ON_METHODS_NAME,\n\tSORT_ON_PARAMETERS_NAME,\n\tSORT_ON_PROPERTIES_NAME,\n} from \"../rules\";\n\nexport const PLUGIN_NAME = \"sort-decorators\";\n\n/**\n * @param ruleEntry the rule entry to set to all rules\n * @returns A configuration with all its rules set with the given entry\n */\nexport function createConfiguration(ruleEntry: Linter.RuleEntry<[SortRuleParams]>) {\n\treturn {\n\t\tparser: \"@typescript-eslint/parser\",\n\t\tplugins: [PLUGIN_NAME],\n\t\trules: {\n\t\t\t[`${PLUGIN_NAME}/${SORT_ON_ACCESSORS_NAME}`]: ruleEntry,\n\t\t\t[`${PLUGIN_NAME}/${SORT_ON_CLASSES_NAME}`]: ruleEntry,\n\t\t\t[`${PLUGIN_NAME}/${SORT_ON_METHODS_NAME}`]: ruleEntry,\n\t\t\t[`${PLUGIN_NAME}/${SORT_ON_PARAMETERS_NAME}`]: ruleEntry,\n\t\t\t[`${PLUGIN_NAME}/${SORT_ON_PROPERTIES_NAME}`]: ruleEntry,\n\t\t},\n\t} as const satisfies TSESLint.ClassicConfig.Config;\n}\n","import { createConfiguration } from \"./common\";\n\nexport const recommended = createConfiguration(\"warn\");\n","import { createConfiguration } from \"./common\";\n\nexport const strict = createConfiguration([\"error\", { autoFix: true }]);\n","import * as tsParser from \"@typescript-eslint/parser\";\nimport type { TSESLint } from \"@typescript-eslint/utils\";\n\nimport * as configs from \"./configs\";\nimport { PLUGIN_NAME } from \"./configs/common\";\nimport {\n\tSORT_ON_ACCESSORS_NAME,\n\tSORT_ON_CLASSES_NAME,\n\tSORT_ON_METHODS_NAME,\n\tSORT_ON_PARAMETERS_NAME,\n\tSORT_ON_PROPERTIES_NAME,\n\tsortOnAccessors,\n\tsortOnClasses,\n\tsortOnMethods,\n\tsortOnParameters,\n\tsortOnProperties,\n} from \"./rules\";\n\nfunction toV9(configV8: typeof configs.recommended) {\n\tconst { parser: _, ...configV9 } = configV8;\n\n\treturn {\n\t\t...configV9,\n\t\tfiles: [\"**/*.ts\", \"**/*.tsx\"],\n\t\tlanguageOptions: { parser: tsParser },\n\t\t// Set after\n\t\tplugins: undefined,\n\t} as const satisfies TSESLint.FlatConfig.Config;\n}\n\nconst plugin = {\n\tconfigs: {\n\t\t// v8\n\t\trecommended: configs.recommended,\n\t\tstrict: configs.strict,\n\n\t\t// v9\n\t\t\"flat/recommended\": toV9(configs.recommended),\n\t\t\"flat/strict\": toV9(configs.strict),\n\t},\n\trules: {\n\t\t[SORT_ON_ACCESSORS_NAME]: sortOnAccessors,\n\t\t[SORT_ON_CLASSES_NAME]: sortOnClasses,\n\t\t[SORT_ON_METHODS_NAME]: sortOnMethods,\n\t\t[SORT_ON_PARAMETERS_NAME]: sortOnParameters,\n\t\t[SORT_ON_PROPERTIES_NAME]: sortOnProperties,\n\t},\n} satisfies TSESLint.Linter.Plugin;\n\n// @ts-expect-error - TS2322: better?\nplugin.configs[\"flat/recommended\"].plugins = plugin.configs[\"flat/strict\"].plugins = {\n\t[PLUGIN_NAME]: plugin,\n};\n\nexport default plugin;\n"]}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# sort-decorators/sort-on-accessors
|
|
2
|
+
|
|
3
|
+
📝 Enforces order of accessors decorators.
|
|
2
4
|
|
|
3
5
|
💼⚠️ This rule is enabled in the 🔒 `strict` config. This rule _warns_ in the ✅ `recommended` config.
|
|
4
6
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# sort-decorators/sort-on-parameters
|
|
2
|
+
|
|
3
|
+
📝 Enforces order of parameters decorators.
|
|
2
4
|
|
|
3
5
|
💼⚠️ This rule is enabled in the 🔒 `strict` config. This rule _warns_ in the ✅ `recommended` config.
|
|
4
6
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# sort-decorators/sort-on-properties
|
|
2
|
+
|
|
3
|
+
📝 Enforces order of properties decorators.
|
|
2
4
|
|
|
3
5
|
💼⚠️ This rule is enabled in the 🔒 `strict` config. This rule _warns_ in the ✅ `recommended` config.
|
|
4
6
|
|
package/package.json
CHANGED
|
@@ -8,47 +8,46 @@
|
|
|
8
8
|
"path": "./node_modules/cz-conventional-changelog"
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
|
-
"dependencies": {},
|
|
12
11
|
"description": "An ESLint plugin to sort decorators",
|
|
13
12
|
"devDependencies": {
|
|
14
|
-
"@
|
|
15
|
-
"@
|
|
16
|
-
"@
|
|
13
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.6.0",
|
|
14
|
+
"@eslint/compat": "^2.0.2",
|
|
15
|
+
"@release-it/conventional-changelog": "^10.0.0",
|
|
17
16
|
"@swc/core": "^1.3.67",
|
|
18
17
|
"@types/eslint": "^8.40.2",
|
|
19
|
-
"@types/jest": "^
|
|
20
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
21
|
-
"@typescript-eslint/parser": "^
|
|
22
|
-
"@typescript-eslint/
|
|
18
|
+
"@types/jest": "^30.0.0",
|
|
19
|
+
"@typescript-eslint/eslint-plugin": "^8.55.0",
|
|
20
|
+
"@typescript-eslint/parser": "^8.55.0",
|
|
21
|
+
"@typescript-eslint/rule-tester": "^8.55.0",
|
|
22
|
+
"@typescript-eslint/utils": "^8.55.0",
|
|
23
23
|
"cz-conventional-changelog": "^3.3.0",
|
|
24
|
-
"eslint": "^
|
|
25
|
-
"eslint-config-prettier": "^
|
|
26
|
-
"eslint-doc-generator": "^
|
|
24
|
+
"eslint": "^9.39.2",
|
|
25
|
+
"eslint-config-prettier": "^9.0.0",
|
|
26
|
+
"eslint-doc-generator": "^3.0.2",
|
|
27
|
+
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
27
28
|
"eslint-plugin-eslint-plugin": "^5.1.0",
|
|
28
|
-
"eslint-plugin-etc": "^2.0.3",
|
|
29
29
|
"eslint-plugin-import": "^2.27.5",
|
|
30
|
-
"eslint-plugin-jest": "^
|
|
31
|
-
"eslint-plugin-
|
|
32
|
-
"eslint-plugin-jsdoc": "^46.4.2",
|
|
30
|
+
"eslint-plugin-jest": "^29.14.0",
|
|
31
|
+
"eslint-plugin-jsdoc": "^48.0.0",
|
|
33
32
|
"eslint-plugin-jsonc": "^2.9.0",
|
|
34
|
-
"eslint-plugin-markdownlint": "^0.
|
|
35
|
-
"eslint-plugin-prettier": "^
|
|
36
|
-
"eslint-plugin-sonarjs": "^0.
|
|
33
|
+
"eslint-plugin-markdownlint": "^0.9.0",
|
|
34
|
+
"eslint-plugin-prettier": "^5.0.0",
|
|
35
|
+
"eslint-plugin-sonarjs": "^1.0.4",
|
|
37
36
|
"eslint-plugin-sort-destructure-keys": "^1.5.0",
|
|
38
|
-
"eslint-plugin-sort-exports": "^0.
|
|
39
|
-
"eslint-plugin-
|
|
40
|
-
"eslint-plugin-unicorn": "^
|
|
41
|
-
"eslint-plugin-unused-imports": "^
|
|
37
|
+
"eslint-plugin-sort-exports": "^0.9.0",
|
|
38
|
+
"eslint-plugin-sort-keys-plus": "^1.4.0",
|
|
39
|
+
"eslint-plugin-unicorn": "^52.0.0",
|
|
40
|
+
"eslint-plugin-unused-imports": "^4.4.1",
|
|
42
41
|
"eslint-plugin-yml": "^1.8.0",
|
|
43
42
|
"jest": "^29.5.0",
|
|
44
|
-
"
|
|
45
|
-
"release-it": "^
|
|
43
|
+
"prettier-plugin-sh": "^0.18.0",
|
|
44
|
+
"release-it": "^19.0.0",
|
|
46
45
|
"ts-jest": "^29.1.0",
|
|
47
46
|
"ts-loader": "^9.4.4",
|
|
48
47
|
"ts-node": "^10.9.1",
|
|
49
|
-
"tsup": "^
|
|
48
|
+
"tsup": "^8.0.0",
|
|
50
49
|
"typescript": "^5.1.5",
|
|
51
|
-
"typescript-json-schema": "^0.
|
|
50
|
+
"typescript-json-schema": "^0.67.0"
|
|
52
51
|
},
|
|
53
52
|
"homepage": "https://github.com/heap-code/eslint-plugin-sort-decorators",
|
|
54
53
|
"keywords": [
|
|
@@ -62,8 +61,8 @@
|
|
|
62
61
|
"main": "./dist/index.js",
|
|
63
62
|
"name": "eslint-plugin-sort-decorators",
|
|
64
63
|
"peerDependencies": {
|
|
65
|
-
"@typescript-eslint/parser": "^
|
|
66
|
-
"eslint": "^
|
|
64
|
+
"@typescript-eslint/parser": "^7.0.0 || ^8.0.0",
|
|
65
|
+
"eslint": "^8.0.0 || ^9.0.0"
|
|
67
66
|
},
|
|
68
67
|
"publishConfig": {
|
|
69
68
|
"access": "public"
|
|
@@ -73,7 +72,7 @@
|
|
|
73
72
|
"url": "git+https://github.com/heap-code/eslint-plugin-sort-decorators.git"
|
|
74
73
|
},
|
|
75
74
|
"scripts": {
|
|
76
|
-
"build": "tsup-node
|
|
75
|
+
"build": "tsup-node --config ./tsup.config.ts",
|
|
77
76
|
"docs:update": "npx eslint-doc-generator",
|
|
78
77
|
"lint": "eslint .",
|
|
79
78
|
"lint:fix": "npm run lint -- --fix",
|
|
@@ -81,7 +80,9 @@
|
|
|
81
80
|
"schemas:update": "typescript-json-schema src/lib/sort-rule/sort-rule.options.ts SortRuleOptions --noExtraProps --required -o src/lib/sort-rule/sort-rule.options.schema.json",
|
|
82
81
|
"test": "jest --config jest.config.ts",
|
|
83
82
|
"test:coverage": "npm run test -- --coverage",
|
|
84
|
-
"test:watch": "npm run test -- --watch"
|
|
83
|
+
"test:watch": "npm run test -- --watch",
|
|
84
|
+
"typecheck": "tsc --noEmit -p ./tsconfig.spec.json"
|
|
85
85
|
},
|
|
86
|
-
"
|
|
86
|
+
"types": "./dist/index.d.ts",
|
|
87
|
+
"version": "0.4.0"
|
|
87
88
|
}
|