eslint-plugin-sort-decorators 0.2.2 → 0.2.3
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="131" height="20" role="img" aria-label="branches:
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="131" height="20" role="img" aria-label="branches: 91.02%"><title>branches: 91.02%</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="#4c1"/><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" xlink:href="data:image/svg+xml;base64,PHN2ZyBmaWxsPSJ3aGl0ZXNtb2tlIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+SmVzdDwvdGl0bGU+PHBhdGggZD0iTTIyLjI1MSAxMS44MmEzLjExNyAzLjExNyAwIDAgMC0yLjMyOC0zLjAxTDIyLjkxMSAwSDguMTA0TDExLjEgOC44MzhhMy4xMTYgMy4xMTYgMCAwIDAtMi4yNDQgMi45ODhjMCAxLjA0My41MiAxLjk2NyAxLjMxMyAyLjUzNmE4LjI3OSA4LjI3OSAwIDAgMS0xLjA4NCAxLjI0NCA4LjE0IDguMTQgMCAwIDEtMi41NSAxLjY0N2MtLjgzNC0uNTYzLTEuMTk1LTEuNTU2LS44NjktMi40NDZhMy4xMSA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4LjUyLjIzNiAxLjA2My4xMzkgMS42MDV6Ii8+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">91.02%</text><text x="1035" y="140" transform="scale(.1)" fill="#fff" textLength="430">91.02%</text></g></svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="155" height="20" role="img" aria-label="jest coverage: 97.
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="155" height="20" role="img" aria-label="jest coverage: 97.76%"><title>jest coverage: 97.76%</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" xlink:href="data:image/svg+xml;base64,PHN2ZyBmaWxsPSJ3aGl0ZXNtb2tlIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+SmVzdDwvdGl0bGU+PHBhdGggZD0iTTIyLjI1MSAxMS44MmEzLjExNyAzLjExNyAwIDAgMC0yLjMyOC0zLjAxTDIyLjkxMSAwSDguMTA0TDExLjEgOC44MzhhMy4xMTYgMy4xMTYgMCAwIDAtMi4yNDQgMi45ODh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40NDUtMS43MTZjLjE2LjAyNy4zMi4wMzQuNDguMDM0YTMuMTE3IDMuMTE3IDAgMCAwIDMuMDA4LTIuMzI3aDEuMTY3YTMuMTA5IDMuMTA5IDAgMCAwIDMuMDEgMi4zMjdjLjU3NiAwIDEuMTEtLjE2IDEuNTctLjQzLjE4LjUyLjIzNiAxLjA2My4xMzkgMS42MDV6Ii8+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">97.76%</text><text x="1275" y="140" transform="scale(.1)" fill="#fff" textLength="430">97.76%</text></g></svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="155" height="20" role="img" aria-label="jest coverage: 97.
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="155" height="20" role="img" aria-label="jest coverage: 97.76%"><title>jest coverage: 97.76%</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" xlink:href="data:image/svg+xml;base64,PHN2ZyBmaWxsPSJ3aGl0ZXNtb2tlIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAv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i4wNTYuMzEyLjA5OC40NzkuMTI2LS4yNjQgMS40NzMuNDg2IDIuOTk0IDEuOTQ2IDMuNzQ1bC4yNjQuMTM5LjI4NC0uMTA0YzEuMjE2LS40MzEgMi4zNDItMS4xMzMgMy4zMzYtMi4wNzFhOS4zMzQgOS4zMzQgMCAwIDAgMS40NDUtMS43MTZjLjE2LjAyNy4zMi4wMzQuNDguMDM0YTMuMTE3IDMuMTE3IDAgMCAwIDMuMDA4LTIuMzI3aDEuMTY3YTMuMTA5IDMuMTA5IDAgMCAwIDMuMDEgMi4zMjdjLjU3NiAwIDEuMTEtLjE2IDEuNTctLjQzLjE4LjUyLjIzNiAxLjA2My4xMzkgMS42MDV6Ii8+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">97.76%</text><text x="1275" y="140" transform="scale(.1)" fill="#fff" textLength="430">97.76%</text></g></svg>
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function r(r,e){if(e==null||e>r.length)e=r.length;for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function e(r){if(Array.isArray(r))return r}function t(r,e,t){if(e in r){Object.defineProperty(r,e,{value:t,enumerable:true,configurable:true,writable:true})}else{r[e]=t}return r}function n(r){if(typeof Symbol!=="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function o(r,e){var t=r==null?null:typeof Symbol!=="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(t==null)return;var n=[];var o=true;var a=false;var i,c;try{for(t=t.call(r);!(o=(i=t.next()).done);o=true){n.push(i.value);if(e&&n.length===e)break}}catch(r){a=true;c=r}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(a)throw c}}return n}function a(){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 i(r){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};var o=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){o=o.concat(Object.getOwnPropertySymbols(n).filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))}o.forEach(function(e){t(r,e,n[e])})}return r}function c(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);if(e){n=n.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})}t.push.apply(t,n)}return t}function u(r,e){e=e!=null?e:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(r,Object.getOwnPropertyDescriptors(e))}else{c(Object(e)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))})}return r}function s(r,t){return e(r)||o(r,t)||d(r,t)||a()}function f(r){return e(r)||n(r)||d(r)||a()}function d(e,t){if(!e)return;if(typeof e==="string")return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.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 r(e,t)}var l=require("@typescript-eslint/types");var v=require("@typescript-eslint/utils");var p={$schema:"http://json-schema.org/draft-07/schema#",additionalProperties:!1,properties:{autoFix:{default:!1,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:!0,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 y=v.ESLintUtils.RuleCreator(function(r){return r});function m(r){return y(u(i({},r),{defaultOptions:[{autoFix:!1,caseSensitive:!0,direction:"asc"}],meta:u(i({schema:[p]},r.meta),{docs:u(i({requiresTypeChecking:!1},r.meta.docs),{recommended:"warn"}),fixable:"code",messages:{"incorrect-order":"Expected decorators to be in sorted order. `@{{ after }}` should be before `@{{ previous }}`."},type:"layout"})}))}function b(r){var e=function(r){switch(r.type){case v.AST_NODE_TYPES.CallExpression:return e(r.callee);case v.AST_NODE_TYPES.Identifier:return r.name}throw new Error("Not a valid decorator.")};return e(r.expression)}function h(r,e,t){var n=t.autoFix,o=t.caseSensitive,a=t.direction,i=function(r){var e=b(r);return o?e:e.toLowerCase()},c=function(r,e){var t;return t=s(a==="desc"?[e,r]:[r,e],2),r=t[0],e=t[1],t,r===e?0:r<e?-1:1},u=e.map(function(r){return{name:i(r),node:r}}),d=function(e,t){var n=r.getSourceCode(),o=n.getText(),a=t.slice().sort(function(r,e){var t=r.name,n=e.name;return c(t,n)}).map(function(r){var e=r.node;return e}),i=a.map(function(r,e){var i=e===a.length-1?"":o.slice(t[e].node.range[1],t[e+1].node.range[0]);return n.getText(r)+i});return e.replaceTextRange([t[0].node.range[0],t[t.length-1].node.range[1]],i.join(""))},l=function(e){if(e.length<=1)return;var t=f(e),o=t[0],a=o.name,i=t.slice(1);var u=true,s=false,v=undefined;try{for(var p=i[Symbol.iterator](),y;!(u=(y=p.next()).done);u=true){var m=y.value,b=m.name,h=m.node;if(c(a,b)>0){r.report({data:{after:b,previous:a},fix:n?function(r){return d(r,e)}:void 0,messageId:"incorrect-order",node:h});return}}}catch(r){s=true;v=r}finally{try{if(!u&&p.return!=null){p.return()}}finally{if(s){throw v}}}n&&l(e.slice(1))};l(u)}var g="sort-on-accessors",O=m({create:function(r,e){var t=s(e,1),n=t[0];var o=n.autoFix,a=function(r){var e;var t=r.parent;return((e=t)===null||e===void 0?void 0:e.type)===l.AST_NODE_TYPES.MethodDefinition&&t.kind==="get"?t:!1};return o?{Decorator:function e(e){var t=a(e);if(!t)return;var o=t.decorators;o[0]===e&&h(r,o,n)}}:{Decorator:function e(e){var t=a(e);if(!t)return;var o=t.decorators,i=o.findIndex(function(r){return r===e});h(r,o.slice(i),n)}}},meta:{docs:{description:"Enforces order of accessors decorators"}},name:g});var S="sort-on-classes",E=m({create:function(r,e){var t=s(e,1),n=t[0];var o=n.autoFix;return o?{ClassDeclaration:function e(e){var t=e.decorators;h(r,t!==null&&t!==void 0?t:[],n)}}:{Decorator:function e(e){var t;var o=e.parent;if(((t=o)===null||t===void 0?void 0:t.type)!==l.AST_NODE_TYPES.ClassDeclaration)return;var a=o.decorators,i=a.findIndex(function(r){return r===e});h(r,a.slice(i),n)}}},meta:{docs:{description:"Enforces order of class decorators"}},name:S});var x="sort-on-methods",D=m({create:function(r,e){var t=s(e,1),n=t[0];var o=n.autoFix;return o?{MethodDefinition:function e(e){var t=e.decorators,o=e.kind;o==="method"&&h(r,t,n)}}:{Decorator:function e(e){var t;var o=e.parent;if(((t=o)===null||t===void 0?void 0:t.type)!==l.AST_NODE_TYPES.MethodDefinition)return;var a=o.decorators,i=a.findIndex(function(r){return r===e});h(r,a.slice(i),n)}}},meta:{docs:{description:"Enforces order of methods decorators"}},name:x});var P="sort-on-parameters",w=m({create:function(r,e){var t=s(e,1),n=t[0];var o=n.autoFix,a=function(r){var e,t;var n=r.parent;return((e=n)===null||e===void 0?void 0:e.type)===l.AST_NODE_TYPES.Identifier&&((t=n.parent)===null||t===void 0?void 0:t.type)===l.AST_NODE_TYPES.FunctionExpression?n:!1};return o?{Decorator:function e(e){var t=a(e);if(!t)return;var o=t.decorators;o[0]===e&&h(r,o,n)}}:{Decorator:function e(e){var t=a(e);if(!t)return;var o=t.decorators,i=o.findIndex(function(r){return r===e});h(r,o.slice(i),n)}}},meta:{docs:{description:"Enforces order of parameters decorators"}},name:P});var j="sort-on-properties",T=m({create:function(r,e){var t=s(e,1),n=t[0];var o=n.autoFix;return o?{PropertyDefinition:function e(e){var t=e.decorators;h(r,t!==null&&t!==void 0?t:[],n)}}:{Decorator:function e(e){var t;var o=e.parent;if(((t=o)===null||t===void 0?void 0:t.type)!==l.AST_NODE_TYPES.PropertyDefinition)return;var a=o.decorators,i=a.findIndex(function(r){return r===e});h(r,a.slice(i),n)}}},meta:{docs:{description:"Enforces order of properties decorators"}},name:j});var A="sort-decorators";function _(r){var e;return{parser:"@typescript-eslint/parser",plugins:[A],rules:(e={},t(e,"".concat(A,"/").concat(g),r),t(e,"".concat(A,"/").concat(S),r),t(e,"".concat(A,"/").concat(x),r),t(e,"".concat(A,"/").concat(P),r),t(e,"".concat(A,"/").concat(j),r),e)}}var I=_("warn");var F=_(["error",{autoFix:!0}]);var N;var C={configs:{recommended:I,strict:F},rules:(N={},t(N,g,O),t(N,S,E),t(N,x,D),t(N,P,w),t(N,j,T),N)};module.exports=C;//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";function r(r,e){if(e==null||e>r.length)e=r.length;for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function e(r){if(Array.isArray(r))return r}function t(r,e,t){if(e in r){Object.defineProperty(r,e,{value:t,enumerable:true,configurable:true,writable:true})}else{r[e]=t}return r}function n(r){if(typeof Symbol!=="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function o(r,e){var t=r==null?null:typeof Symbol!=="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(t==null)return;var n=[];var o=true;var a=false;var i,c;try{for(t=t.call(r);!(o=(i=t.next()).done);o=true){n.push(i.value);if(e&&n.length===e)break}}catch(r){a=true;c=r}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(a)throw c}}return n}function a(){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 i(r){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};var o=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){o=o.concat(Object.getOwnPropertySymbols(n).filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))}o.forEach(function(e){t(r,e,n[e])})}return r}function c(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);if(e){n=n.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})}t.push.apply(t,n)}return t}function u(r,e){e=e!=null?e:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(r,Object.getOwnPropertyDescriptors(e))}else{c(Object(e)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))})}return r}function s(r,t){return e(r)||o(r,t)||d(r,t)||a()}function f(r){return e(r)||n(r)||d(r)||a()}function d(e,t){if(!e)return;if(typeof e==="string")return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.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 r(e,t)}var l=require("@typescript-eslint/types");var v=require("@typescript-eslint/utils");var p={$schema:"http://json-schema.org/draft-07/schema#",additionalProperties:!1,properties:{autoFix:{default:!1,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:!0,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 y=v.ESLintUtils.RuleCreator(function(r){return r});function m(r){return y(u(i({},r),{defaultOptions:[{autoFix:!1,caseSensitive:!0,direction:"asc"}],meta:u(i({schema:[p]},r.meta),{docs:u(i({requiresTypeChecking:!1},r.meta.docs),{recommended:"warn"}),fixable:"code",messages:{"incorrect-order":"Expected decorators to be in sorted order. `@{{ after }}` should be before `@{{ previous }}`."},type:"layout"})}))}function b(r){var e=function(r){switch(r.type){case v.AST_NODE_TYPES.CallExpression:return e(r.callee);case v.AST_NODE_TYPES.Identifier:return r.name}throw new Error("Not a valid decorator.")};return e(r.expression)}function h(r,e,t){var n=t.autoFix,o=t.caseSensitive,a=t.direction,i=function(r){var e=b(r);return o?e:e.toLowerCase()},c=function(r,e){var t;return t=s(a==="desc"?[e,r]:[r,e],2),r=t[0],e=t[1],t,r===e?0:r<e?-1:1},u=e.map(function(r){return{name:i(r),node:r}}),d=function(e,t){var n=r.getSourceCode(),o=n.getText(),a=t.slice().sort(function(r,e){var t=r.name,n=e.name;return c(t,n)}).map(function(r){var e=r.node;return e}),i=a.map(function(r,e){var i=e===a.length-1?"":o.slice(t[e].node.range[1],t[e+1].node.range[0]);return n.getText(r)+i});return e.replaceTextRange([t[0].node.range[0],t[t.length-1].node.range[1]],i.join(""))},l=function(e){if(e.length<=1)return;var t=f(e),o=t[0],a=o.name,i=t.slice(1);var u=true,s=false,v=undefined;try{for(var p=i[Symbol.iterator](),y;!(u=(y=p.next()).done);u=true){var m=y.value,b=m.name,h=m.node;if(c(a,b)>0){r.report({data:{after:b,previous:a},fix:n?function(r){return d(r,e)}:void 0,messageId:"incorrect-order",node:h});return}}}catch(r){s=true;v=r}finally{try{if(!u&&p.return!=null){p.return()}}finally{if(s){throw v}}}n&&l(e.slice(1))};l(u)}var g="sort-on-accessors",O=m({create:function(r,e){var t=s(e,1),n=t[0];var o=n.autoFix,a=function(r){var e;var t=r.parent;return((e=t)===null||e===void 0?void 0:e.type)===l.AST_NODE_TYPES.MethodDefinition&&t.kind==="get"?t:!1};return o?{Decorator:function e(e){var t=a(e);if(!t)return;var o=t.decorators;o[0]===e&&h(r,o,n)}}:{Decorator:function e(e){var t=a(e);if(!t)return;var o=t.decorators,i=o.findIndex(function(r){return r===e});h(r,o.slice(i),n)}}},meta:{docs:{description:"Enforces order of accessors decorators"}},name:g});var S="sort-on-classes",E=m({create:function(r,e){var t=s(e,1),n=t[0];var o=n.autoFix;return o?{ClassDeclaration:function e(e){var t=e.decorators;h(r,t!==null&&t!==void 0?t:[],n)}}:{Decorator:function e(e){var t;var o=e.parent;if(((t=o)===null||t===void 0?void 0:t.type)!==l.AST_NODE_TYPES.ClassDeclaration)return;var a=o.decorators,i=a.findIndex(function(r){return r===e});h(r,a.slice(i),n)}}},meta:{docs:{description:"Enforces order of class decorators"}},name:S});var x="sort-on-methods",D=m({create:function(r,e){var t=s(e,1),n=t[0];var o=n.autoFix;return o?{MethodDefinition:function e(e){var t=e.decorators,o=e.kind;o==="method"&&h(r,t!==null&&t!==void 0?t:[],n)}}:{Decorator:function e(e){var t;var o=e.parent;if(((t=o)===null||t===void 0?void 0:t.type)!==l.AST_NODE_TYPES.MethodDefinition)return;var a=o.decorators,i=a.findIndex(function(r){return r===e});h(r,a.slice(i),n)}}},meta:{docs:{description:"Enforces order of methods decorators"}},name:x});var P="sort-on-parameters",w=m({create:function(r,e){var t=s(e,1),n=t[0];var o=n.autoFix,a=function(r){var e,t;var n=r.parent;return((e=n)===null||e===void 0?void 0:e.type)===l.AST_NODE_TYPES.Identifier&&((t=n.parent)===null||t===void 0?void 0:t.type)===l.AST_NODE_TYPES.FunctionExpression?n:!1};return o?{Decorator:function e(e){var t=a(e);if(!t)return;var o=t.decorators;o[0]===e&&h(r,o,n)}}:{Decorator:function e(e){var t=a(e);if(!t)return;var o=t.decorators,i=o.findIndex(function(r){return r===e});h(r,o.slice(i),n)}}},meta:{docs:{description:"Enforces order of parameters decorators"}},name:P});var j="sort-on-properties",T=m({create:function(r,e){var t=s(e,1),n=t[0];var o=n.autoFix;return o?{PropertyDefinition:function e(e){var t=e.decorators;h(r,t!==null&&t!==void 0?t:[],n)}}:{Decorator:function e(e){var t;var o=e.parent;if(((t=o)===null||t===void 0?void 0:t.type)!==l.AST_NODE_TYPES.PropertyDefinition)return;var a=o.decorators,i=a.findIndex(function(r){return r===e});h(r,a.slice(i),n)}}},meta:{docs:{description:"Enforces order of properties decorators"}},name:j});var A="sort-decorators";function _(r){var e;return{parser:"@typescript-eslint/parser",plugins:[A],rules:(e={},t(e,"".concat(A,"/").concat(g),r),t(e,"".concat(A,"/").concat(S),r),t(e,"".concat(A,"/").concat(x),r),t(e,"".concat(A,"/").concat(P),r),t(e,"".concat(A,"/").concat(j),r),e)}}var I=_("warn");var F=_(["error",{autoFix:!0}]);var N;var C={configs:{recommended:I,strict:F},rules:(N={},t(N,g,O),t(N,S,E),t(N,x,D),t(N,P,w),t(N,j,T),N)};module.exports=C;//# 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,IAAAC,EAAA,CACC,QAAW,0CACX,qBAAwB,GACxB,WAAc,CACb,QAAW,CACV,QAAW,GACX,YAAe,yHACf,KAAQ,SACT,EACA,cAAiB,CAChB,QAAW,GACX,YAAe,6DACf,KAAQ,SACT,EACA,UAAa,CACZ,QAAW,MACX,YAAe,yCACf,KAAQ,CAAC,MAAO,MAAM,EACtB,KAAQ,QACT,C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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\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- always defined on method definitions\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.Identifier &&\n\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":["../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,IAAAC,EAAA,CACC,QAAW,0CACX,qBAAwB,GACxB,WAAc,CACb,QAAW,CACV,QAAW,GACX,YAAe,yHACf,KAAQ,SACT,EACA,cAAiB,CAChB,QAAW,GACX,YAAe,6DACf,KAAQ,SACT,EACA,UAAa,CACZ,QAAW,MACX,YAAe,yCACf,KAAQ,CAAC,MAAO,MAAM,EACtB,KAAQ,QACT,CACD,EACA,KAAQ,QACT,EDEA,IAAMC,EAAkBF,EAAY,YAAYG,GAAQA,CAAI,EAMrD,SAASC,EAAeC,EAA+B,CAC7D,OAAOH,EAAgB,CACtB,GAAGG,EACH,eAAgB,CAAC,CAAE,QAAS,GAAO,cAAe,GAAM,UAAW,KAAM,CAAC,EAC1E,KAAM,CACL,OAAQ,CAACJ,CAAM,EAEf,GAAGI,EAAK,KACR,KAAM,CACL,qBAAsB,GAEtB,GAAGA,EAAK,KAAK,KACb,YAAa,MACd,EACA,QAAS,OACT,SAAU,CACT,kBACC,+FACF,EACA,KAAM,QACP,CACD,CAAC,CACF,CEnDA,OAAS,kBAAAN,MAAgC,2BAMlC,SAASO,EAAiBC,EAAuC,CACvE,IAAMC,EAAWC,GAA+C,CAC/D,OAAQA,EAAW,KAAM,CACxB,KAAKV,EAAe,eACnB,OAAOS,EAAQC,EAAW,MAAM,EAEjC,KAAKV,EAAe,WACnB,OAAOU,EAAW,IACpB,CAEA,MAAM,IAAI,MAAM,wBAAwB,CACzC,EAEA,OAAOD,EAAQD,EAAU,UAAU,CACpC,CCRO,SAASG,EACfC,EACAC,EACAC,EACC,CACD,GAAM,CAAE,QAAAC,EAAS,cAAAC,EAAe,UAAAC,CAAU,EAAIH,EAGxCL,EAAWD,GAAkC,CAClD,IAAMJ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L,YAAa,yCACd,CACD,EACA,KAAMW,CACP,CAAC,EC3BM,IAAME,EAAc,kBAMpB,SAASC,EAAoBC,EAAgD,CACnF,MAAO,CACN,OAAQ,4BACR,QAAS,CAACF,CAAW,EACrB,MAAO,CACN,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.Identifier &&\n\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"]}
|
package/package.json
CHANGED