@alien_intelligence/eslint-plugin-nitpicker 0.7.7 → 0.7.8

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/README.md CHANGED
@@ -93,9 +93,11 @@ The **base** rules are the universal ruleset shipped by `recommended`; the **Rea
93
93
  | `nitpicker/no-single-line-jsdoc` | yes | Require JSDoc comments to span multiple lines rather than a single line. |
94
94
  | `nitpicker/require-capitalized-comments` | yes | Require a comment to start with an uppercase letter. |
95
95
  | `nitpicker/require-complete-jsdoc` | | Require a function's JSDoc to document every parameter and its return value. |
96
+ | `nitpicker/require-consistent-member-jsdoc` | | Require every interface/type member to be documented once any member is. |
96
97
  | `nitpicker/require-framework-config` | | Warn when a file uses a framework whose Nitpicker config is not enabled. |
97
98
  | `nitpicker/require-function-jsdoc` | | Require a JSDoc on functions, including class methods and nested ones (`include`/`ignore` options). |
98
99
  | `nitpicker/require-jsdoc-delimiter-lines` | yes | Require a JSDoc's `/**` and `*/` to sit on their own lines, not share one with prose. |
100
+ | `nitpicker/require-member-jsdoc-blank-line` | yes | Require a blank line before a documented interface/type member (the first needs none). |
99
101
  | `nitpicker/require-multiline-object` | yes² | Require an object literal with more than a few properties (default 2) to span multiple lines. |
100
102
 
101
103
  ### React rules
@@ -200,6 +202,30 @@ A backtick renders as code inside a JSDoc block, but in a `//` comment it is jus
200
202
  ```
201
203
  Backticks are left alone in JSDoc and block comments, in tooling directives, when unpaired, in a run (a ```` ``` ```` fence), and when the span already holds a double quote, since `` `split(".")` `` cannot be requoted without nesting.
202
204
 
205
+ ### Interface member documentation
206
+ Two rules keep a documented interface (or type literal) readable. `require-consistent-member-jsdoc` makes documentation all-or-nothing per block, since a lone JSDoc among bare properties reads as an oversight:
207
+ ```ts
208
+ interface StoredTurn {
209
+ sessionId: string
210
+ /**
211
+ * Reasoning text, display only.
212
+ */
213
+ thinking?: string
214
+ }
215
+ ```
216
+ Documenting **none** of the members stays perfectly fine, so this only fires once you start. `require-member-jsdoc-blank-line` then keeps them apart, so each JSDoc reads as belonging to the member below it rather than trailing the one above:
217
+ ```ts
218
+ interface P {
219
+ allow_fallbacks?: boolean
220
+
221
+ /**
222
+ * Only route to providers that support every parameter.
223
+ */
224
+ require_parameters?: boolean
225
+ }
226
+ ```
227
+ The first member of a block needs no blank line above it.
228
+
203
229
  ### JSDoc completeness
204
230
  `require-complete-jsdoc` only inspects a function that already has a JSDoc (requiring the JSDoc itself is `require-function-jsdoc`'s job). It then checks the doc against the signature:
205
231
  ```js
package/dist/index.js CHANGED
@@ -1,18 +1,19 @@
1
- import {ESLintUtils,ASTUtils}from'@typescript-eslint/utils';var Pt={PLUGIN_NAME:"nitpicker",REPO_URL:"https://github.com/Alien-Intelligence/eslint-plugin-nitpicker",EM_DASH:"\u2014",EMOJI:new RegExp("\\p{Regional_Indicator}\\p{Regional_Indicator}|\\p{Emoji_Presentation}(?:\\uFE0F|\\p{Emoji_Modifier})?(?:\\u200D\\p{Emoji_Presentation}(?:\\uFE0F|\\p{Emoji_Modifier})?)*|\\p{Extended_Pictographic}\\uFE0F","gu"),COMMENTS:{BOX_DRAWING:/[─-▟]/,PURE_SEPARATOR:/^[-=~*#_+]{3,}$/,WRAPPED_LABEL:/^[-=~*#_+]{2,}\s.*\s[-=~*#_+]{2,}$/,DIRECTIVE:/^\s*(?:eslint\b|eslint-|globals?\b|exported\b|jshint\b|jslint\b|istanbul\b|[cv]8\b|ts-|prettier-ignore|biome-ignore|webpack\b|noinspection\b|@)/,QUOTES:new Set(['"',"`"]),ABBREVIATIONS:["e.g.","i.e.","etc.","vs.","cf.","al.","approx.","resp."],MAX_RUN_LENGTH:200},JSDOC:{TAG:/^\s*\*?\s*@(\w+)/,PARAM_TAG:/^\s*\*?\s*@param\s+(?:\{[^}]*\}\s*)?\[?([\w$]+)/,MAX_DESCRIPTION_LENGTH:250},WORDS:{WORD_CHAR:/[\p{L}\p{N}_$]/u,SUB_WORD:/[A-Z]+(?![a-z])|[A-Z][a-z]+|[a-z]+/g},OBJECTS:{MAX_INLINE_KEYS:2,INDENT_WIDTH:4},FUNCTIONS:{NODE_TYPES:new Set(["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"])},FRAMEWORKS:{ADONIS_SUBPATH:/^#(models|controllers|services|middleware|validators|policies|config|start|database|providers|lib)\b/,REACT_FILE:/\.[jt]sx$/},REACT:{HOOK:/^use[A-Z]/,CONTEXT_HOOK:/^use[A-Z]\w*Context$/,MEMO_HOOKS:new Set(["useMemo","useCallback"]),MAX_CLASSNAME_LENGTH:120},REQUEST:{RAW_ACCESSORS:new Set(["input","body","qs","all","only","except"])},MIGRATIONS:{INDEX_METHODS:new Set(["index","unique","primary","foreign"]),TIMESTAMP_METHODS:new Set(["timestamp","dateTime","datetime"]),AUDIT_TIMESTAMPS:new Set(["created_at","updated_at","deleted_at"]),CATEGORY_ORDER:["column","timestamp","index"]}},l=Pt;var xe=ESLintUtils.RuleCreator(()=>`${l.REPO_URL}/blob/main/README.md#rules`);var p=class{toRuleModule(){return xe({name:this.name,meta:this.meta,defaultOptions:this.defaultOptions,create:(e,i)=>this.create(e,i)})}};function c({problem:t,why:e,fix:i}){return `${t}
1
+ import {ESLintUtils,ASTUtils}from'@typescript-eslint/utils';var qt={PLUGIN_NAME:"nitpicker",REPO_URL:"https://github.com/Alien-Intelligence/eslint-plugin-nitpicker",EM_DASH:"\u2014",EMOJI:new RegExp("\\p{Regional_Indicator}\\p{Regional_Indicator}|\\p{Emoji_Presentation}(?:\\uFE0F|\\p{Emoji_Modifier})?(?:\\u200D\\p{Emoji_Presentation}(?:\\uFE0F|\\p{Emoji_Modifier})?)*|\\p{Extended_Pictographic}\\uFE0F","gu"),COMMENTS:{BOX_DRAWING:/[─-▟]/,PURE_SEPARATOR:/^[-=~*#_+]{3,}$/,WRAPPED_LABEL:/^[-=~*#_+]{2,}\s.*\s[-=~*#_+]{2,}$/,DIRECTIVE:/^\s*(?:eslint\b|eslint-|globals?\b|exported\b|jshint\b|jslint\b|istanbul\b|[cv]8\b|ts-|prettier-ignore|biome-ignore|webpack\b|noinspection\b|@)/,QUOTES:new Set(['"',"`"]),ABBREVIATIONS:["e.g.","i.e.","etc.","vs.","cf.","al.","approx.","resp."],MAX_RUN_LENGTH:200},JSDOC:{TAG:/^\s*\*?\s*@(\w+)/,PARAM_TAG:/^\s*\*?\s*@param\s+(?:\{[^}]*\}\s*)?\[?([\w$]+)/,MAX_DESCRIPTION_LENGTH:250},WORDS:{WORD_CHAR:/[\p{L}\p{N}_$]/u,SUB_WORD:/[A-Z]+(?![a-z])|[A-Z][a-z]+|[a-z]+/g},OBJECTS:{MAX_INLINE_KEYS:2,INDENT_WIDTH:4},FUNCTIONS:{NODE_TYPES:new Set(["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"])},FRAMEWORKS:{ADONIS_SUBPATH:/^#(models|controllers|services|middleware|validators|policies|config|start|database|providers|lib)\b/,REACT_FILE:/\.[jt]sx$/},REACT:{HOOK:/^use[A-Z]/,CONTEXT_HOOK:/^use[A-Z]\w*Context$/,MEMO_HOOKS:new Set(["useMemo","useCallback"]),MAX_CLASSNAME_LENGTH:120},REQUEST:{RAW_ACCESSORS:new Set(["input","body","qs","all","only","except"])},MIGRATIONS:{INDEX_METHODS:new Set(["index","unique","primary","foreign"]),TIMESTAMP_METHODS:new Set(["timestamp","dateTime","datetime"]),AUDIT_TIMESTAMPS:new Set(["created_at","updated_at","deleted_at"]),CATEGORY_ORDER:["column","timestamp","index"]}},l=qt;var Oe=ESLintUtils.RuleCreator(()=>`${l.REPO_URL}/blob/main/README.md#rules`);var p=class{toRuleModule(){return Oe({name:this.name,meta:this.meta,defaultOptions:this.defaultOptions,create:(e,t)=>this.create(e,t)})}};function c({problem:i,why:e,fix:t}){return `${i}
2
2
  - why: ${e}
3
- - fix: ${i}`}function Re(t){return t.parent.type==="ExportDefaultDeclaration"&&t.superClass?.type==="Identifier"&&t.superClass.name==="BaseSchema"}function Oe(t){if(t.callee.type!=="MemberExpression"||t.callee.property.type!=="Identifier"||t.callee.property.name!=="createTable"||t.callee.object.type!=="MemberExpression"||t.callee.object.property.type!=="Identifier"||t.callee.object.property.name!=="schema")return null;let e=t.arguments.at(-1);return e?.type!=="ArrowFunctionExpression"&&e?.type!=="FunctionExpression"||e.body.type!=="BlockStatement"||e.params[0]?.type!=="Identifier"?null:{body:e.body.body,builderName:e.params[0].name}}function Ne(t,e){if(t.type!=="ExpressionStatement")return null;let i=_t(t.expression,e);return i===null?null:l.MIGRATIONS.INDEX_METHODS.has(i.method)?"index":i.method==="timestamps"?"timestamp":l.MIGRATIONS.TIMESTAMP_METHODS.has(i.method)?i.firstArgument!==void 0&&l.MIGRATIONS.AUDIT_TIMESTAMPS.has(i.firstArgument)?"timestamp":null:"column"}function _t(t,e){let i=t;for(;i.type==="CallExpression"&&i.callee.type==="MemberExpression";){if(i.callee.object.type==="Identifier"&&i.callee.object.name===e){if(i.callee.property.type!=="Identifier")return null;let n=i.arguments[0],s=n?.type==="Literal"&&typeof n.value=="string"?n.value:void 0;return {method:i.callee.property.name,firstArgument:s}}i=i.callee.object;}return null}var F=class extends p{name="migration-table-order";defaultOptions=[];meta={type:"suggestion",docs:{description:"Group migration table statements as columns, then timestamps, then indexes and constraints.",recommended:true,category:"adonisjs"},schema:[],messages:{outOfOrder:c({problem:"This {{category}} is out of order in the table definition.",why:"A migration reads consistently when columns come first, then timestamps, then indexes and constraints, each grouped together",fix:"Move it into its group so the order stays columns, timestamps, then indexes and constraints"})}};create(e){return {CallExpression(i){let n=Oe(i);if(n===null)return;let s=0;for(let r of n.body){let o=Ne(r,n.builderName);if(o===null)continue;let m=l.MIGRATIONS.CATEGORY_ORDER.indexOf(o);m<s&&e.report({node:r,messageId:"outOfOrder",data:{category:o}}),s=Math.max(s,m);}}}}},Ie=new F;function Le(t){return t.parent.type==="ExportDefaultDeclaration"&&t.id?.name.endsWith("Controller")===true}function P(t){let e=[];for(let i of t.matchAll(l.WORDS.SUB_WORD))i.index!==void 0&&e.push({text:i[0],index:i.index});return e}function j(t,e){return t===t.toUpperCase()?e.toUpperCase():t.charAt(0)===t.charAt(0).toUpperCase()?e.charAt(0).toUpperCase()+e.slice(1):e}function Ce(t){return t!==void 0&&l.WORDS.WORD_CHAR.test(t)}function h(t){return l.COMMENTS.DIRECTIVE.test(t.value)}function ke(t){let e=t.range[0]+2;if(t.type==="Line"){let n=t.value.match(/\S/u);return n?.index===void 0?null:{index:e+n.index,char:n[0]}}let i=0;for(let n of t.value.split(`
4
- `)){let s=(n.match(/^\s*\*?\s*/u)?.[0]??"").length,r=n.slice(s).charAt(0);if(r!=="")return {index:e+i+s,char:r};i+=n.length+1;}return null}function De(t){let e=[],i=t.range[0]+2,n=null;for(let s=0;s<t.value.length;s++){let r=t.value.charAt(s);if(n!==null){r===n&&(n=null);continue}if(l.COMMENTS.QUOTES.has(r)&&t.value.includes(r,s+1)){n=r;continue}if(r!==".")continue;if(t.value.charAt(s+1)==="."){for(;t.value.charAt(s+1)===".";)s++;continue}let o=t.value.slice(s+1);o!==""&&!/^\s/u.test(o)||Jt(t.value.slice(0,s+1))||e.push({index:i+s,terminal:o.trim()===""});}return e}function we(t){let e=[],i=t.range[0]+2;for(let n=0;n<t.value.length;n++){if(t.value.charAt(n)!=="`")continue;if(t.value.charAt(n+1)==="`"){for(;t.value.charAt(n+1)==="`";)n++;continue}let s=t.value.indexOf("`",n+1);if(s===-1)break;let r=t.value.slice(n+1,s);r.includes('"')||e.push({start:i+n,end:i+s,text:r}),n=s;}return e}function Jt(t){let e=t.toLowerCase();return l.COMMENTS.ABBREVIATIONS.some(i=>{if(!e.endsWith(i))return false;let n=e.charAt(e.length-i.length-1);return n===""||!Ce(n)})}function S(t){return t.type==="Block"&&t.value.startsWith("*")}function Ut(t){let e=(t.type==="ExportDefaultDeclaration"||t.type==="ExportNamedDeclaration")&&t.declaration!==null?t.declaration:t,n=("decorators"in e?e.decorators:void 0)?.reduce((s,r)=>s===void 0||r.range[0]<s.range[0]?r:s,void 0);return n!==void 0&&n.range[0]<t.range[0]?n:t}function _(t,e){let i=t.getCommentsBefore(Ut(e)),n=i.length-1;for(;n>=0;){let r=i[n];if(r===void 0||!h(r))break;n--;}let s=i[n];return s!==void 0&&S(s)?s:null}function Me(t){let e=new Set;for(let i of t.value.split(`
5
- `)){let n=i.match(l.JSDOC.PARAM_TAG)?.[1];n!==void 0&&e.add(n);}return e}function Ae(t){return t.value.split(`
6
- `).some(e=>{let i=I(e);return i==="returns"||i==="return"})}function T(t,e){return _(t,e)!==null}function J(t){return /^\s*\*\s*$/.test(t)}function I(t){return t.match(l.JSDOC.TAG)?.[1]??null}function U(t){return I(t)!==null}function ve(t){let e=[];for(let i of t.value.split(`
7
- `)){let n=i.replace(/^\s*\*? ?/,"").trimEnd();if(n.startsWith("@"))break;e.push(n);}return e.join(" ").replace(/\s+/g," ").trim()}function ze(t,e){let i=-1;for(let s=e.loc.start.line+1;s<e.loc.end.line;s++){let r=I(t.lines[s-1]??"");if(r==="returns"||r==="return"){i=s;break}}if(i===-1)return null;let n=e.loc.end.line-1;for(let s=i+1;s<e.loc.end.line;s++)if(U(t.lines[s-1]??"")){n=s-1;break}return {from:i,to:n}}var q=class extends p{name="require-controller-jsdoc";defaultOptions=[];meta={type:"suggestion",docs:{description:"Require a JSDoc comment describing an AdonisJS controller.",recommended:true,category:"adonisjs"},schema:[],messages:{missingJSDoc:c({problem:"This controller has no JSDoc describing what it does.",why:"A controller's responsibility should be readable at a glance, before diving into its handler methods",fix:"Add a `/** ... */` JSDoc above the controller class summarizing what it handles"})}};create(e){return {ClassDeclaration(i){Le(i)&&(T(e.sourceCode,i.parent)||e.report({node:i.id??i,messageId:"missingJSDoc"}));}}}},Fe=new q;var B=class extends p{name="require-migration-jsdoc";defaultOptions=[];meta={type:"suggestion",docs:{description:"Require a JSDoc comment describing an AdonisJS migration.",recommended:true,category:"adonisjs"},schema:[],messages:{missingJSDoc:c({problem:"This migration has no JSDoc describing what it does.",why:"A migration's intent should be readable at a glance, the timestamped filename does not convey the schema change",fix:"Add a `/** ... */` JSDoc above the migration class summarizing the change"})}};create(e){return {ClassDeclaration(i){Re(i)&&(T(e.sourceCode,i.parent)||e.report({node:i.id??i,messageId:"missingJSDoc"}));}}}},Pe=new B;function qt(t){let e=t.replace(/\\/g,"/"),i="^";for(let n=0;n<e.length;n++){let s=e[n];if(s===void 0)break;s==="*"?e[n+1]==="*"?(i+=".*",n++,e[n+1]==="/"&&n++):i+="[^/]*":"\\^$.|?+()[]{}".includes(s)?i+=`\\${s}`:i+=s;}return new RegExp(`${i}$`)}function x(t,e){let i=t.replace(/\\/g,"/");return e.some(n=>qt(n).test(i))}var W=class extends p{name="require-validated-request";defaultOptions=[{allowIn:[]}];meta={type:"suggestion",docs:{description:"Require request data to be read through a Vine validator, not raw request accessors.",recommended:true,category:"adonisjs"},schema:[{type:"object",properties:{allowIn:{type:"array",items:{type:"string"}}},additionalProperties:false}],messages:{rawRead:c({problem:"`request.{{method}}()` reads request data directly.",why:"Request data must pass through a Vine validator so it is typed and checked, a raw accessor bypasses that contract",fix:"Read it through `request.validateUsing(someValidator)` instead"})}};create(e,i){let n=i[0]?.allowIn??[];if(n.length>0&&x(e.filename,n))return {};let s=r=>r.type==="Identifier"?r.name==="request":r.type==="MemberExpression"&&r.property.type==="Identifier"&&r.property.name==="request";return {CallExpression(r){r.callee.type!=="MemberExpression"||r.callee.property.type!=="Identifier"||!l.REQUEST.RAW_ACCESSORS.has(r.callee.property.name)||!s(r.callee.object)||e.report({node:r.callee.property,messageId:"rawRead",data:{method:r.callee.property.name}});}}}},je=new W;var G=class extends p{name="catch-error-name";defaultOptions=[];meta={type:"suggestion",docs:{description:"Require a `catch` clause to bind its error as `error`.",recommended:true,category:"base"},schema:[],messages:{rename:c({problem:"This `catch` binds the error as `{{name}}`.",why:"Every catch binds the error as `error` so error handling reads the same across the codebase",fix:"Rename the binding to `error`, or `_error` if it is intentionally unused"})}};create(e){return {CatchClause(i){i.param?.type==="Identifier"&&(i.param.name==="error"||i.param.name.startsWith("_")||e.report({node:i.param,messageId:"rename",data:{name:i.param.name}}));}}}},_e=new G;var V=class extends p{name="max-jsdoc-description-length";defaultOptions=[{max:l.JSDOC.MAX_DESCRIPTION_LENGTH}];meta={type:"suggestion",docs:{description:"Enforce a maximum character length for a JSDoc description.",recommended:true,category:"base"},schema:[{type:"object",properties:{max:{type:"integer",minimum:1}},additionalProperties:false}],messages:{tooLong:c({problem:"This JSDoc description is {{length}} characters, over the {{max}}-character limit.",why:"A JSDoc description should summarize what something is, an oversized one usually restates the code or explains how it is used, which does not belong here",fix:'Trim it to a concise summary of what it does, and remove any note about how or where it is used (e.g "used by X to ...", "called from Y"), which is an anti-pattern'})}};create(e,i){let n=i[0]?.max??l.JSDOC.MAX_DESCRIPTION_LENGTH;return {Program(){for(let s of e.sourceCode.getAllComments()){if(!S(s))continue;let r=ve(s).length;r<=n||e.report({loc:s.loc,messageId:"tooLong",data:{length:r,max:n}});}}}}},Je=new V;var $=class extends p{name="max-line-comment-length";defaultOptions=[{max:l.COMMENTS.MAX_RUN_LENGTH}];meta={type:"suggestion",docs:{description:"Enforce a maximum prose length for a run of consecutive `//` line comments.",recommended:true,category:"base"},schema:[{type:"object",properties:{max:{type:"integer",minimum:1}},additionalProperties:false}],messages:{tooLong:c({problem:"This run of line comments is {{length}} characters, over the {{max}}-character limit.",why:"A wall of stacked `//` lines is a paragraph in disguise, it buries the point and is hard to read next to the code",fix:"Cut it to the essential why, or move the long explanation into a JSDoc on the declaration it belongs to"})}};create(e,i){let n=i[0]?.max??l.COMMENTS.MAX_RUN_LENGTH,s=o=>o.map(m=>m.value.trim()).filter(m=>m!=="").join(" "),r=o=>{if(o.length===0)return;let m=s(o).length;if(m<=n)return;let a=o[0],f=o.at(-1);a===void 0||f===void 0||e.report({loc:{start:a.loc.start,end:f.loc.end},messageId:"tooLong",data:{length:m,max:n}});};return {Program(){let o=[];for(let m of e.sourceCode.getAllComments()){let a=o.at(-1),f=a!==void 0&&m.loc.start.line===a.loc.start.line+1;if(m.type!=="Line"||h(m)||!f){r(o),o=m.type==="Line"&&!h(m)?[m]:[];continue}o.push(m);}r(o);}}}},Ue=new $;function k(t){let e=[],i=t;for(;;){if(i.type==="ChainExpression"||i.type==="TSNonNullExpression"){i=i.expression;continue}if(i.type==="MemberExpression"){if(i.computed||i.property.type!=="Identifier")return null;e.unshift(i.property.name),i=i.object;continue}break}return e.length===0?null:i.type==="ThisExpression"?["this",...e].join("."):i.type==="Identifier"?[i.name,...e].join("."):null}function qe(t){return k(t)!==null}function D(t,e){let i=ASTUtils.findVariable(t,e);if(i===null)return false;let n=new Set(i.defs.map(s=>s.name));return i.references.some(s=>s.isWrite()&&!n.has(s.identifier))}function Be(t,e){for(let i of t)if(e===i||e.startsWith(`${i}.`))return true;return false}function We(t){return t.properties.length===0?false:t.properties.every(e=>e.type==="Property"&&e.shorthand&&!e.computed&&e.value.type==="Identifier")}var H=class extends p{name="no-alias-variables";defaultOptions=[];meta={type:"suggestion",docs:{description:"Disallow a `const` whose whole value is another variable, use the source directly.",recommended:true,category:"base"},schema:[],messages:{alias:c({problem:"`{{name}}` only aliases `{{source}}`.",why:"A variable that just renames another hides the original and adds a name to track for no gain",fix:"Remove it and use `{{source}}` directly, or rename `{{source}}` itself if the new name is better"})}};create(e){return {VariableDeclarator(i){i.parent.type!=="VariableDeclaration"||i.parent.kind!=="const"||i.parent.parent.type!=="ExportNamedDeclaration"&&(i.id.type!=="Identifier"||i.init?.type!=="Identifier"||i.id.typeAnnotation===void 0&&(D(e.sourceCode.getScope(i),i.init.name)||e.report({node:i,messageId:"alias",data:{name:i.id.name,source:i.init.name}})));}}}},Ge=new H;var Ve={colour:"color",colours:"colors",coloured:"colored",colouring:"coloring",behaviour:"behavior",behaviours:"behaviors",favour:"favor",favours:"favors",favoured:"favored",favouring:"favoring",favourable:"favorable",favourite:"favorite",favourites:"favorites",flavour:"flavor",flavours:"flavors",honour:"honor",honours:"honors",honoured:"honored",honouring:"honoring",labour:"labor",labours:"labors",laboured:"labored",labouring:"laboring",neighbour:"neighbor",neighbours:"neighbors",humour:"humor",humours:"humors",rumour:"rumor",rumours:"rumors",harbour:"harbor",harbours:"harbors",endeavour:"endeavor",endeavours:"endeavors",endeavoured:"endeavored",endeavouring:"endeavoring",normalise:"normalize",normalised:"normalized",normalising:"normalizing",normalisation:"normalization",initialise:"initialize",initialises:"initializes",initialised:"initialized",initialising:"initializing",initialisation:"initialization",serialise:"serialize",serialised:"serialized",serialising:"serializing",serialisation:"serialization",organise:"organize",organises:"organizes",organised:"organized",organising:"organizing",organisation:"organization",optimise:"optimize",optimised:"optimized",optimising:"optimizing",optimisation:"optimization",customise:"customize",customised:"customized",customising:"customizing",sanitise:"sanitize",sanitised:"sanitized",sanitising:"sanitizing",synchronise:"synchronize",synchronised:"synchronized",synchronising:"synchronizing",synchronisation:"synchronization",authorise:"authorize",authorised:"authorized",authorising:"authorizing",authorisation:"authorization",finalise:"finalize",finalised:"finalized",finalising:"finalizing",capitalise:"capitalize",capitalised:"capitalized",capitalising:"capitalizing",categorise:"categorize",categorises:"categorizes",categorised:"categorized",categorising:"categorizing",categorisation:"categorization",utilise:"utilize",utilises:"utilizes",utilised:"utilized",utilising:"utilizing",utilisation:"utilization",realise:"realize",realises:"realizes",realised:"realized",realising:"realizing",realisation:"realization",recognise:"recognize",recognises:"recognizes",recognised:"recognized",recognising:"recognizing",summarise:"summarize",summarises:"summarizes",summarised:"summarized",summarising:"summarizing",specialise:"specialize",specialises:"specializes",specialised:"specialized",specialising:"specializing",specialisation:"specialization",minimise:"minimize",minimises:"minimizes",minimised:"minimized",minimising:"minimizing",minimisation:"minimization",maximise:"maximize",maximises:"maximizes",maximised:"maximized",maximising:"maximizing",maximisation:"maximization",prioritise:"prioritize",prioritises:"prioritizes",prioritised:"prioritized",prioritising:"prioritizing",prioritisation:"prioritization",standardise:"standardize",standardises:"standardizes",standardised:"standardized",standardising:"standardizing",standardisation:"standardization",harmonise:"harmonize",harmonises:"harmonizes",harmonised:"harmonized",harmonising:"harmonizing",harmonisation:"harmonization",centralise:"centralize",centralises:"centralizes",centralised:"centralized",centralising:"centralizing",centralisation:"centralization",decentralise:"decentralize",decentralises:"decentralizes",decentralised:"decentralized",decentralising:"decentralizing",decentralisation:"decentralization",emphasise:"emphasize",emphasises:"emphasizes",emphasised:"emphasized",emphasising:"emphasizing",visualise:"visualize",visualises:"visualizes",visualised:"visualized",visualising:"visualizing",visualisation:"visualization",analyse:"analyze",analyses:"analyzes",analysed:"analyzed",analysing:"analyzing",paralyse:"paralyze",paralyses:"paralyzes",paralysed:"paralyzed",paralysing:"paralyzing",centre:"center",centred:"centered",centres:"centers",fibre:"fiber",fibres:"fibers",metre:"meter",metres:"meters",litre:"liter",litres:"liters",theatre:"theater",theatres:"theaters",calibre:"caliber",spectre:"specter",spectres:"specters",licence:"license",defence:"defense",offence:"offense",pretence:"pretense",practise:"practice",cancelled:"canceled",cancelling:"canceling",labelled:"labeled",labelling:"labeling",modelled:"modeled",modelling:"modeling",travelled:"traveled",travelling:"traveling",signalled:"signaled",signalling:"signaling",fuelled:"fueled",fuelling:"fueling",marvellous:"marvelous",counsellor:"counselor",fulfil:"fulfill",fulfils:"fulfills",fulfilment:"fulfillment",enrol:"enroll",enrols:"enrolls",enrolment:"enrollment",instalment:"installment",skilful:"skillful",wilful:"willful",dialogue:"dialog",dialogues:"dialogs",catalogue:"catalog",catalogues:"catalogs",analogue:"analog",analogues:"analogs",grey:"gray",artefact:"artifact",artefacts:"artifacts",sceptic:"skeptic",sceptical:"skeptical",programme:"program",programmes:"programs",enquiry:"inquiry",enquiries:"inquiries",aluminium:"aluminum",tyre:"tire",tyres:"tires"};function $e(t,e,i){let n=Object.create(null);for(let[s,r]of Object.entries(t))n[s.toLowerCase()]=r;for(let[s,r]of Object.entries(e))n[s.toLowerCase()]=r;for(let s of i)delete n[s.toLowerCase()];return n}var K=class extends p{name="no-british-english";defaultOptions=[{extra:{},ignore:[]}];meta={type:"suggestion",docs:{description:"Disallow British English spellings in identifiers and comments.",recommended:true,category:"base"},fixable:"code",schema:[{type:"object",properties:{extra:{type:"object",additionalProperties:{type:"string"}},ignore:{type:"array",items:{type:"string"}}},additionalProperties:false}],messages:{british:c({problem:"British spelling `{{british}}`, this codebase uses American English.",why:"One spelling convention keeps identifiers and docs consistent and searchable",fix:"Use `{{american}}` instead"})}};create(e,i){let n=$e(Ve,i[0]?.extra??{},i[0]?.ignore??[]);return {Identifier(s){if(!(s.parent.type==="MemberExpression"&&s.parent.property===s&&!s.parent.computed))for(let r of P(s.name)){let o=n[r.text.toLowerCase()];o!==void 0&&e.report({node:s,messageId:"british",data:{british:r.text,american:j(r.text,o)}});}},Program(){for(let s of e.sourceCode.getAllComments())for(let r of P(s.value)){let o=n[r.text.toLowerCase()];if(o===void 0)continue;let m=j(r.text,o),a=s.range[0]+2+r.index,f=a+r.text.length;e.report({loc:{start:e.sourceCode.getLocFromIndex(a),end:e.sourceCode.getLocFromIndex(f)},messageId:"british",data:{british:r.text,american:m},fix:y=>y.replaceTextRange([a,f],m)});}}}}},He=new K;function Ke(t){let e=t.replace(/^\s*\*?\s*/,"").trimEnd();return e.length===0?false:l.COMMENTS.BOX_DRAWING.test(e)||l.COMMENTS.PURE_SEPARATOR.test(e)||l.COMMENTS.WRAPPED_LABEL.test(e)}var X=class extends p{name="no-decorative-comment-separators";defaultOptions=[{allowIn:[]}];meta={type:"layout",docs:{description:"Disallow decorative separators (banners, box-drawing, repeated dashes) inside comments.",recommended:true,category:"base"},schema:[{type:"object",properties:{allowIn:{type:"array",items:{type:"string"}}},additionalProperties:false}],messages:{decorative:c({problem:"This comment uses a decorative separator.",why:"Repeated separator characters and box-drawing lines are visual noise that add nothing over a plain label",fix:"Remove the separator, a one-line label or a blank line already divides sections clearly"})}};create(e,i){let n=i[0]?.allowIn??[];return n.length>0&&x(e.filename,n)?{}:{Program(){for(let s of e.sourceCode.getAllComments()){let r=s.value.split(`
8
- `);for(let o=0;o<r.length;o++){let m=r[o];if(m===void 0||!Ke(m))continue;let a=s.loc.start.line+o,f=e.sourceCode.lines[a-1]??"";e.report({loc:{start:{line:a,column:0},end:{line:a,column:f.length}},messageId:"decorative"});}}}}}},Xe=new X;var Wt={strings:"String",templates:"Template",jsx:"JSXText"};function w(t,e){let i=new Set(e),n=[];if(i.size===0)return n;let s=new Set([...i].map(r=>Wt[r]).filter(r=>r!==void 0));for(let r of t.ast.tokens??[])s.has(r.type)&&n.push(r.range);if(i.has("comments"))for(let r of t.getAllComments())n.push(r.range);return n}function M(t,e){return e.some(([i,n])=>t>=i&&t<n)}var Y=class extends p{name="no-em-dash";defaultOptions=[{allow:[]}];meta={type:"suggestion",docs:{description:"Disallow the em dash (\u2014) character anywhere in the source.",recommended:true},schema:[{type:"object",properties:{allow:{type:"array",items:{type:"string",enum:["strings","templates","jsx","comments"]}}},additionalProperties:false}],messages:{emDash:c({problem:"Found an em dash (\u2014) character.",why:"Em dashes are typically introduced by AI-generated or auto-formatted text and are discouraged here.",fix:"Replace the em dash with a hyphen (-), a comma (,), or reword the sentence to avoid it, or allow it here with the rule's `allow` option if it is deliberate user-facing copy."})}};create(e,i){return {Program(){let n=e.sourceCode.getText(),s=w(e.sourceCode,i[0]?.allow??[]);for(let r=0;r<n.length;r++)n[r]===l.EM_DASH&&(M(r,s)||e.report({loc:{start:e.sourceCode.getLocFromIndex(r),end:e.sourceCode.getLocFromIndex(r+1)},messageId:"emDash"}));}}}},Ye=new Y;var Z=class extends p{name="no-emojis";defaultOptions=[{allow:[]}];meta={type:"suggestion",docs:{description:"Disallow emoji characters anywhere in the source.",recommended:true,category:"base"},schema:[{type:"object",properties:{allow:{type:"array",items:{type:"string",enum:["strings","templates","jsx","comments"]}}},additionalProperties:false}],messages:{emoji:c({problem:"Found an emoji ({{emoji}}).",why:"Emojis are usually introduced by AI-generated text and add noise to code, comments, and identifiers",fix:"Remove the emoji, or allow it here with the rule's `allow` option if it is deliberate user-facing copy"})}};create(e,i){return {Program(){let n=e.sourceCode.getText(),s=w(e.sourceCode,i[0]?.allow??[]);for(let r of n.matchAll(l.EMOJI))M(r.index,s)||e.report({loc:{start:e.sourceCode.getLocFromIndex(r.index),end:e.sourceCode.getLocFromIndex(r.index+r[0].length)},messageId:"emoji",data:{emoji:r[0]}});}}}},Ze=new Z;var Q=class extends p{name="no-jsdoc-blank-before-tags";defaultOptions=[];meta={type:"layout",fixable:"code",docs:{description:"Disallow blank lines before JSDoc tags such as `@param` or `@returns`.",recommended:true},schema:[],messages:{blankBeforeTag:c({problem:"There is a blank line before a JSDoc tag.",why:"Tags should follow the description directly; an empty line there is noise that inflates the comment.",fix:"Remove the blank line so the tag follows on directly."})}};create(e){return {Program(){for(let i of e.sourceCode.getAllComments())if(S(i)&&i.loc.start.line!==i.loc.end.line)for(let n=i.loc.start.line;n<=i.loc.end.line;n++){let s=e.sourceCode.lines[n-1];if(s===void 0||!J(s))continue;let r=n;for(;r<i.loc.end.line&&J(e.sourceCode.lines[r]??"");)r++;let o=e.sourceCode.lines[r];if(o!==void 0&&U(o)){let m=e.sourceCode.getIndexFromLoc({line:n,column:0}),a=e.sourceCode.getIndexFromLoc({line:r+1,column:0});e.report({loc:{start:{line:n,column:0},end:{line:r,column:s.length}},messageId:"blankBeforeTag",fix:f=>f.removeRange([m,a])});}n=r;}}}}},Qe=new Q;function E(t){let e=t;return e.parent.type==="Property"||e.parent.type==="MethodDefinition"?e.parent:(e.parent.type==="VariableDeclarator"&&e.parent.parent.type==="VariableDeclaration"&&(e=e.parent.parent),(e.parent.type==="ExportNamedDeclaration"||e.parent.type==="ExportDefaultDeclaration")&&(e=e.parent),e)}function et(t){return t.parent?.type==="Program"}function tt(t){let e=[],i=n=>{switch(n.type){case "Identifier":e.push({kind:"name",name:n.name,node:n});return;case "AssignmentPattern":i(n.left);return;case "RestElement":i(n.argument);return;case "TSParameterProperty":i(n.parameter);return;case "ObjectPattern":{let s=[];for(let r of n.properties)r.type==="RestElement"?r.argument.type==="Identifier"&&s.push({name:r.argument.name,node:r.argument}):r.key.type==="Identifier"&&s.push({name:r.key.name,node:r.key});s.length>0&&e.push({kind:"object",names:s,node:n});return}default:return}};for(let n of t.params)i(n);return e}function it(t){let e=t.parent;for(;e;){if(l.FUNCTIONS.NODE_TYPES.has(e.type))return e;e=e.parent;}return null}function rt(t){return t.type==="ArrowFunctionExpression"&&t.params.length===0&&t.body.type==="ImportExpression"}function R(t){if((t.type==="FunctionDeclaration"||t.type==="FunctionExpression")&&t.id)return t.id.name;if(t.parent.type==="VariableDeclarator"&&t.parent.id.type==="Identifier")return t.parent.id.name}function O(t,e,i){if(t.type==="ReturnStatement")return i(t.argument);for(let n of e[t.type]??[]){let s=t[n],r=Array.isArray(s)?s:[s];for(let o of r){let m=o;if(!(!m||typeof m.type!="string")&&!l.FUNCTIONS.NODE_TYPES.has(m.type)&&O(m,e,i))return true}}return false}function Gt(t,e){return t.type==="ArrowFunctionExpression"&&t.body.type!=="BlockStatement"?true:O(t.body,e,i=>i!==null)}function Vt(t){return t.typeAnnotation.type==="TSVoidKeyword"?true:t.typeAnnotation.type==="TSTypeReference"&&t.typeAnnotation.typeName.type==="Identifier"&&t.typeAnnotation.typeName.name==="Promise"?t.typeAnnotation.typeArguments?.params.length===1&&t.typeAnnotation.typeArguments?.params[0]?.type==="TSVoidKeyword":false}function A(t,e){return t.returnType?Vt(t.returnType):!Gt(t,e)}var ee=class extends p{name="no-jsdoc-returns-on-void";defaultOptions=[];meta={type:"suggestion",fixable:"code",docs:{description:"Disallow a JSDoc `@returns` tag on a function that returns nothing.",recommended:true,category:"base"},schema:[],messages:{voidReturns:c({problem:"This function returns nothing, but its JSDoc has a `@returns` tag.",why:"A `@returns` on a void function documents a value that never exists and drifts from the code",fix:"Remove the `@returns` tag"})}};create(e){let i=(n,s)=>{let r=e.sourceCode.getCommentsBefore(s).at(-1);if(r===void 0||!S(r))return;let o=ze(e.sourceCode,r);if(o===null||!A(n,e.sourceCode.visitorKeys))return;let m=e.sourceCode.getIndexFromLoc({line:o.from,column:0}),a=e.sourceCode.getIndexFromLoc({line:o.to+1,column:0});e.report({loc:{start:{line:o.from,column:0},end:{line:o.to,column:(e.sourceCode.lines[o.to-1]??"").length}},messageId:"voidReturns",fix:f=>f.removeRange([m,a])});};return {FunctionDeclaration(n){i(n,E(n));},VariableDeclarator(n){(n.init?.type==="ArrowFunctionExpression"||n.init?.type==="FunctionExpression")&&i(n.init,E(n.init));},MethodDefinition(n){n.value.type==="FunctionExpression"&&i(n.value,n);}}}},nt=new ee;var te=class extends p{name="no-line-comment-backticks";defaultOptions=[];meta={type:"suggestion",fixable:"code",docs:{description:"Disallow backticks in `//` line comments, use double quotes for code references.",recommended:true,category:"base"},schema:[],messages:{backticks:c({problem:"This line comment wraps `{{text}}` in backticks.",why:"Backticks only render as code inside a JSDoc block, in a `//` comment they stay literal characters, so double quotes read better",fix:'Wrap it in double quotes instead: "{{text}}"'})}};create(e){return {Program(){for(let i of e.sourceCode.getAllComments())if(!(i.type!=="Line"||h(i)))for(let n of we(i))e.report({loc:{start:e.sourceCode.getLocFromIndex(n.start),end:e.sourceCode.getLocFromIndex(n.end+1)},messageId:"backticks",data:{text:n.text},fix:s=>[s.replaceTextRange([n.start,n.start+1],'"'),s.replaceTextRange([n.end,n.end+1],'"')]});}}}},st=new te;var ie=class extends p{name="no-line-comment-period";defaultOptions=[];meta={type:"layout",fixable:"code",docs:{description:"Disallow prose periods in `//` line comments (code-reference dots and ellipses are allowed).",recommended:true},schema:[],messages:{period:c({problem:"This line comment ends with a period.",why:"Line comments should be short, clear fragments, not full sentences, so a closing period is just noise, dots inside code references like `foo.bar` are allowed.",fix:"Remove the period and keep the comment terse."}),sentence:c({problem:"This line comment runs two sentences together with a period.",why:"Line comments should be short, clear fragments, dropping the period on its own would leave a run-on, so the sentences belong on separate lines",fix:"Split it into one `//` line per fragment, or reword it as a single fragment (reported, not auto-fixed, so wrapped prose is never mangled)"})}};create(e){return {Program(){for(let i of e.sourceCode.getAllComments())if(i.type==="Line")for(let n of De(i)){let s={start:e.sourceCode.getLocFromIndex(n.index),end:e.sourceCode.getLocFromIndex(n.index+1)};if(n.terminal){e.report({loc:s,messageId:"period",fix:r=>r.removeRange([n.index,n.index+1])});continue}e.report({loc:s,messageId:"sentence"});}}}}},ot=new ie;var re=class extends p{name="no-property-access-alias";defaultOptions=[];meta={type:"suggestion",docs:{description:"Disallow a `const` whose whole value is a single property access, inline the expression instead.",recommended:true,category:"base"},schema:[],messages:{propertyAccessAlias:c({problem:"`{{name}}` only aliases the property access `{{expression}}`.",why:"A variable that just renames a property hides where the value comes from when scanning the code",fix:"Remove it and use `{{expression}}` inline, or use `let` if it is reassigned later"})}};create(e){let i=[],n=new Set,s=r=>{if(r.type!=="MemberExpression")return;let o=k(r);o!==null&&n.add(o);};return {AssignmentExpression(r){s(r.left);},UpdateExpression(r){s(r.argument);},VariableDeclarator(r){if(r.parent.type!=="VariableDeclaration"||r.parent.kind!=="const"||r.parent.parent.type==="ExportNamedDeclaration"||r.id.type!=="Identifier"||r.init===null||r.id.typeAnnotation!==void 0)return;let o=k(r.init);if(o===null)return;let m=o.slice(0,o.indexOf("."));m!=="this"&&D(e.sourceCode.getScope(r),m)||i.push({node:r,name:r.id.name,path:o,expression:e.sourceCode.getText(r.init)});},"Program:exit"(){for(let r of i)Be(n,r.path)||e.report({node:r.node,messageId:"propertyAccessAlias",data:{name:r.name,expression:r.expression}});}}}},at=new re;var ne=class extends p{name="no-property-destructuring";defaultOptions=[];meta={type:"suggestion",docs:{description:"Disallow shorthand destructuring off a plain object reference, access the property directly.",recommended:true,category:"base"},schema:[],messages:{destructure:c({problem:"Destructuring from `{{source}}` here just aliases its properties.",why:"Reading `{{source}}.x` at the use site keeps the origin visible, destructuring a plain object hides where a value comes from (destructuring a call or hook result is fine)",fix:"Access the properties on `{{source}}` directly instead of destructuring"})}};create(e){return {VariableDeclarator(i){i.parent.type!=="VariableDeclaration"||i.parent.kind!=="const"||i.parent.parent.type!=="ExportNamedDeclaration"&&(i.id.type!=="ObjectPattern"||i.init===null||i.init.type!=="Identifier"&&!qe(i.init)||We(i.id)&&e.report({node:i,messageId:"destructure",data:{source:e.sourceCode.getText(i.init)}}));}}}},lt=new ne;var se=class extends p{name="no-relative-imports";defaultOptions=[{allowIn:[]}];meta={type:"suggestion",docs:{description:"Disallow relative import and re-export specifiers, use the package path alias.",recommended:true,category:"base"},schema:[{type:"object",properties:{allowIn:{type:"array",items:{type:"string"}}},additionalProperties:false}],messages:{relative:c({problem:"This import uses a relative path (`{{path}}`).",why:"A relative path breaks when a file moves and hides which package a module belongs to, the path alias is stable and explicit",fix:"Import through the package alias (`#...` or `@frontend/...`) instead of a relative path"})}};create(e,i){let n=i[0]?.allowIn??[];if(n.length>0&&x(e.filename,n))return {};let s=r=>{r!=null&&(!r.value.startsWith("./")&&!r.value.startsWith("../")||e.report({node:r,messageId:"relative",data:{path:r.value}}));};return {ImportDeclaration(r){s(r.source);},ExportNamedDeclaration(r){s(r.source);},ExportAllDeclaration(r){s(r.source);},ImportExpression(r){r.source.type==="Literal"&&typeof r.source.value=="string"&&s(r.source);}}}},ct=new se;var oe=class extends p{name="no-single-line-jsdoc";defaultOptions=[];meta={type:"layout",fixable:"code",docs:{description:"Require JSDoc comments to span multiple lines rather than sit on a single line.",recommended:true},schema:[],messages:{singleLine:c({problem:"This JSDoc comment is written on a single line.",why:"Multi-line JSDoc is easier to read, diff, and extend with additional tags, and is the house style.",fix:"Put the opening `/**`, the ` * ` content, and the closing `*/` each on their own line."})}};create(e){return {Program(){for(let i of e.sourceCode.getAllComments()){if(!S(i)||i.loc.start.line!==i.loc.end.line)continue;let n=i.value.replace(/^\*/,"").trim();n.length!==0&&e.report({loc:i.loc,messageId:"singleLine",fix(s){let r=" ".repeat(i.loc.start.column),o=`/**
3
+ - fix: ${t}`}function Le(i){return i.parent.type==="ExportDefaultDeclaration"&&i.superClass?.type==="Identifier"&&i.superClass.name==="BaseSchema"}function Ie(i){if(i.callee.type!=="MemberExpression"||i.callee.property.type!=="Identifier"||i.callee.property.name!=="createTable"||i.callee.object.type!=="MemberExpression"||i.callee.object.property.type!=="Identifier"||i.callee.object.property.name!=="schema")return null;let e=i.arguments.at(-1);return e?.type!=="ArrowFunctionExpression"&&e?.type!=="FunctionExpression"||e.body.type!=="BlockStatement"||e.params[0]?.type!=="Identifier"?null:{body:e.body.body,builderName:e.params[0].name}}function Ne(i,e){if(i.type!=="ExpressionStatement")return null;let t=Ut(i.expression,e);return t===null?null:l.MIGRATIONS.INDEX_METHODS.has(t.method)?"index":t.method==="timestamps"?"timestamp":l.MIGRATIONS.TIMESTAMP_METHODS.has(t.method)?t.firstArgument!==void 0&&l.MIGRATIONS.AUDIT_TIMESTAMPS.has(t.firstArgument)?"timestamp":null:"column"}function Ut(i,e){let t=i;for(;t.type==="CallExpression"&&t.callee.type==="MemberExpression";){if(t.callee.object.type==="Identifier"&&t.callee.object.name===e){if(t.callee.property.type!=="Identifier")return null;let n=t.arguments[0],s=n?.type==="Literal"&&typeof n.value=="string"?n.value:void 0;return {method:t.callee.property.name,firstArgument:s}}t=t.callee.object;}return null}var P=class extends p{name="migration-table-order";defaultOptions=[];meta={type:"suggestion",docs:{description:"Group migration table statements as columns, then timestamps, then indexes and constraints.",recommended:true,category:"adonisjs"},schema:[],messages:{outOfOrder:c({problem:"This {{category}} is out of order in the table definition.",why:"A migration reads consistently when columns come first, then timestamps, then indexes and constraints, each grouped together",fix:"Move it into its group so the order stays columns, timestamps, then indexes and constraints"})}};create(e){return {CallExpression(t){let n=Ie(t);if(n===null)return;let s=0;for(let r of n.body){let o=Ne(r,n.builderName);if(o===null)continue;let m=l.MIGRATIONS.CATEGORY_ORDER.indexOf(o);m<s&&e.report({node:r,messageId:"outOfOrder",data:{category:o}}),s=Math.max(s,m);}}}}},ke=new P;function Ce(i){return i.parent.type==="ExportDefaultDeclaration"&&i.id?.name.endsWith("Controller")===true}function j(i){let e=[];for(let t of i.matchAll(l.WORDS.SUB_WORD))t.index!==void 0&&e.push({text:t[0],index:t.index});return e}function _(i,e){return i===i.toUpperCase()?e.toUpperCase():i.charAt(0)===i.charAt(0).toUpperCase()?e.charAt(0).toUpperCase()+e.slice(1):e}function De(i){return i!==void 0&&l.WORDS.WORD_CHAR.test(i)}function h(i){return l.COMMENTS.DIRECTIVE.test(i.value)}function we(i){let e=i.range[0]+2;if(i.type==="Line"){let n=i.value.match(/\S/u);return n?.index===void 0?null:{index:e+n.index,char:n[0]}}let t=0;for(let n of i.value.split(`
4
+ `)){let s=(n.match(/^\s*\*?\s*/u)?.[0]??"").length,r=n.slice(s).charAt(0);if(r!=="")return {index:e+t+s,char:r};t+=n.length+1;}return null}function Me(i){let e=[],t=i.range[0]+2,n=null;for(let s=0;s<i.value.length;s++){let r=i.value.charAt(s);if(n!==null){r===n&&(n=null);continue}if(l.COMMENTS.QUOTES.has(r)&&i.value.includes(r,s+1)){n=r;continue}if(r!==".")continue;if(i.value.charAt(s+1)==="."){for(;i.value.charAt(s+1)===".";)s++;continue}let o=i.value.slice(s+1);o!==""&&!/^\s/u.test(o)||Wt(i.value.slice(0,s+1))||e.push({index:t+s,terminal:o.trim()===""});}return e}function Ae(i){let e=[],t=i.range[0]+2;for(let n=0;n<i.value.length;n++){if(i.value.charAt(n)!=="`")continue;if(i.value.charAt(n+1)==="`"){for(;i.value.charAt(n+1)==="`";)n++;continue}let s=i.value.indexOf("`",n+1);if(s===-1)break;let r=i.value.slice(n+1,s);r.includes('"')||e.push({start:t+n,end:t+s,text:r}),n=s;}return e}function Wt(i){let e=i.toLowerCase();return l.COMMENTS.ABBREVIATIONS.some(t=>{if(!e.endsWith(t))return false;let n=e.charAt(e.length-t.length-1);return n===""||!De(n)})}function S(i){return i.type==="Block"&&i.value.startsWith("*")}function Gt(i){let e=(i.type==="ExportDefaultDeclaration"||i.type==="ExportNamedDeclaration")&&i.declaration!==null?i.declaration:i,n=("decorators"in e?e.decorators:void 0)?.reduce((s,r)=>s===void 0||r.range[0]<s.range[0]?r:s,void 0);return n!==void 0&&n.range[0]<i.range[0]?n:i}function b(i,e){let t=i.getCommentsBefore(Gt(e)),n=t.length-1;for(;n>=0;){let r=t[n];if(r===void 0||!h(r))break;n--;}let s=t[n];return s!==void 0&&S(s)?s:null}function ve(i){let e=new Set;for(let t of i.value.split(`
5
+ `)){let n=t.match(l.JSDOC.PARAM_TAG)?.[1];n!==void 0&&e.add(n);}return e}function ze(i){return i.value.split(`
6
+ `).some(e=>{let t=N(e);return t==="returns"||t==="return"})}function T(i,e){return b(i,e)!==null}function J(i){return /^\s*\*\s*$/.test(i)}function N(i){return i.match(l.JSDOC.TAG)?.[1]??null}function q(i){return N(i)!==null}function Fe(i){let e=[];for(let t of i.value.split(`
7
+ `)){let n=t.replace(/^\s*\*? ?/,"").trimEnd();if(n.startsWith("@"))break;e.push(n);}return e.join(" ").replace(/\s+/g," ").trim()}function Pe(i,e){let t=-1;for(let s=e.loc.start.line+1;s<e.loc.end.line;s++){let r=N(i.lines[s-1]??"");if(r==="returns"||r==="return"){t=s;break}}if(t===-1)return null;let n=e.loc.end.line-1;for(let s=t+1;s<e.loc.end.line;s++)if(q(i.lines[s-1]??"")){n=s-1;break}return {from:t,to:n}}var B=class extends p{name="require-controller-jsdoc";defaultOptions=[];meta={type:"suggestion",docs:{description:"Require a JSDoc comment describing an AdonisJS controller.",recommended:true,category:"adonisjs"},schema:[],messages:{missingJSDoc:c({problem:"This controller has no JSDoc describing what it does.",why:"A controller's responsibility should be readable at a glance, before diving into its handler methods",fix:"Add a `/** ... */` JSDoc above the controller class summarizing what it handles"})}};create(e){return {ClassDeclaration(t){Ce(t)&&(T(e.sourceCode,t.parent)||e.report({node:t.id??t,messageId:"missingJSDoc"}));}}}},je=new B;var U=class extends p{name="require-migration-jsdoc";defaultOptions=[];meta={type:"suggestion",docs:{description:"Require a JSDoc comment describing an AdonisJS migration.",recommended:true,category:"adonisjs"},schema:[],messages:{missingJSDoc:c({problem:"This migration has no JSDoc describing what it does.",why:"A migration's intent should be readable at a glance, the timestamped filename does not convey the schema change",fix:"Add a `/** ... */` JSDoc above the migration class summarizing the change"})}};create(e){return {ClassDeclaration(t){Le(t)&&(T(e.sourceCode,t.parent)||e.report({node:t.id??t,messageId:"missingJSDoc"}));}}}},_e=new U;function Vt(i){let e=i.replace(/\\/g,"/"),t="^";for(let n=0;n<e.length;n++){let s=e[n];if(s===void 0)break;s==="*"?e[n+1]==="*"?(t+=".*",n++,e[n+1]==="/"&&n++):t+="[^/]*":"\\^$.|?+()[]{}".includes(s)?t+=`\\${s}`:t+=s;}return new RegExp(`${t}$`)}function R(i,e){let t=i.replace(/\\/g,"/");return e.some(n=>Vt(n).test(t))}var W=class extends p{name="require-validated-request";defaultOptions=[{allowIn:[]}];meta={type:"suggestion",docs:{description:"Require request data to be read through a Vine validator, not raw request accessors.",recommended:true,category:"adonisjs"},schema:[{type:"object",properties:{allowIn:{type:"array",items:{type:"string"}}},additionalProperties:false}],messages:{rawRead:c({problem:"`request.{{method}}()` reads request data directly.",why:"Request data must pass through a Vine validator so it is typed and checked, a raw accessor bypasses that contract",fix:"Read it through `request.validateUsing(someValidator)` instead"})}};create(e,t){let n=t[0]?.allowIn??[];if(n.length>0&&R(e.filename,n))return {};let s=r=>r.type==="Identifier"?r.name==="request":r.type==="MemberExpression"&&r.property.type==="Identifier"&&r.property.name==="request";return {CallExpression(r){r.callee.type!=="MemberExpression"||r.callee.property.type!=="Identifier"||!l.REQUEST.RAW_ACCESSORS.has(r.callee.property.name)||!s(r.callee.object)||e.report({node:r.callee.property,messageId:"rawRead",data:{method:r.callee.property.name}});}}}},Je=new W;var G=class extends p{name="catch-error-name";defaultOptions=[];meta={type:"suggestion",docs:{description:"Require a `catch` clause to bind its error as `error`.",recommended:true,category:"base"},schema:[],messages:{rename:c({problem:"This `catch` binds the error as `{{name}}`.",why:"Every catch binds the error as `error` so error handling reads the same across the codebase",fix:"Rename the binding to `error`, or `_error` if it is intentionally unused"})}};create(e){return {CatchClause(t){t.param?.type==="Identifier"&&(t.param.name==="error"||t.param.name.startsWith("_")||e.report({node:t.param,messageId:"rename",data:{name:t.param.name}}));}}}},qe=new G;var V=class extends p{name="max-jsdoc-description-length";defaultOptions=[{max:l.JSDOC.MAX_DESCRIPTION_LENGTH}];meta={type:"suggestion",docs:{description:"Enforce a maximum character length for a JSDoc description.",recommended:true,category:"base"},schema:[{type:"object",properties:{max:{type:"integer",minimum:1}},additionalProperties:false}],messages:{tooLong:c({problem:"This JSDoc description is {{length}} characters, over the {{max}}-character limit.",why:"A JSDoc description should summarize what something is, an oversized one usually restates the code or explains how it is used, which does not belong here",fix:'Trim it to a concise summary of what it does, and remove any note about how or where it is used (e.g "used by X to ...", "called from Y"), which is an anti-pattern'})}};create(e,t){let n=t[0]?.max??l.JSDOC.MAX_DESCRIPTION_LENGTH;return {Program(){for(let s of e.sourceCode.getAllComments()){if(!S(s))continue;let r=Fe(s).length;r<=n||e.report({loc:s.loc,messageId:"tooLong",data:{length:r,max:n}});}}}}},Be=new V;var $=class extends p{name="max-line-comment-length";defaultOptions=[{max:l.COMMENTS.MAX_RUN_LENGTH}];meta={type:"suggestion",docs:{description:"Enforce a maximum prose length for a run of consecutive `//` line comments.",recommended:true,category:"base"},schema:[{type:"object",properties:{max:{type:"integer",minimum:1}},additionalProperties:false}],messages:{tooLong:c({problem:"This run of line comments is {{length}} characters, over the {{max}}-character limit.",why:"A wall of stacked `//` lines is a paragraph in disguise, it buries the point and is hard to read next to the code",fix:"Cut it to the essential why, or move the long explanation into a JSDoc on the declaration it belongs to"})}};create(e,t){let n=t[0]?.max??l.COMMENTS.MAX_RUN_LENGTH,s=o=>o.map(m=>m.value.trim()).filter(m=>m!=="").join(" "),r=o=>{if(o.length===0)return;let m=s(o).length;if(m<=n)return;let a=o[0],f=o.at(-1);a===void 0||f===void 0||e.report({loc:{start:a.loc.start,end:f.loc.end},messageId:"tooLong",data:{length:m,max:n}});};return {Program(){let o=[];for(let m of e.sourceCode.getAllComments()){let a=o.at(-1),f=a!==void 0&&m.loc.start.line===a.loc.start.line+1;if(m.type!=="Line"||h(m)||!f){r(o),o=m.type==="Line"&&!h(m)?[m]:[];continue}o.push(m);}r(o);}}}},Ue=new $;function D(i){let e=[],t=i;for(;;){if(t.type==="ChainExpression"||t.type==="TSNonNullExpression"){t=t.expression;continue}if(t.type==="MemberExpression"){if(t.computed||t.property.type!=="Identifier")return null;e.unshift(t.property.name),t=t.object;continue}break}return e.length===0?null:t.type==="ThisExpression"?["this",...e].join("."):t.type==="Identifier"?[t.name,...e].join("."):null}function We(i){return D(i)!==null}function w(i,e){let t=ASTUtils.findVariable(i,e);if(t===null)return false;let n=new Set(t.defs.map(s=>s.name));return t.references.some(s=>s.isWrite()&&!n.has(s.identifier))}function Ge(i,e){for(let t of i)if(e===t||e.startsWith(`${t}.`))return true;return false}function Ve(i){return i.properties.length===0?false:i.properties.every(e=>e.type==="Property"&&e.shorthand&&!e.computed&&e.value.type==="Identifier")}var H=class extends p{name="no-alias-variables";defaultOptions=[];meta={type:"suggestion",docs:{description:"Disallow a `const` whose whole value is another variable, use the source directly.",recommended:true,category:"base"},schema:[],messages:{alias:c({problem:"`{{name}}` only aliases `{{source}}`.",why:"A variable that just renames another hides the original and adds a name to track for no gain",fix:"Remove it and use `{{source}}` directly, or rename `{{source}}` itself if the new name is better"})}};create(e){return {VariableDeclarator(t){t.parent.type!=="VariableDeclaration"||t.parent.kind!=="const"||t.parent.parent.type!=="ExportNamedDeclaration"&&(t.id.type!=="Identifier"||t.init?.type!=="Identifier"||t.id.typeAnnotation===void 0&&(w(e.sourceCode.getScope(t),t.init.name)||e.report({node:t,messageId:"alias",data:{name:t.id.name,source:t.init.name}})));}}}},$e=new H;var He={colour:"color",colours:"colors",coloured:"colored",colouring:"coloring",behaviour:"behavior",behaviours:"behaviors",favour:"favor",favours:"favors",favoured:"favored",favouring:"favoring",favourable:"favorable",favourite:"favorite",favourites:"favorites",flavour:"flavor",flavours:"flavors",honour:"honor",honours:"honors",honoured:"honored",honouring:"honoring",labour:"labor",labours:"labors",laboured:"labored",labouring:"laboring",neighbour:"neighbor",neighbours:"neighbors",humour:"humor",humours:"humors",rumour:"rumor",rumours:"rumors",harbour:"harbor",harbours:"harbors",endeavour:"endeavor",endeavours:"endeavors",endeavoured:"endeavored",endeavouring:"endeavoring",normalise:"normalize",normalised:"normalized",normalising:"normalizing",normalisation:"normalization",initialise:"initialize",initialises:"initializes",initialised:"initialized",initialising:"initializing",initialisation:"initialization",serialise:"serialize",serialised:"serialized",serialising:"serializing",serialisation:"serialization",organise:"organize",organises:"organizes",organised:"organized",organising:"organizing",organisation:"organization",optimise:"optimize",optimised:"optimized",optimising:"optimizing",optimisation:"optimization",customise:"customize",customised:"customized",customising:"customizing",sanitise:"sanitize",sanitised:"sanitized",sanitising:"sanitizing",synchronise:"synchronize",synchronised:"synchronized",synchronising:"synchronizing",synchronisation:"synchronization",authorise:"authorize",authorised:"authorized",authorising:"authorizing",authorisation:"authorization",finalise:"finalize",finalised:"finalized",finalising:"finalizing",capitalise:"capitalize",capitalised:"capitalized",capitalising:"capitalizing",categorise:"categorize",categorises:"categorizes",categorised:"categorized",categorising:"categorizing",categorisation:"categorization",utilise:"utilize",utilises:"utilizes",utilised:"utilized",utilising:"utilizing",utilisation:"utilization",realise:"realize",realises:"realizes",realised:"realized",realising:"realizing",realisation:"realization",recognise:"recognize",recognises:"recognizes",recognised:"recognized",recognising:"recognizing",summarise:"summarize",summarises:"summarizes",summarised:"summarized",summarising:"summarizing",specialise:"specialize",specialises:"specializes",specialised:"specialized",specialising:"specializing",specialisation:"specialization",minimise:"minimize",minimises:"minimizes",minimised:"minimized",minimising:"minimizing",minimisation:"minimization",maximise:"maximize",maximises:"maximizes",maximised:"maximized",maximising:"maximizing",maximisation:"maximization",prioritise:"prioritize",prioritises:"prioritizes",prioritised:"prioritized",prioritising:"prioritizing",prioritisation:"prioritization",standardise:"standardize",standardises:"standardizes",standardised:"standardized",standardising:"standardizing",standardisation:"standardization",harmonise:"harmonize",harmonises:"harmonizes",harmonised:"harmonized",harmonising:"harmonizing",harmonisation:"harmonization",centralise:"centralize",centralises:"centralizes",centralised:"centralized",centralising:"centralizing",centralisation:"centralization",decentralise:"decentralize",decentralises:"decentralizes",decentralised:"decentralized",decentralising:"decentralizing",decentralisation:"decentralization",emphasise:"emphasize",emphasises:"emphasizes",emphasised:"emphasized",emphasising:"emphasizing",visualise:"visualize",visualises:"visualizes",visualised:"visualized",visualising:"visualizing",visualisation:"visualization",analyse:"analyze",analyses:"analyzes",analysed:"analyzed",analysing:"analyzing",paralyse:"paralyze",paralyses:"paralyzes",paralysed:"paralyzed",paralysing:"paralyzing",centre:"center",centred:"centered",centres:"centers",fibre:"fiber",fibres:"fibers",metre:"meter",metres:"meters",litre:"liter",litres:"liters",theatre:"theater",theatres:"theaters",calibre:"caliber",spectre:"specter",spectres:"specters",licence:"license",defence:"defense",offence:"offense",pretence:"pretense",practise:"practice",cancelled:"canceled",cancelling:"canceling",labelled:"labeled",labelling:"labeling",modelled:"modeled",modelling:"modeling",travelled:"traveled",travelling:"traveling",signalled:"signaled",signalling:"signaling",fuelled:"fueled",fuelling:"fueling",marvellous:"marvelous",counsellor:"counselor",fulfil:"fulfill",fulfils:"fulfills",fulfilment:"fulfillment",enrol:"enroll",enrols:"enrolls",enrolment:"enrollment",instalment:"installment",skilful:"skillful",wilful:"willful",dialogue:"dialog",dialogues:"dialogs",catalogue:"catalog",catalogues:"catalogs",analogue:"analog",analogues:"analogs",grey:"gray",artefact:"artifact",artefacts:"artifacts",sceptic:"skeptic",sceptical:"skeptical",programme:"program",programmes:"programs",enquiry:"inquiry",enquiries:"inquiries",aluminium:"aluminum",tyre:"tire",tyres:"tires"};function Ke(i,e,t){let n=Object.create(null);for(let[s,r]of Object.entries(i))n[s.toLowerCase()]=r;for(let[s,r]of Object.entries(e))n[s.toLowerCase()]=r;for(let s of t)delete n[s.toLowerCase()];return n}var K=class extends p{name="no-british-english";defaultOptions=[{extra:{},ignore:[]}];meta={type:"suggestion",docs:{description:"Disallow British English spellings in identifiers and comments.",recommended:true,category:"base"},fixable:"code",schema:[{type:"object",properties:{extra:{type:"object",additionalProperties:{type:"string"}},ignore:{type:"array",items:{type:"string"}}},additionalProperties:false}],messages:{british:c({problem:"British spelling `{{british}}`, this codebase uses American English.",why:"One spelling convention keeps identifiers and docs consistent and searchable",fix:"Use `{{american}}` instead"})}};create(e,t){let n=Ke(He,t[0]?.extra??{},t[0]?.ignore??[]);return {Identifier(s){if(!(s.parent.type==="MemberExpression"&&s.parent.property===s&&!s.parent.computed))for(let r of j(s.name)){let o=n[r.text.toLowerCase()];o!==void 0&&e.report({node:s,messageId:"british",data:{british:r.text,american:_(r.text,o)}});}},Program(){for(let s of e.sourceCode.getAllComments())for(let r of j(s.value)){let o=n[r.text.toLowerCase()];if(o===void 0)continue;let m=_(r.text,o),a=s.range[0]+2+r.index,f=a+r.text.length;e.report({loc:{start:e.sourceCode.getLocFromIndex(a),end:e.sourceCode.getLocFromIndex(f)},messageId:"british",data:{british:r.text,american:m},fix:y=>y.replaceTextRange([a,f],m)});}}}}},Xe=new K;function Ye(i){let e=i.replace(/^\s*\*?\s*/,"").trimEnd();return e.length===0?false:l.COMMENTS.BOX_DRAWING.test(e)||l.COMMENTS.PURE_SEPARATOR.test(e)||l.COMMENTS.WRAPPED_LABEL.test(e)}var X=class extends p{name="no-decorative-comment-separators";defaultOptions=[{allowIn:[]}];meta={type:"layout",docs:{description:"Disallow decorative separators (banners, box-drawing, repeated dashes) inside comments.",recommended:true,category:"base"},schema:[{type:"object",properties:{allowIn:{type:"array",items:{type:"string"}}},additionalProperties:false}],messages:{decorative:c({problem:"This comment uses a decorative separator.",why:"Repeated separator characters and box-drawing lines are visual noise that add nothing over a plain label",fix:"Remove the separator, a one-line label or a blank line already divides sections clearly"})}};create(e,t){let n=t[0]?.allowIn??[];return n.length>0&&R(e.filename,n)?{}:{Program(){for(let s of e.sourceCode.getAllComments()){let r=s.value.split(`
8
+ `);for(let o=0;o<r.length;o++){let m=r[o];if(m===void 0||!Ye(m))continue;let a=s.loc.start.line+o,f=e.sourceCode.lines[a-1]??"";e.report({loc:{start:{line:a,column:0},end:{line:a,column:f.length}},messageId:"decorative"});}}}}}},Ze=new X;var Ht={strings:"String",templates:"Template",jsx:"JSXText"};function M(i,e){let t=new Set(e),n=[];if(t.size===0)return n;let s=new Set([...t].map(r=>Ht[r]).filter(r=>r!==void 0));for(let r of i.ast.tokens??[])s.has(r.type)&&n.push(r.range);if(t.has("comments"))for(let r of i.getAllComments())n.push(r.range);return n}function A(i,e){return e.some(([t,n])=>i>=t&&i<n)}var Y=class extends p{name="no-em-dash";defaultOptions=[{allow:[]}];meta={type:"suggestion",docs:{description:"Disallow the em dash (\u2014) character anywhere in the source.",recommended:true},schema:[{type:"object",properties:{allow:{type:"array",items:{type:"string",enum:["strings","templates","jsx","comments"]}}},additionalProperties:false}],messages:{emDash:c({problem:"Found an em dash (\u2014) character.",why:"Em dashes are typically introduced by AI-generated or auto-formatted text and are discouraged here.",fix:"Replace the em dash with a hyphen (-), a comma (,), or reword the sentence to avoid it, or allow it here with the rule's `allow` option if it is deliberate user-facing copy."})}};create(e,t){return {Program(){let n=e.sourceCode.getText(),s=M(e.sourceCode,t[0]?.allow??[]);for(let r=0;r<n.length;r++)n[r]===l.EM_DASH&&(A(r,s)||e.report({loc:{start:e.sourceCode.getLocFromIndex(r),end:e.sourceCode.getLocFromIndex(r+1)},messageId:"emDash"}));}}}},Qe=new Y;var Z=class extends p{name="no-emojis";defaultOptions=[{allow:[]}];meta={type:"suggestion",docs:{description:"Disallow emoji characters anywhere in the source.",recommended:true,category:"base"},schema:[{type:"object",properties:{allow:{type:"array",items:{type:"string",enum:["strings","templates","jsx","comments"]}}},additionalProperties:false}],messages:{emoji:c({problem:"Found an emoji ({{emoji}}).",why:"Emojis are usually introduced by AI-generated text and add noise to code, comments, and identifiers",fix:"Remove the emoji, or allow it here with the rule's `allow` option if it is deliberate user-facing copy"})}};create(e,t){return {Program(){let n=e.sourceCode.getText(),s=M(e.sourceCode,t[0]?.allow??[]);for(let r of n.matchAll(l.EMOJI))A(r.index,s)||e.report({loc:{start:e.sourceCode.getLocFromIndex(r.index),end:e.sourceCode.getLocFromIndex(r.index+r[0].length)},messageId:"emoji",data:{emoji:r[0]}});}}}},et=new Z;var Q=class extends p{name="no-jsdoc-blank-before-tags";defaultOptions=[];meta={type:"layout",fixable:"code",docs:{description:"Disallow blank lines before JSDoc tags such as `@param` or `@returns`.",recommended:true},schema:[],messages:{blankBeforeTag:c({problem:"There is a blank line before a JSDoc tag.",why:"Tags should follow the description directly; an empty line there is noise that inflates the comment.",fix:"Remove the blank line so the tag follows on directly."})}};create(e){return {Program(){for(let t of e.sourceCode.getAllComments())if(S(t)&&t.loc.start.line!==t.loc.end.line)for(let n=t.loc.start.line;n<=t.loc.end.line;n++){let s=e.sourceCode.lines[n-1];if(s===void 0||!J(s))continue;let r=n;for(;r<t.loc.end.line&&J(e.sourceCode.lines[r]??"");)r++;let o=e.sourceCode.lines[r];if(o!==void 0&&q(o)){let m=e.sourceCode.getIndexFromLoc({line:n,column:0}),a=e.sourceCode.getIndexFromLoc({line:r+1,column:0});e.report({loc:{start:{line:n,column:0},end:{line:r,column:s.length}},messageId:"blankBeforeTag",fix:f=>f.removeRange([m,a])});}n=r;}}}}},tt=new Q;function E(i){let e=i;return e.parent.type==="Property"||e.parent.type==="MethodDefinition"?e.parent:(e.parent.type==="VariableDeclarator"&&e.parent.parent.type==="VariableDeclaration"&&(e=e.parent.parent),(e.parent.type==="ExportNamedDeclaration"||e.parent.type==="ExportDefaultDeclaration")&&(e=e.parent),e)}function it(i){return i.parent?.type==="Program"}function rt(i){let e=[],t=n=>{switch(n.type){case "Identifier":e.push({kind:"name",name:n.name,node:n});return;case "AssignmentPattern":t(n.left);return;case "RestElement":t(n.argument);return;case "TSParameterProperty":t(n.parameter);return;case "ObjectPattern":{let s=[];for(let r of n.properties)r.type==="RestElement"?r.argument.type==="Identifier"&&s.push({name:r.argument.name,node:r.argument}):r.key.type==="Identifier"&&s.push({name:r.key.name,node:r.key});s.length>0&&e.push({kind:"object",names:s,node:n});return}default:return}};for(let n of i.params)t(n);return e}function nt(i){let e=i.parent;for(;e;){if(l.FUNCTIONS.NODE_TYPES.has(e.type))return e;e=e.parent;}return null}function st(i){return i.type==="ArrowFunctionExpression"&&i.params.length===0&&i.body.type==="ImportExpression"}function O(i){if((i.type==="FunctionDeclaration"||i.type==="FunctionExpression")&&i.id)return i.id.name;if(i.parent.type==="VariableDeclarator"&&i.parent.id.type==="Identifier")return i.parent.id.name}function L(i,e,t){if(i.type==="ReturnStatement")return t(i.argument);for(let n of e[i.type]??[]){let s=i[n],r=Array.isArray(s)?s:[s];for(let o of r){let m=o;if(!(!m||typeof m.type!="string")&&!l.FUNCTIONS.NODE_TYPES.has(m.type)&&L(m,e,t))return true}}return false}function Kt(i,e){return i.type==="ArrowFunctionExpression"&&i.body.type!=="BlockStatement"?true:L(i.body,e,t=>t!==null)}function Xt(i){return i.typeAnnotation.type==="TSVoidKeyword"?true:i.typeAnnotation.type==="TSTypeReference"&&i.typeAnnotation.typeName.type==="Identifier"&&i.typeAnnotation.typeName.name==="Promise"?i.typeAnnotation.typeArguments?.params.length===1&&i.typeAnnotation.typeArguments?.params[0]?.type==="TSVoidKeyword":false}function v(i,e){return i.returnType?Xt(i.returnType):!Kt(i,e)}var ee=class extends p{name="no-jsdoc-returns-on-void";defaultOptions=[];meta={type:"suggestion",fixable:"code",docs:{description:"Disallow a JSDoc `@returns` tag on a function that returns nothing.",recommended:true,category:"base"},schema:[],messages:{voidReturns:c({problem:"This function returns nothing, but its JSDoc has a `@returns` tag.",why:"A `@returns` on a void function documents a value that never exists and drifts from the code",fix:"Remove the `@returns` tag"})}};create(e){let t=(n,s)=>{let r=e.sourceCode.getCommentsBefore(s).at(-1);if(r===void 0||!S(r))return;let o=Pe(e.sourceCode,r);if(o===null||!v(n,e.sourceCode.visitorKeys))return;let m=e.sourceCode.getIndexFromLoc({line:o.from,column:0}),a=e.sourceCode.getIndexFromLoc({line:o.to+1,column:0});e.report({loc:{start:{line:o.from,column:0},end:{line:o.to,column:(e.sourceCode.lines[o.to-1]??"").length}},messageId:"voidReturns",fix:f=>f.removeRange([m,a])});};return {FunctionDeclaration(n){t(n,E(n));},VariableDeclarator(n){(n.init?.type==="ArrowFunctionExpression"||n.init?.type==="FunctionExpression")&&t(n.init,E(n.init));},MethodDefinition(n){n.value.type==="FunctionExpression"&&t(n.value,n);}}}},ot=new ee;var te=class extends p{name="no-line-comment-backticks";defaultOptions=[];meta={type:"suggestion",fixable:"code",docs:{description:"Disallow backticks in `//` line comments, use double quotes for code references.",recommended:true,category:"base"},schema:[],messages:{backticks:c({problem:"This line comment wraps `{{text}}` in backticks.",why:"Backticks only render as code inside a JSDoc block, in a `//` comment they stay literal characters, so double quotes read better",fix:'Wrap it in double quotes instead: "{{text}}"'})}};create(e){return {Program(){for(let t of e.sourceCode.getAllComments())if(!(t.type!=="Line"||h(t)))for(let n of Ae(t))e.report({loc:{start:e.sourceCode.getLocFromIndex(n.start),end:e.sourceCode.getLocFromIndex(n.end+1)},messageId:"backticks",data:{text:n.text},fix:s=>[s.replaceTextRange([n.start,n.start+1],'"'),s.replaceTextRange([n.end,n.end+1],'"')]});}}}},at=new te;var ie=class extends p{name="no-line-comment-period";defaultOptions=[];meta={type:"layout",fixable:"code",docs:{description:"Disallow prose periods in `//` line comments (code-reference dots and ellipses are allowed).",recommended:true},schema:[],messages:{period:c({problem:"This line comment ends with a period.",why:"Line comments should be short, clear fragments, not full sentences, so a closing period is just noise, dots inside code references like `foo.bar` are allowed.",fix:"Remove the period and keep the comment terse."}),sentence:c({problem:"This line comment runs two sentences together with a period.",why:"Line comments should be short, clear fragments, dropping the period on its own would leave a run-on, so the sentences belong on separate lines",fix:"Split it into one `//` line per fragment, or reword it as a single fragment (reported, not auto-fixed, so wrapped prose is never mangled)"})}};create(e){return {Program(){for(let t of e.sourceCode.getAllComments())if(t.type==="Line")for(let n of Me(t)){let s={start:e.sourceCode.getLocFromIndex(n.index),end:e.sourceCode.getLocFromIndex(n.index+1)};if(n.terminal){e.report({loc:s,messageId:"period",fix:r=>r.removeRange([n.index,n.index+1])});continue}e.report({loc:s,messageId:"sentence"});}}}}},lt=new ie;var re=class extends p{name="no-property-access-alias";defaultOptions=[];meta={type:"suggestion",docs:{description:"Disallow a `const` whose whole value is a single property access, inline the expression instead.",recommended:true,category:"base"},schema:[],messages:{propertyAccessAlias:c({problem:"`{{name}}` only aliases the property access `{{expression}}`.",why:"A variable that just renames a property hides where the value comes from when scanning the code",fix:"Remove it and use `{{expression}}` inline, or use `let` if it is reassigned later"})}};create(e){let t=[],n=new Set,s=r=>{if(r.type!=="MemberExpression")return;let o=D(r);o!==null&&n.add(o);};return {AssignmentExpression(r){s(r.left);},UpdateExpression(r){s(r.argument);},VariableDeclarator(r){if(r.parent.type!=="VariableDeclaration"||r.parent.kind!=="const"||r.parent.parent.type==="ExportNamedDeclaration"||r.id.type!=="Identifier"||r.init===null||r.id.typeAnnotation!==void 0)return;let o=D(r.init);if(o===null)return;let m=o.slice(0,o.indexOf("."));m!=="this"&&w(e.sourceCode.getScope(r),m)||t.push({node:r,name:r.id.name,path:o,expression:e.sourceCode.getText(r.init)});},"Program:exit"(){for(let r of t)Ge(n,r.path)||e.report({node:r.node,messageId:"propertyAccessAlias",data:{name:r.name,expression:r.expression}});}}}},ct=new re;var ne=class extends p{name="no-property-destructuring";defaultOptions=[];meta={type:"suggestion",docs:{description:"Disallow shorthand destructuring off a plain object reference, access the property directly.",recommended:true,category:"base"},schema:[],messages:{destructure:c({problem:"Destructuring from `{{source}}` here just aliases its properties.",why:"Reading `{{source}}.x` at the use site keeps the origin visible, destructuring a plain object hides where a value comes from (destructuring a call or hook result is fine)",fix:"Access the properties on `{{source}}` directly instead of destructuring"})}};create(e){return {VariableDeclarator(t){t.parent.type!=="VariableDeclaration"||t.parent.kind!=="const"||t.parent.parent.type!=="ExportNamedDeclaration"&&(t.id.type!=="ObjectPattern"||t.init===null||t.init.type!=="Identifier"&&!We(t.init)||Ve(t.id)&&e.report({node:t,messageId:"destructure",data:{source:e.sourceCode.getText(t.init)}}));}}}},pt=new ne;var se=class extends p{name="no-relative-imports";defaultOptions=[{allowIn:[]}];meta={type:"suggestion",docs:{description:"Disallow relative import and re-export specifiers, use the package path alias.",recommended:true,category:"base"},schema:[{type:"object",properties:{allowIn:{type:"array",items:{type:"string"}}},additionalProperties:false}],messages:{relative:c({problem:"This import uses a relative path (`{{path}}`).",why:"A relative path breaks when a file moves and hides which package a module belongs to, the path alias is stable and explicit",fix:"Import through the package alias (`#...` or `@frontend/...`) instead of a relative path"})}};create(e,t){let n=t[0]?.allowIn??[];if(n.length>0&&R(e.filename,n))return {};let s=r=>{r!=null&&(!r.value.startsWith("./")&&!r.value.startsWith("../")||e.report({node:r,messageId:"relative",data:{path:r.value}}));};return {ImportDeclaration(r){s(r.source);},ExportNamedDeclaration(r){s(r.source);},ExportAllDeclaration(r){s(r.source);},ImportExpression(r){r.source.type==="Literal"&&typeof r.source.value=="string"&&s(r.source);}}}},mt=new se;var oe=class extends p{name="no-single-line-jsdoc";defaultOptions=[];meta={type:"layout",fixable:"code",docs:{description:"Require JSDoc comments to span multiple lines rather than sit on a single line.",recommended:true},schema:[],messages:{singleLine:c({problem:"This JSDoc comment is written on a single line.",why:"Multi-line JSDoc is easier to read, diff, and extend with additional tags, and is the house style.",fix:"Put the opening `/**`, the ` * ` content, and the closing `*/` each on their own line."})}};create(e){return {Program(){for(let t of e.sourceCode.getAllComments()){if(!S(t)||t.loc.start.line!==t.loc.end.line)continue;let n=t.value.replace(/^\*/,"").trim();n.length!==0&&e.report({loc:t.loc,messageId:"singleLine",fix(s){let r=" ".repeat(t.loc.start.column),o=`/**
9
9
  ${r} * ${n}
10
- ${r} */`;return s.replaceTextRange(i.range,o)}});}}}}},pt=new oe;var ae=class extends p{name="require-capitalized-comments";defaultOptions=[];meta={type:"suggestion",fixable:"code",docs:{description:"Require a comment to start with an uppercase letter.",recommended:true,category:"base"},schema:[],messages:{capitalize:c({problem:"This comment starts with a lowercase letter.",why:"A comment reads as a sentence, and a sentence starts with a capital letter",fix:"Capitalize the first letter of the comment"})}};create(e){let i=n=>{if(n.type!=="Line")return false;let s=e.sourceCode.lines[n.loc.start.line-2];return s!==void 0&&/^\s*\/\//.test(s)};return {Program(){for(let n of e.sourceCode.getAllComments()){if(h(n)||i(n))continue;let s=ke(n);s===null||!new RegExp("\\p{Ll}","u").test(s.char)||/^(?:https?:\/\/|www\.)/u.test(e.sourceCode.getText().slice(s.index))||e.report({loc:{start:e.sourceCode.getLocFromIndex(s.index),end:e.sourceCode.getLocFromIndex(s.index+s.char.length)},messageId:"capitalize",fix:r=>r.replaceTextRange([s.index,s.index+s.char.length],s.char.toUpperCase())});}}}}},mt=new ae;function le(t){return /^[A-Z]/.test(t)}function v(t){return l.REACT.HOOK.test(t)}function ut(t){return l.REACT.CONTEXT_HOOK.test(t)}function ce(t){return t?t.type==="ArrowFunctionExpression"||t.type==="FunctionExpression"?true:t.type==="CallExpression"&&t.callee.type==="Identifier"&&t.callee.name==="useCallback":false}function b(t){if(!t)return false;switch(t.type){case "JSXElement":case "JSXFragment":return true;case "ConditionalExpression":return b(t.consequent)||b(t.alternate);case "LogicalExpression":return b(t.left)||b(t.right);case "SequenceExpression":return b(t.expressions.at(-1));default:return false}}function L(t,e){return t.type==="ArrowFunctionExpression"&&t.body.type!=="BlockStatement"?b(t.body):O(t.body,e,b)}function dt(t,e){let i=R(t);return i===void 0?false:v(i)||le(i)&&L(t,e)}function ft(t,e){if(t.type==="CallExpression")return !(t.callee.type==="Identifier"&&v(t.callee.name));for(let i of e[t.type]??[]){let n=t[i],s=Array.isArray(n)?n:[n];for(let r of s){let o=r;if(!(!o||typeof o.type!="string")&&!l.FUNCTIONS.NODE_TYPES.has(o.type)&&ft(o,e))return true}}return false}function gt(t,e){return t.type==="ArrowFunctionExpression"||t.type==="FunctionExpression"?false:ft(t,e)}var pe=class extends p{name="require-complete-jsdoc";defaultOptions=[];meta={type:"suggestion",docs:{description:"Require a function's JSDoc to document every parameter and its return value.",recommended:true,category:"base"},schema:[],messages:{missingParam:c({problem:"The JSDoc does not document the parameter `{{name}}`.",why:"A JSDoc that skips a parameter drifts from the signature and stops describing what the function takes",fix:"Add an `@param {{name}} ...` line describing what it is"}),missingReturns:c({problem:"The JSDoc has no `@returns`, but this function returns a value.",why:"A documented function should say what it hands back, a missing `@returns` leaves the caller guessing",fix:"Add a `@returns ...` line describing the value (a void or `Promise<void>` function needs none)"})}};create(e){let i=n=>{let s=_(e.sourceCode,E(n));if(s===null)return;let r=Me(s),o=tt(n),m=new Set(o.filter(a=>a.kind==="name").map(a=>a.name));for(let a of o){if(a.kind==="name"){r.has(a.name)||e.report({node:a.node,messageId:"missingParam",data:{name:a.name}});continue}if(a.names.every(g=>r.has(g.name)))continue;let f=new Set(a.names.map(g=>g.name));if(![...r].some(g=>!f.has(g)&&!m.has(g)))for(let g of a.names)r.has(g.name)||e.report({node:g.node,messageId:"missingParam",data:{name:g.name}});}Ae(s)||A(n,e.sourceCode.visitorKeys)||L(n,e.sourceCode.visitorKeys)||e.report({node:s,messageId:"missingReturns"});};return {FunctionDeclaration(n){i(n);},FunctionExpression(n){i(n);},ArrowFunctionExpression(n){i(n);}}}},yt=new pe;var St={adonisjs:"AdonisJS",react:"React"};function $t(t){let e=[];for(let i of t.ast.body)i.type==="ImportDeclaration"&&e.push(String(i.source.value));return e}function ht(t,e){let i=new Set,n=$t(t);return n.some(r=>r.startsWith("@adonisjs/")||l.FRAMEWORKS.ADONIS_SUBPATH.test(r))&&i.add("adonisjs"),(n.some(r=>r==="react"||r.startsWith("react/")||r==="react-dom")||l.FRAMEWORKS.REACT_FILE.test(e))&&i.add("react"),i}var me=class extends p{name="require-framework-config";defaultOptions=[{ignore:[]}];meta={type:"suggestion",docs:{description:"Warn when a file uses a framework whose Nitpicker config is not enabled.",recommended:true,category:"base"},schema:[{type:"object",properties:{ignore:{type:"array",items:{type:"string",enum:["adonisjs","react"]}}},additionalProperties:false}],messages:{missingConfig:c({problem:"This file uses {{framework}} but the Nitpicker {{framework}} rules are not enabled.",why:"Framework rules only run when you opt into the matching config, so files like this one go unchecked",fix:"Add `nitpicker.configs.{{config}}` (scoped to these files) to your ESLint config, or turn off `nitpicker/require-framework-config`"})}};create(e,i){let n=new Set(i[0]?.ignore??[]),s=e.settings[l.PLUGIN_NAME]??{};return {Program(r){let o=ht(e.sourceCode,e.filename);for(let m of o)n.has(m)||s[m]||e.report({node:r,messageId:"missingConfig",data:{framework:St[m],config:m}});}}}},Tt=new me;var ue=class extends p{name="require-function-jsdoc";defaultOptions=[{include:["class-methods","nested"],ignore:[]}];meta={type:"suggestion",docs:{description:"Require a JSDoc comment on functions, except React component functions.",recommended:true},schema:[{type:"object",properties:{include:{type:"array",items:{type:"string",enum:["class-methods","object-methods","nested"]}},ignore:{type:"array",items:{type:"string"}}},additionalProperties:false}],messages:{missingJSDoc:c({problem:"The function `{{name}}` has no JSDoc comment.",why:"A function must document its purpose, parameters, and return value, React component functions are the only exception",fix:"Add a `/** ... */` JSDoc block immediately above it describing what it does"})}};create(e,i){let n=new Set(i[0]?.include??["class-methods","nested"]),s=new Set(i[0]?.ignore??[]),r=(a,f,y,g)=>{s.has(y)||rt(a)||le(y)&&L(a,e.sourceCode.visitorKeys)||T(e.sourceCode,f)||e.report({node:g,messageId:"missingJSDoc",data:{name:y}});},o=(a,f)=>{let y=R(a);if(y===void 0)return;let g=E(a);g.type==="MethodDefinition"||g.type==="Property"||!et(g)&&!n.has("nested")||r(a,g,y,f);},m=a=>{if(a.type==="Identifier")return a.name;if(a.type==="Literal"&&typeof a.value=="string")return a.value};return {FunctionDeclaration(a){o(a,a.id??a);},VariableDeclarator(a){a.init&&(a.init.type!=="ArrowFunctionExpression"&&a.init.type!=="FunctionExpression"||o(a.init,a.id));},MethodDefinition(a){if(!n.has("class-methods")||a.computed||a.value.type!=="FunctionExpression")return;let f=m(a.key);f!==void 0&&r(a.value,a,f,a.key);},Property(a){if(!n.has("object-methods")||a.computed||a.value.type!=="ArrowFunctionExpression"&&a.value.type!=="FunctionExpression")return;let f=m(a.key);f!==void 0&&r(a.value,a,f,a.key);}}}},Et=new ue;var de=class extends p{name="require-jsdoc-delimiter-lines";defaultOptions=[];meta={type:"layout",fixable:"whitespace",docs:{description:"Require a JSDoc's opening and closing delimiters to sit on their own lines.",recommended:true,category:"base"},schema:[],messages:{openingLine:c({problem:"This JSDoc starts its text on the same line as the opening delimiter.",why:"A block that opens mid-line breaks the aligned column of markers and reads unevenly",fix:"Move the text to the next line so the opening delimiter sits alone"}),closingLine:c({problem:"This JSDoc ends its text on the same line as the closing delimiter.",why:"A block that closes mid-line breaks the aligned column of markers and reads unevenly",fix:"Move the closing delimiter onto its own line below the text"})}};create(e){let i=n=>{if(n.loc.start.line===n.loc.end.line)return;let s=n.value.split(`
10
+ ${r} */`;return s.replaceTextRange(t.range,o)}});}}}}},ut=new oe;var ae=class extends p{name="require-capitalized-comments";defaultOptions=[];meta={type:"suggestion",fixable:"code",docs:{description:"Require a comment to start with an uppercase letter.",recommended:true,category:"base"},schema:[],messages:{capitalize:c({problem:"This comment starts with a lowercase letter.",why:"A comment reads as a sentence, and a sentence starts with a capital letter",fix:"Capitalize the first letter of the comment"})}};create(e){let t=n=>{if(n.type!=="Line")return false;let s=e.sourceCode.lines[n.loc.start.line-2];return s!==void 0&&/^\s*\/\//.test(s)};return {Program(){for(let n of e.sourceCode.getAllComments()){if(h(n)||t(n))continue;let s=we(n);s===null||!new RegExp("\\p{Ll}","u").test(s.char)||/^(?:https?:\/\/|www\.)/u.test(e.sourceCode.getText().slice(s.index))||e.report({loc:{start:e.sourceCode.getLocFromIndex(s.index),end:e.sourceCode.getLocFromIndex(s.index+s.char.length)},messageId:"capitalize",fix:r=>r.replaceTextRange([s.index,s.index+s.char.length],s.char.toUpperCase())});}}}}},dt=new ae;function le(i){return /^[A-Z]/.test(i)}function z(i){return l.REACT.HOOK.test(i)}function ft(i){return l.REACT.CONTEXT_HOOK.test(i)}function ce(i){return i?i.type==="ArrowFunctionExpression"||i.type==="FunctionExpression"?true:i.type==="CallExpression"&&i.callee.type==="Identifier"&&i.callee.name==="useCallback":false}function x(i){if(!i)return false;switch(i.type){case "JSXElement":case "JSXFragment":return true;case "ConditionalExpression":return x(i.consequent)||x(i.alternate);case "LogicalExpression":return x(i.left)||x(i.right);case "SequenceExpression":return x(i.expressions.at(-1));default:return false}}function k(i,e){return i.type==="ArrowFunctionExpression"&&i.body.type!=="BlockStatement"?x(i.body):L(i.body,e,x)}function gt(i,e){let t=O(i);return t===void 0?false:z(t)||le(t)&&k(i,e)}function yt(i,e){if(i.type==="CallExpression")return !(i.callee.type==="Identifier"&&z(i.callee.name));for(let t of e[i.type]??[]){let n=i[t],s=Array.isArray(n)?n:[n];for(let r of s){let o=r;if(!(!o||typeof o.type!="string")&&!l.FUNCTIONS.NODE_TYPES.has(o.type)&&yt(o,e))return true}}return false}function St(i,e){return i.type==="ArrowFunctionExpression"||i.type==="FunctionExpression"?false:yt(i,e)}var pe=class extends p{name="require-complete-jsdoc";defaultOptions=[];meta={type:"suggestion",docs:{description:"Require a function's JSDoc to document every parameter and its return value.",recommended:true,category:"base"},schema:[],messages:{missingParam:c({problem:"The JSDoc does not document the parameter `{{name}}`.",why:"A JSDoc that skips a parameter drifts from the signature and stops describing what the function takes",fix:"Add an `@param {{name}} ...` line describing what it is"}),missingReturns:c({problem:"The JSDoc has no `@returns`, but this function returns a value.",why:"A documented function should say what it hands back, a missing `@returns` leaves the caller guessing",fix:"Add a `@returns ...` line describing the value (a void or `Promise<void>` function needs none)"})}};create(e){let t=n=>{let s=b(e.sourceCode,E(n));if(s===null)return;let r=ve(s),o=rt(n),m=new Set(o.filter(a=>a.kind==="name").map(a=>a.name));for(let a of o){if(a.kind==="name"){r.has(a.name)||e.report({node:a.node,messageId:"missingParam",data:{name:a.name}});continue}if(a.names.every(g=>r.has(g.name)))continue;let f=new Set(a.names.map(g=>g.name));if(![...r].some(g=>!f.has(g)&&!m.has(g)))for(let g of a.names)r.has(g.name)||e.report({node:g.node,messageId:"missingParam",data:{name:g.name}});}ze(s)||v(n,e.sourceCode.visitorKeys)||k(n,e.sourceCode.visitorKeys)||e.report({node:s,messageId:"missingReturns"});};return {FunctionDeclaration(n){t(n);},FunctionExpression(n){t(n);},ArrowFunctionExpression(n){t(n);}}}},ht=new pe;var me=class extends p{name="require-consistent-member-jsdoc";defaultOptions=[];meta={type:"suggestion",docs:{description:"Require every member of an interface to be documented once any member is.",recommended:true,category:"base"},schema:[],messages:{inconsistent:c({problem:"This member has no JSDoc, but other members of the same block do.",why:"A lone JSDoc among bare members reads as an oversight, documentation should be all or nothing per block",fix:"Document this member too, or drop the JSDoc from the members that carry one"})}};create(e){let t=n=>{if(n.length<2)return;let s=n.filter(r=>b(e.sourceCode,r)===null);if(!(s.length===0||s.length===n.length))for(let r of s)e.report({node:r,messageId:"inconsistent"});};return {TSInterfaceBody(n){t(n.body);},TSTypeLiteral(n){t(n.members);}}}},Tt=new me;var bt={adonisjs:"AdonisJS",react:"React"};function Yt(i){let e=[];for(let t of i.ast.body)t.type==="ImportDeclaration"&&e.push(String(t.source.value));return e}function Et(i,e){let t=new Set,n=Yt(i);return n.some(r=>r.startsWith("@adonisjs/")||l.FRAMEWORKS.ADONIS_SUBPATH.test(r))&&t.add("adonisjs"),(n.some(r=>r==="react"||r.startsWith("react/")||r==="react-dom")||l.FRAMEWORKS.REACT_FILE.test(e))&&t.add("react"),t}var ue=class extends p{name="require-framework-config";defaultOptions=[{ignore:[]}];meta={type:"suggestion",docs:{description:"Warn when a file uses a framework whose Nitpicker config is not enabled.",recommended:true,category:"base"},schema:[{type:"object",properties:{ignore:{type:"array",items:{type:"string",enum:["adonisjs","react"]}}},additionalProperties:false}],messages:{missingConfig:c({problem:"This file uses {{framework}} but the Nitpicker {{framework}} rules are not enabled.",why:"Framework rules only run when you opt into the matching config, so files like this one go unchecked",fix:"Add `nitpicker.configs.{{config}}` (scoped to these files) to your ESLint config, or turn off `nitpicker/require-framework-config`"})}};create(e,t){let n=new Set(t[0]?.ignore??[]),s=e.settings[l.PLUGIN_NAME]??{};return {Program(r){let o=Et(e.sourceCode,e.filename);for(let m of o)n.has(m)||s[m]||e.report({node:r,messageId:"missingConfig",data:{framework:bt[m],config:m}});}}}},xt=new ue;var de=class extends p{name="require-function-jsdoc";defaultOptions=[{include:["class-methods","nested"],ignore:[]}];meta={type:"suggestion",docs:{description:"Require a JSDoc comment on functions, except React component functions.",recommended:true},schema:[{type:"object",properties:{include:{type:"array",items:{type:"string",enum:["class-methods","object-methods","nested"]}},ignore:{type:"array",items:{type:"string"}}},additionalProperties:false}],messages:{missingJSDoc:c({problem:"The function `{{name}}` has no JSDoc comment.",why:"A function must document its purpose, parameters, and return value, React component functions are the only exception",fix:"Add a `/** ... */` JSDoc block immediately above it describing what it does"})}};create(e,t){let n=new Set(t[0]?.include??["class-methods","nested"]),s=new Set(t[0]?.ignore??[]),r=(a,f,y,g)=>{s.has(y)||st(a)||le(y)&&k(a,e.sourceCode.visitorKeys)||T(e.sourceCode,f)||e.report({node:g,messageId:"missingJSDoc",data:{name:y}});},o=(a,f)=>{let y=O(a);if(y===void 0)return;let g=E(a);g.type==="MethodDefinition"||g.type==="Property"||!it(g)&&!n.has("nested")||r(a,g,y,f);},m=a=>{if(a.type==="Identifier")return a.name;if(a.type==="Literal"&&typeof a.value=="string")return a.value};return {FunctionDeclaration(a){o(a,a.id??a);},VariableDeclarator(a){a.init&&(a.init.type!=="ArrowFunctionExpression"&&a.init.type!=="FunctionExpression"||o(a.init,a.id));},MethodDefinition(a){if(!n.has("class-methods")||a.computed||a.value.type!=="FunctionExpression")return;let f=m(a.key);f!==void 0&&r(a.value,a,f,a.key);},Property(a){if(!n.has("object-methods")||a.computed||a.value.type!=="ArrowFunctionExpression"&&a.value.type!=="FunctionExpression")return;let f=m(a.key);f!==void 0&&r(a.value,a,f,a.key);}}}},Rt=new de;var fe=class extends p{name="require-jsdoc-delimiter-lines";defaultOptions=[];meta={type:"layout",fixable:"whitespace",docs:{description:"Require a JSDoc's opening and closing delimiters to sit on their own lines.",recommended:true,category:"base"},schema:[],messages:{openingLine:c({problem:"This JSDoc starts its text on the same line as the opening delimiter.",why:"A block that opens mid-line breaks the aligned column of markers and reads unevenly",fix:"Move the text to the next line so the opening delimiter sits alone"}),closingLine:c({problem:"This JSDoc ends its text on the same line as the closing delimiter.",why:"A block that closes mid-line breaks the aligned column of markers and reads unevenly",fix:"Move the closing delimiter onto its own line below the text"})}};create(e){let t=n=>{if(n.loc.start.line===n.loc.end.line)return;let s=n.value.split(`
11
11
  `),r=" ".repeat(n.loc.start.column),o=(s[0]??"").replace(/^\*/,"");if(o.trim()!==""){let a=n.range[0]+3,f=o.startsWith(" ")?"":" ";e.report({loc:{start:n.loc.start,end:e.sourceCode.getLocFromIndex(a+o.length)},messageId:"openingLine",fix:y=>y.insertTextBeforeRange([a,a],`
12
12
  ${r} *${f}`)});}if((s.at(-1)??"").replace(/^\s*\*?/,"").trim()!==""){let a=n.range[1]-2;e.report({loc:{start:e.sourceCode.getLocFromIndex(a),end:n.loc.end},messageId:"closingLine",fix:f=>f.insertTextBeforeRange([a,a],`
13
- ${r} `)});}};return {Program(){for(let n of e.sourceCode.getAllComments())S(n)&&i(n);}}}},bt=new de;function xt(t,e,i){let s=(t.lines[e.loc.start.line-1]??"").match(/^\s*/)?.[0]??"",r=s+" ".repeat(i);return `{
14
- ${e.properties.map(m=>`${r}${t.getText(m)}`).join(`,
13
+ ${r} `)});}};return {Program(){for(let n of e.sourceCode.getAllComments())S(n)&&t(n);}}}},Ot=new fe;var ge=class extends p{name="require-member-jsdoc-blank-line";defaultOptions=[];meta={type:"layout",fixable:"whitespace",docs:{description:"Require a blank line before a documented interface or type-literal member.",recommended:true,category:"base"},schema:[],messages:{blankLine:c({problem:"This documented member sits flush against the member above it.",why:"Without a blank line the JSDoc reads as trailing the previous member, and the block becomes a wall of text",fix:"Add a blank line above the JSDoc (the first member of the block needs none)"})}};create(e){let t=n=>{for(let s of n.slice(1)){let r=b(e.sourceCode,s);if(r===null)continue;let o=e.sourceCode.lines[r.loc.start.line-2];if(o===void 0||o.trim()==="")continue;let m=r.range[0]-r.loc.start.column;e.report({node:r,messageId:"blankLine",fix:a=>a.insertTextBeforeRange([m,m],`
14
+ `)});}};return {TSInterfaceBody(n){t(n.body);},TSTypeLiteral(n){t(n.members);}}}},Lt=new ge;function It(i,e,t){let s=(i.lines[e.loc.start.line-1]??"").match(/^\s*/)?.[0]??"",r=s+" ".repeat(t);return `{
15
+ ${e.properties.map(m=>`${r}${i.getText(m)}`).join(`,
15
16
  `)},
16
- ${s}}`}var fe=class extends p{name="require-multiline-object";defaultOptions=[{maxKeys:l.OBJECTS.MAX_INLINE_KEYS,indent:l.OBJECTS.INDENT_WIDTH}];meta={type:"suggestion",fixable:"code",docs:{description:"Require an object literal with more than a few properties to span multiple lines.",recommended:true,category:"base"},schema:[{type:"object",properties:{maxKeys:{type:"integer",minimum:1},indent:{type:"integer",minimum:1}},additionalProperties:false}],messages:{shouldWrap:c({problem:"This object literal has {{count}} properties packed onto a single line.",why:"An object with more than {{max}} properties is easier to scan, diff, and edit when each property sits on its own line",fix:"Break it across multiple lines, one property per line with a trailing comma"})}};create(e,i){let n=i[0]?.maxKeys??l.OBJECTS.MAX_INLINE_KEYS,s=i[0]?.indent??l.OBJECTS.INDENT_WIDTH;return {ObjectExpression(r){if(r.properties.length<=n||r.loc.start.line!==r.loc.end.line)return;let o=e.sourceCode.getCommentsInside(r).length>0;e.report({node:r,messageId:"shouldWrap",data:{count:r.properties.length,max:n},fix:o?null:m=>m.replaceText(r,xt(e.sourceCode,r,s))});}}}},Rt=new fe;var ge=class extends p{name="max-classname-length";defaultOptions=[{max:l.REACT.MAX_CLASSNAME_LENGTH}];meta={type:"suggestion",docs:{description:"Enforce a maximum length for a `className` class string.",recommended:true,category:"react"},schema:[{type:"object",properties:{max:{type:"integer",minimum:1}},additionalProperties:false}],messages:{tooLong:c({problem:"This `className` string is {{length}} characters, over the {{max}}-character limit.",why:"A long wall of Tailwind classes is hard to scan and diff, and it overflows the line",fix:"Break the classes across multiple lines, grouping related ones into separate `cn()` arguments"})}};create(e,i){let n=i[0]?.max??l.REACT.MAX_CLASSNAME_LENGTH,s=(r,o)=>{if(r){if(r.type==="Literal"){typeof r.value=="string"&&o.push({node:r,text:r.value});return}if(r.type==="TemplateLiteral"){r.expressions.length===0&&o.push({node:r,text:r.quasis[0]?.value.cooked??""});return}for(let m of e.sourceCode.visitorKeys[r.type]??[]){let a=r[m],f=Array.isArray(a)?a:[a];for(let y of f){let g=y;!g||typeof g.type!="string"||l.FUNCTIONS.NODE_TYPES.has(g.type)||s(g,o);}}}};return {JSXAttribute(r){if(r.name.type!=="JSXIdentifier"||r.name.name!=="className"||r.value===null)return;let o=[];s(r.value,o);for(let{node:m,text:a}of o)a.length<=n||e.report({node:m,messageId:"tooLong",data:{length:a.length,max:n}});}}}},Ot=new ge;var ye=class extends p{name="no-jsx-comments";defaultOptions=[];meta={type:"suggestion",docs:{description:"Disallow inline `{/* ... */}` comments inside JSX.",recommended:true,category:"react"},schema:[],messages:{jsxComment:c({problem:"This JSX holds an inline `{/* ... */}` comment.",why:"A comment labeling a JSX section is a sign it should be its own named component, JSX should read as structure, not carry prose markers",fix:"Extract the section into a named sub-component whose name says what the comment said, or drop the comment"})}};create(e){return {JSXExpressionContainer(i){i.expression.type==="JSXEmptyExpression"&&e.sourceCode.getCommentsInside(i).length!==0&&e.report({node:i,messageId:"jsxComment"});}}}},Nt=new ye;var Se=class extends p{name="require-context-hook-destructure";defaultOptions=[];meta={type:"suggestion",docs:{description:"Require the result of a context-consumer hook to be destructured.",recommended:true,category:"react"},schema:[],messages:{destructure:c({problem:"`{{hook}}` is bound whole instead of destructured.",why:"Destructuring at the call site names exactly what the caller uses and reads better than repeated `{{name}}.member` access",fix:"Destructure the members in use, e.g. `const { a, b } = {{hook}}()`"})}};create(e){return {VariableDeclarator(i){i.id.type!=="Identifier"||i.init?.type!=="CallExpression"||i.init.callee.type!=="Identifier"||!ut(i.init.callee.name)||e.report({node:i,messageId:"destructure",data:{hook:i.init.callee.name,name:i.id.name}});}}}},It=new Se;var he=class extends p{name="require-derived-usememo";defaultOptions=[];meta={type:"suggestion",docs:{description:"Require a derived value in a component or hook to be memoized with useMemo.",recommended:true,category:"react"},schema:[],messages:{useMemo:c({problem:"This derived value is computed inline on every render.",why:"A value derived through a call is recomputed each render and has nowhere to document itself, a useMemo makes it stable and gives it a JSDoc home",fix:"Wrap it in `useMemo(() => ..., [deps])` with a JSDoc describing the value, even for a one-liner"})}};create(e){return {VariableDeclarator(i){if(i.parent.type!=="VariableDeclaration"||i.parent.kind!=="const"||i.id.type!=="Identifier"||i.init===null)return;let n=it(i);n===null||!dt(n,e.sourceCode.visitorKeys)||gt(i.init,e.sourceCode.visitorKeys)&&e.report({node:i,messageId:"useMemo"});}}}},Lt=new he;var Te=class extends p{name="require-hook-object-return";defaultOptions=[];meta={type:"suggestion",fixable:"code",docs:{description:"Require a custom hook to return an object rather than a bare function.",recommended:true,category:"react"},schema:[],messages:{wrapInObject:c({problem:"This hook returns a bare function instead of an object.",why:"Returning an object lets the hook expose new members later without changing every call site, a bare function locks its shape",fix:"Return the function inside an object, e.g. `return { handleThing }`"})}};create(e){let i=r=>{if(ce(r))return true;if(r.type!=="Identifier")return false;let m=ASTUtils.findVariable(e.sourceCode.getScope(r),r.name)?.defs.at(-1)?.node;return m?.type==="VariableDeclarator"&&ce(m.init)},n=r=>{e.report({node:r,messageId:"wrapInObject",fix:r.type==="Identifier"?o=>o.replaceText(r,`{ ${r.name} }`):void 0});},s=r=>{let o=R(r);if(!(o===void 0||!v(o))){if(r.type==="ArrowFunctionExpression"&&r.body.type!=="BlockStatement"){i(r.body)&&n(r.body);return}O(r.body,e.sourceCode.visitorKeys,m=>(m!==null&&i(m)&&n(m),false));}};return {FunctionDeclaration(r){s(r);},FunctionExpression(r){s(r);},ArrowFunctionExpression(r){s(r);}}}},Ct=new Te;var Ee=class extends p{name="require-memo-callback-jsdoc";defaultOptions=[];meta={type:"suggestion",docs:{description:"Require a JSDoc on a useMemo or useCallback (with an `@param` per useCallback parameter).",recommended:true,category:"react"},schema:[],messages:{missingJSDoc:c({problem:"This `{{hook}}` has no JSDoc.",why:"A memoized value or handler should document what it is, so its purpose is clear without reading the factory",fix:"Add a `/** ... */` JSDoc above the `const`"}),missingParam:c({problem:"This `useCallback`'s JSDoc documents fewer parameters than the callback takes.",why:"A callback is a function, so each parameter it takes should be documented like any other",fix:"Add an `@param` line for each parameter of the callback"})}};create(e){return {VariableDeclarator(i){if(i.init?.type!=="CallExpression"||i.init.callee.type!=="Identifier"||!l.REACT.MEMO_HOOKS.has(i.init.callee.name))return;let n=i.parent;if(n.parent?.type==="ExportNamedDeclaration"&&(n=n.parent),!T(e.sourceCode,n)){e.report({node:i.id,messageId:"missingJSDoc",data:{hook:i.init.callee.name}});return}if(i.init.callee.name!=="useCallback")return;let s=i.init.arguments[0];if(s?.type!=="ArrowFunctionExpression"&&s?.type!=="FunctionExpression"||s.params.length===0)return;(e.sourceCode.getCommentsBefore(n).at(-1)?.value.split(`
17
- `)??[]).filter(m=>I(m)==="param").length<s.params.length&&e.report({node:i.id,messageId:"missingParam"});}}}},kt=new Ee;var Kt=[Ie,Fe,Pe,je,_e,Je,Ue,Ge,He,Xe,Ye,Ze,Qe,nt,st,ot,at,lt,ct,pt,mt,yt,Tt,bt,Et,Rt,Ot,Nt,It,Lt,Ct,kt],C=Object.fromEntries(Kt.map(t=>[t.name,t.toRuleModule()]));function N(t){let e={};for(let[i,n]of Object.entries(C))(n.meta.docs?.category??"base")===t&&(e[`${l.PLUGIN_NAME}/${i}`]="warn");return e}function Dt(){let t={};for(let e of Object.keys(C))t[`${l.PLUGIN_NAME}/${e}`]="warn";return t}function wt(t){return {name:`${l.PLUGIN_NAME}/all`,plugins:{[l.PLUGIN_NAME]:t},settings:{[l.PLUGIN_NAME]:{adonisjs:true,react:true}},rules:Dt()}}function z(t){return {name:`${l.PLUGIN_NAME}/base`,plugins:{[l.PLUGIN_NAME]:t},rules:N("base")}}function Mt(t){return {...z(t),name:`${l.PLUGIN_NAME}/recommended`}}var Xt=["**/start/routes.ts","**/start/routes/**/*.ts"];function At(t){return {name:`${l.PLUGIN_NAME}/adonisjs`,plugins:{[l.PLUGIN_NAME]:t},settings:{[l.PLUGIN_NAME]:{adonisjs:true}},rules:{...N("adonisjs"),[`${l.PLUGIN_NAME}/no-decorative-comment-separators`]:["warn",{allowIn:Xt}]}}}function vt(t){return {name:`${l.PLUGIN_NAME}/react`,plugins:{[l.PLUGIN_NAME]:t},settings:{[l.PLUGIN_NAME]:{react:true}},rules:N("react")}}function zt(t){return {base:z(t),recommended:Mt(t),adonisjs:At(t),react:vt(t),all:wt(t)}}var Ft="0.7.7";var be={meta:{name:`eslint-plugin-${l.PLUGIN_NAME}`,version:Ft},rules:C,configs:{}};be.configs=zt(be);var Aa=be;export{Aa as default};//# sourceMappingURL=index.js.map
17
+ ${s}}`}var ye=class extends p{name="require-multiline-object";defaultOptions=[{maxKeys:l.OBJECTS.MAX_INLINE_KEYS,indent:l.OBJECTS.INDENT_WIDTH}];meta={type:"suggestion",fixable:"code",docs:{description:"Require an object literal with more than a few properties to span multiple lines.",recommended:true,category:"base"},schema:[{type:"object",properties:{maxKeys:{type:"integer",minimum:1},indent:{type:"integer",minimum:1}},additionalProperties:false}],messages:{shouldWrap:c({problem:"This object literal has {{count}} properties packed onto a single line.",why:"An object with more than {{max}} properties is easier to scan, diff, and edit when each property sits on its own line",fix:"Break it across multiple lines, one property per line with a trailing comma"})}};create(e,t){let n=t[0]?.maxKeys??l.OBJECTS.MAX_INLINE_KEYS,s=t[0]?.indent??l.OBJECTS.INDENT_WIDTH;return {ObjectExpression(r){if(r.properties.length<=n||r.loc.start.line!==r.loc.end.line)return;let o=e.sourceCode.getCommentsInside(r).length>0;e.report({node:r,messageId:"shouldWrap",data:{count:r.properties.length,max:n},fix:o?null:m=>m.replaceText(r,It(e.sourceCode,r,s))});}}}},Nt=new ye;var Se=class extends p{name="max-classname-length";defaultOptions=[{max:l.REACT.MAX_CLASSNAME_LENGTH}];meta={type:"suggestion",docs:{description:"Enforce a maximum length for a `className` class string.",recommended:true,category:"react"},schema:[{type:"object",properties:{max:{type:"integer",minimum:1}},additionalProperties:false}],messages:{tooLong:c({problem:"This `className` string is {{length}} characters, over the {{max}}-character limit.",why:"A long wall of Tailwind classes is hard to scan and diff, and it overflows the line",fix:"Break the classes across multiple lines, grouping related ones into separate `cn()` arguments"})}};create(e,t){let n=t[0]?.max??l.REACT.MAX_CLASSNAME_LENGTH,s=(r,o)=>{if(r){if(r.type==="Literal"){typeof r.value=="string"&&o.push({node:r,text:r.value});return}if(r.type==="TemplateLiteral"){r.expressions.length===0&&o.push({node:r,text:r.quasis[0]?.value.cooked??""});return}for(let m of e.sourceCode.visitorKeys[r.type]??[]){let a=r[m],f=Array.isArray(a)?a:[a];for(let y of f){let g=y;!g||typeof g.type!="string"||l.FUNCTIONS.NODE_TYPES.has(g.type)||s(g,o);}}}};return {JSXAttribute(r){if(r.name.type!=="JSXIdentifier"||r.name.name!=="className"||r.value===null)return;let o=[];s(r.value,o);for(let{node:m,text:a}of o)a.length<=n||e.report({node:m,messageId:"tooLong",data:{length:a.length,max:n}});}}}},kt=new Se;var he=class extends p{name="no-jsx-comments";defaultOptions=[];meta={type:"suggestion",docs:{description:"Disallow inline `{/* ... */}` comments inside JSX.",recommended:true,category:"react"},schema:[],messages:{jsxComment:c({problem:"This JSX holds an inline `{/* ... */}` comment.",why:"A comment labeling a JSX section is a sign it should be its own named component, JSX should read as structure, not carry prose markers",fix:"Extract the section into a named sub-component whose name says what the comment said, or drop the comment"})}};create(e){return {JSXExpressionContainer(t){t.expression.type==="JSXEmptyExpression"&&e.sourceCode.getCommentsInside(t).length!==0&&e.report({node:t,messageId:"jsxComment"});}}}},Ct=new he;var Te=class extends p{name="require-context-hook-destructure";defaultOptions=[];meta={type:"suggestion",docs:{description:"Require the result of a context-consumer hook to be destructured.",recommended:true,category:"react"},schema:[],messages:{destructure:c({problem:"`{{hook}}` is bound whole instead of destructured.",why:"Destructuring at the call site names exactly what the caller uses and reads better than repeated `{{name}}.member` access",fix:"Destructure the members in use, e.g. `const { a, b } = {{hook}}()`"})}};create(e){return {VariableDeclarator(t){t.id.type!=="Identifier"||t.init?.type!=="CallExpression"||t.init.callee.type!=="Identifier"||!ft(t.init.callee.name)||e.report({node:t,messageId:"destructure",data:{hook:t.init.callee.name,name:t.id.name}});}}}},Dt=new Te;var be=class extends p{name="require-derived-usememo";defaultOptions=[];meta={type:"suggestion",docs:{description:"Require a derived value in a component or hook to be memoized with useMemo.",recommended:true,category:"react"},schema:[],messages:{useMemo:c({problem:"This derived value is computed inline on every render.",why:"A value derived through a call is recomputed each render and has nowhere to document itself, a useMemo makes it stable and gives it a JSDoc home",fix:"Wrap it in `useMemo(() => ..., [deps])` with a JSDoc describing the value, even for a one-liner"})}};create(e){return {VariableDeclarator(t){if(t.parent.type!=="VariableDeclaration"||t.parent.kind!=="const"||t.id.type!=="Identifier"||t.init===null)return;let n=nt(t);n===null||!gt(n,e.sourceCode.visitorKeys)||St(t.init,e.sourceCode.visitorKeys)&&e.report({node:t,messageId:"useMemo"});}}}},wt=new be;var Ee=class extends p{name="require-hook-object-return";defaultOptions=[];meta={type:"suggestion",fixable:"code",docs:{description:"Require a custom hook to return an object rather than a bare function.",recommended:true,category:"react"},schema:[],messages:{wrapInObject:c({problem:"This hook returns a bare function instead of an object.",why:"Returning an object lets the hook expose new members later without changing every call site, a bare function locks its shape",fix:"Return the function inside an object, e.g. `return { handleThing }`"})}};create(e){let t=r=>{if(ce(r))return true;if(r.type!=="Identifier")return false;let m=ASTUtils.findVariable(e.sourceCode.getScope(r),r.name)?.defs.at(-1)?.node;return m?.type==="VariableDeclarator"&&ce(m.init)},n=r=>{e.report({node:r,messageId:"wrapInObject",fix:r.type==="Identifier"?o=>o.replaceText(r,`{ ${r.name} }`):void 0});},s=r=>{let o=O(r);if(!(o===void 0||!z(o))){if(r.type==="ArrowFunctionExpression"&&r.body.type!=="BlockStatement"){t(r.body)&&n(r.body);return}L(r.body,e.sourceCode.visitorKeys,m=>(m!==null&&t(m)&&n(m),false));}};return {FunctionDeclaration(r){s(r);},FunctionExpression(r){s(r);},ArrowFunctionExpression(r){s(r);}}}},Mt=new Ee;var xe=class extends p{name="require-memo-callback-jsdoc";defaultOptions=[];meta={type:"suggestion",docs:{description:"Require a JSDoc on a useMemo or useCallback (with an `@param` per useCallback parameter).",recommended:true,category:"react"},schema:[],messages:{missingJSDoc:c({problem:"This `{{hook}}` has no JSDoc.",why:"A memoized value or handler should document what it is, so its purpose is clear without reading the factory",fix:"Add a `/** ... */` JSDoc above the `const`"}),missingParam:c({problem:"This `useCallback`'s JSDoc documents fewer parameters than the callback takes.",why:"A callback is a function, so each parameter it takes should be documented like any other",fix:"Add an `@param` line for each parameter of the callback"})}};create(e){return {VariableDeclarator(t){if(t.init?.type!=="CallExpression"||t.init.callee.type!=="Identifier"||!l.REACT.MEMO_HOOKS.has(t.init.callee.name))return;let n=t.parent;if(n.parent?.type==="ExportNamedDeclaration"&&(n=n.parent),!T(e.sourceCode,n)){e.report({node:t.id,messageId:"missingJSDoc",data:{hook:t.init.callee.name}});return}if(t.init.callee.name!=="useCallback")return;let s=t.init.arguments[0];if(s?.type!=="ArrowFunctionExpression"&&s?.type!=="FunctionExpression"||s.params.length===0)return;(e.sourceCode.getCommentsBefore(n).at(-1)?.value.split(`
18
+ `)??[]).filter(m=>N(m)==="param").length<s.params.length&&e.report({node:t.id,messageId:"missingParam"});}}}},At=new xe;var Qt=[ke,je,_e,Je,qe,Be,Ue,$e,Xe,Ze,Qe,et,tt,ot,at,lt,ct,pt,mt,ut,dt,ht,Tt,xt,Ot,Lt,Rt,Nt,kt,Ct,Dt,wt,Mt,At],C=Object.fromEntries(Qt.map(i=>[i.name,i.toRuleModule()]));function I(i){let e={};for(let[t,n]of Object.entries(C))(n.meta.docs?.category??"base")===i&&(e[`${l.PLUGIN_NAME}/${t}`]="warn");return e}function vt(){let i={};for(let e of Object.keys(C))i[`${l.PLUGIN_NAME}/${e}`]="warn";return i}function zt(i){return {name:`${l.PLUGIN_NAME}/all`,plugins:{[l.PLUGIN_NAME]:i},settings:{[l.PLUGIN_NAME]:{adonisjs:true,react:true}},rules:vt()}}function F(i){return {name:`${l.PLUGIN_NAME}/base`,plugins:{[l.PLUGIN_NAME]:i},rules:I("base")}}function Ft(i){return {...F(i),name:`${l.PLUGIN_NAME}/recommended`}}var ei=["**/start/routes.ts","**/start/routes/**/*.ts"];function Pt(i){return {name:`${l.PLUGIN_NAME}/adonisjs`,plugins:{[l.PLUGIN_NAME]:i},settings:{[l.PLUGIN_NAME]:{adonisjs:true}},rules:{...I("adonisjs"),[`${l.PLUGIN_NAME}/no-decorative-comment-separators`]:["warn",{allowIn:ei}]}}}function jt(i){return {name:`${l.PLUGIN_NAME}/react`,plugins:{[l.PLUGIN_NAME]:i},settings:{[l.PLUGIN_NAME]:{react:true}},rules:I("react")}}function _t(i){return {base:F(i),recommended:Ft(i),adonisjs:Pt(i),react:jt(i),all:zt(i)}}var Jt="0.7.8";var Re={meta:{name:`eslint-plugin-${l.PLUGIN_NAME}`,version:Jt},rules:C,configs:{}};Re.configs=_t(Re);var Ka=Re;export{Ka as default};//# sourceMappingURL=index.js.map
18
19
  //# sourceMappingURL=index.js.map