@alien_intelligence/eslint-plugin-nitpicker 0.7.4 → 0.7.6
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 +21 -0
- package/dist/index.js +11 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -91,6 +91,7 @@ The **base** rules are the universal ruleset shipped by `recommended`; the **Rea
|
|
|
91
91
|
| `nitpicker/no-relative-imports` | | Disallow relative (`./`, `../`) import/re-export paths; use the package alias (`allowIn` option). |
|
|
92
92
|
| `nitpicker/no-single-line-jsdoc` | yes | Require JSDoc comments to span multiple lines rather than a single line. |
|
|
93
93
|
| `nitpicker/require-capitalized-comments` | yes | Require a comment to start with an uppercase letter. |
|
|
94
|
+
| `nitpicker/require-complete-jsdoc` | | Require a function's JSDoc to document every parameter and its return value. |
|
|
94
95
|
| `nitpicker/require-framework-config` | | Warn when a file uses a framework whose Nitpicker config is not enabled. |
|
|
95
96
|
| `nitpicker/require-function-jsdoc` | | Require a JSDoc comment on top-level functions (React components and lazy `import` thunks exempt). |
|
|
96
97
|
| `nitpicker/require-multiline-object` | yes² | Require an object literal with more than a few properties (default 2) to span multiple lines. |
|
|
@@ -184,6 +185,26 @@ A backtick renders as code inside a JSDoc block, but in a `//` comment it is jus
|
|
|
184
185
|
```
|
|
185
186
|
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.
|
|
186
187
|
|
|
188
|
+
### JSDoc completeness
|
|
189
|
+
`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:
|
|
190
|
+
```js
|
|
191
|
+
// Missing @param url, and missing @returns
|
|
192
|
+
/**
|
|
193
|
+
* Sends it.
|
|
194
|
+
* @param user The user.
|
|
195
|
+
*/
|
|
196
|
+
function send(user, url) { return 1 }
|
|
197
|
+
```
|
|
198
|
+
A **void** or **`Promise<void>`** function needs no `@returns`, and neither does a component returning JSX. A **destructured** parameter may be documented either way, so both of these pass:
|
|
199
|
+
```js
|
|
200
|
+
/** @param user The user. @param url The link. */ // property by property
|
|
201
|
+
async function send({ user, url }) {}
|
|
202
|
+
|
|
203
|
+
/** @param options The options. */ // one name for the whole object
|
|
204
|
+
async function send({ user, url }) {}
|
|
205
|
+
```
|
|
206
|
+
It also covers class methods and object-literal methods, not just top-level functions.
|
|
207
|
+
|
|
187
208
|
### Line comment periods
|
|
188
209
|
`no-line-comment-period` only treats a dot as prose when whitespace or the end of the comment follows it, so dots inside code (`foo.bar`, `subagent.*`, `split(".")`), inside a quoted or back-ticked span, in an ellipsis, or closing an abbreviation (`e.g.`, `i.e.`, `etc.`) are left alone.
|
|
189
210
|
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import {ESLintUtils,ASTUtils}from'@typescript-eslint/utils';var
|
|
1
|
+
import {ESLintUtils,ASTUtils}from'@typescript-eslint/utils';var zt={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."]},JSDOC:{TAG:/^\s*\*?\s*@(\w+)/,PARAM_TAG:/^\s*\*?\s*@param\s+(?:\{[^}]*\}\s*)?\[?([\w$]+)/},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"])},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"]}},o=zt;var be=ESLintUtils.RuleCreator(()=>`${o.REPO_URL}/blob/main/README.md#rules`);var p=class{toRuleModule(){return be({name:this.name,meta:this.meta,defaultOptions:this.defaultOptions,create:(e,i)=>this.create(e,i)})}};function l({problem:t,why:e,fix:i}){return `${t}
|
|
2
2
|
- why: ${e}
|
|
3
|
-
- fix: ${i}`}function
|
|
4
|
-
`)){let n=i.replace(/^\s*\*? ?/,"").trimEnd();if(n.startsWith("@"))break;e.push(n);}return e.join(" ").replace(/\s+/g," ").trim()}function Oe(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(F(t.lines[s-1]??"")){n=s-1;break}return {from:i,to:n}}var j=class extends l{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:p({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){xe(i)&&(y(e.sourceCode,i.parent)||e.report({node:i.id??i,messageId:"missingJSDoc"}));}}}},Ie=new j;var P=class extends l{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:p({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){he(i)&&(y(e.sourceCode,i.parent)||e.report({node:i.id??i,messageId:"missingJSDoc"}));}}}},Le=new P;function At(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 h(t,e){let i=t.replace(/\\/g,"/");return e.some(n=>At(n).test(i))}var _=class extends l{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:p({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&&h(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"||!o.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}});}}}},Ce=new _;var J=class extends l{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:p({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}}));}}}},Ne=new J;var ke=250,U=class extends l{name="max-jsdoc-description-length";defaultOptions=[{max:ke}];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:p({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??ke;return {Program(){for(let s of e.sourceCode.getAllComments()){if(!g(s))continue;let r=Re(s).length;r<=n||e.report({loc:s.loc,messageId:"tooLong",data:{length:r,max:n}});}}}}},De=new U;function L(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 we(t){return L(t)!==null}function C(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 Me(t,e){for(let i of t)if(e===i||e.startsWith(`${i}.`))return true;return false}function Ae(t){return t.properties.length===0?false:t.properties.every(e=>e.type==="Property"&&e.shorthand&&!e.computed&&e.value.type==="Identifier")}var B=class extends l{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:p({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&&(C(e.sourceCode.getScope(i),i.init.name)||e.report({node:i,messageId:"alias",data:{name:i.id.name,source:i.init.name}})));}}}},ve=new B;var ze={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 Fe(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}function W(t){let e=[];for(let i of t.matchAll(o.WORDS.SUB_WORD))i.index!==void 0&&e.push({text:i[0],index:i.index});return e}function q(t,e){return t===t.toUpperCase()?e.toUpperCase():t.charAt(0)===t.charAt(0).toUpperCase()?e.charAt(0).toUpperCase()+e.slice(1):e}function je(t){return t!==void 0&&o.WORDS.WORD_CHAR.test(t)}var V=class extends l{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:p({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=Fe(ze,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 W(s.name)){let a=n[r.text.toLowerCase()];a!==void 0&&e.report({node:s,messageId:"british",data:{british:r.text,american:q(r.text,a)}});}},Program(){for(let s of e.sourceCode.getAllComments())for(let r of W(s.value)){let a=n[r.text.toLowerCase()];if(a===void 0)continue;let m=q(r.text,a),d=s.range[0]+2+r.index,f=d+r.text.length;e.report({loc:{start:e.sourceCode.getLocFromIndex(d),end:e.sourceCode.getLocFromIndex(f)},messageId:"british",data:{british:r.text,american:m},fix:A=>A.replaceTextRange([d,f],m)});}}}}},Pe=new V;function _e(t){let e=t.replace(/^\s*\*?\s*/,"").trimEnd();return e.length===0?false:o.COMMENTS.BOX_DRAWING.test(e)||o.COMMENTS.PURE_SEPARATOR.test(e)||o.COMMENTS.WRAPPED_LABEL.test(e)}var G=class extends l{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:p({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&&h(e.filename,n)?{}:{Program(){for(let s of e.sourceCode.getAllComments()){let r=s.value.split(`
|
|
5
|
-
`)
|
|
6
|
-
`)
|
|
3
|
+
- fix: ${i}`}function Ee(t){return t.parent.type==="ExportDefaultDeclaration"&&t.superClass?.type==="Identifier"&&t.superClass.name==="BaseSchema"}function xe(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 Re(t,e){if(t.type!=="ExpressionStatement")return null;let i=Pt(t.expression,e);return i===null?null:o.MIGRATIONS.INDEX_METHODS.has(i.method)?"index":i.method==="timestamps"?"timestamp":o.MIGRATIONS.TIMESTAMP_METHODS.has(i.method)?i.firstArgument!==void 0&&o.MIGRATIONS.AUDIT_TIMESTAMPS.has(i.firstArgument)?"timestamp":null:"column"}function Pt(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:l({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=xe(i);if(n===null)return;let s=0;for(let r of n.body){let a=Re(r,n.builderName);if(a===null)continue;let u=o.MIGRATIONS.CATEGORY_ORDER.indexOf(a);u<s&&e.report({node:r,messageId:"outOfOrder",data:{category:a}}),s=Math.max(s,u);}}}}},Oe=new F;function Ie(t){return t.parent.type==="ExportDefaultDeclaration"&&t.id?.name.endsWith("Controller")===true}function P(t){let e=[];for(let i of t.matchAll(o.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 Ne(t){return t!==void 0&&o.WORDS.WORD_CHAR.test(t)}function b(t){return o.COMMENTS.DIRECTIVE.test(t.value)}function Le(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 ke(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(o.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 a=t.value.slice(s+1);a!==""&&!/^\s/u.test(a)||jt(t.value.slice(0,s+1))||e.push({index:i+s,terminal:a.trim()===""});}return e}function Ce(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 o.COMMENTS.ABBREVIATIONS.some(i=>{if(!e.endsWith(i))return false;let n=e.charAt(e.length-i.length-1);return n===""||!Ne(n)})}function y(t){return t.type==="Block"&&t.value.startsWith("*")}function Jt(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 J(t,e){let i=t.getCommentsBefore(Jt(e)),n=i.length-1;for(;n>=0;){let r=i[n];if(r===void 0||!b(r))break;n--;}let s=i[n];return s!==void 0&&y(s)?s:null}function De(t){let e=new Set;for(let i of t.value.split(`
|
|
5
|
+
`)){let n=i.match(o.JSDOC.PARAM_TAG)?.[1];n!==void 0&&e.add(n);}return e}function we(t){return t.value.split(`
|
|
6
|
+
`).some(e=>{let i=I(e);return i==="returns"||i==="return"})}function S(t,e){return J(t,e)!==null}function _(t){return /^\s*\*\s*$/.test(t)}function I(t){return t.match(o.JSDOC.TAG)?.[1]??null}function U(t){return I(t)!==null}function Me(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 Ae(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 W=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:l({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){Ie(i)&&(S(e.sourceCode,i.parent)||e.report({node:i.id??i,messageId:"missingJSDoc"}));}}}},ve=new W;var q=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:l({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){Ee(i)&&(S(e.sourceCode,i.parent)||e.report({node:i.id??i,messageId:"missingJSDoc"}));}}}},ze=new q;function _t(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 E(t,e){let i=t.replace(/\\/g,"/");return e.some(n=>_t(n).test(i))}var B=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:l({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&&E(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"||!o.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}});}}}},Fe=new B;var V=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:l({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}}));}}}},Pe=new V;var je=250,G=class extends p{name="max-jsdoc-description-length";defaultOptions=[{max:je}];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:l({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??je;return {Program(){for(let s of e.sourceCode.getAllComments()){if(!y(s))continue;let r=Me(s).length;r<=n||e.report({loc:s.loc,messageId:"tooLong",data:{length:r,max:n}});}}}}},Je=new G;function C(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 _e(t){return C(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 Ue(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 K=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:l({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}})));}}}},qe=new K;var Be={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 Ve(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 $=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:l({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=Ve(Be,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 a=n[r.text.toLowerCase()];a!==void 0&&e.report({node:s,messageId:"british",data:{british:r.text,american:j(r.text,a)}});}},Program(){for(let s of e.sourceCode.getAllComments())for(let r of P(s.value)){let a=n[r.text.toLowerCase()];if(a===void 0)continue;let u=j(r.text,a),d=s.range[0]+2+r.index,g=d+r.text.length;e.report({loc:{start:e.sourceCode.getLocFromIndex(d),end:e.sourceCode.getLocFromIndex(g)},messageId:"british",data:{british:r.text,american:u},fix:k=>k.replaceTextRange([d,g],u)});}}}}},Ge=new $;function Ke(t){let e=t.replace(/^\s*\*?\s*/,"").trimEnd();return e.length===0?false:o.COMMENTS.BOX_DRAWING.test(e)||o.COMMENTS.PURE_SEPARATOR.test(e)||o.COMMENTS.WRAPPED_LABEL.test(e)}var H=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:l({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&&E(e.filename,n)?{}:{Program(){for(let s of e.sourceCode.getAllComments()){let r=s.value.split(`
|
|
8
|
+
`);for(let a=0;a<r.length;a++){let u=r[a];if(u===void 0||!Ke(u))continue;let d=s.loc.start.line+a,g=e.sourceCode.lines[d-1]??"";e.report({loc:{start:{line:d,column:0},end:{line:d,column:g.length}},messageId:"decorative"});}}}}}},$e=new H;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 X=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:l({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]===o.EM_DASH&&(M(r,s)||e.report({loc:{start:e.sourceCode.getLocFromIndex(r),end:e.sourceCode.getLocFromIndex(r+1)},messageId:"emDash"}));}}}},He=new X;var Y=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:l({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(o.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]}});}}}},Xe=new Y;var Z=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:l({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(y(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||!_(s))continue;let r=n;for(;r<i.loc.end.line&&_(e.sourceCode.lines[r]??"");)r++;let a=e.sourceCode.lines[r];if(a!==void 0&&U(a)){let u=e.sourceCode.getIndexFromLoc({line:n,column:0}),d=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:g=>g.removeRange([u,d])});}n=r;}}}}},Ye=new Z;function h(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 Ze(t){return t.parent?.type==="Program"}function Qe(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 et(t){let e=t.parent;for(;e;){if(o.FUNCTIONS.NODE_TYPES.has(e.type))return e;e=e.parent;}return null}function tt(t){return t.type==="ArrowFunctionExpression"&&t.params.length===0&&t.body.type==="ImportExpression"}function x(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 R(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 a of r){let u=a;if(!(!u||typeof u.type!="string")&&!o.FUNCTIONS.NODE_TYPES.has(u.type)&&R(u,e,i))return true}}return false}function qt(t,e){return t.type==="ArrowFunctionExpression"&&t.body.type!=="BlockStatement"?true:R(t.body,e,i=>i!==null)}function Bt(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?Bt(t.returnType):!qt(t,e)}var Q=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:l({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||!y(r))return;let a=Ae(e.sourceCode,r);if(a===null||!A(n,e.sourceCode.visitorKeys))return;let u=e.sourceCode.getIndexFromLoc({line:a.from,column:0}),d=e.sourceCode.getIndexFromLoc({line:a.to+1,column:0});e.report({loc:{start:{line:a.from,column:0},end:{line:a.to,column:(e.sourceCode.lines[a.to-1]??"").length}},messageId:"voidReturns",fix:g=>g.removeRange([u,d])});};return {FunctionDeclaration(n){i(n,h(n));},VariableDeclarator(n){(n.init?.type==="ArrowFunctionExpression"||n.init?.type==="FunctionExpression")&&i(n.init,h(n.init));},MethodDefinition(n){n.value.type==="FunctionExpression"&&i(n.value,n);}}}},it=new Q;var ee=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:l({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"||b(i)))for(let n of Ce(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],'"')]});}}}},rt=new ee;var te=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:l({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:l({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 ke(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"});}}}}},nt=new te;var ie=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:l({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 a=C(r);a!==null&&n.add(a);};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 a=C(r.init);if(a===null)return;let u=a.slice(0,a.indexOf("."));u!=="this"&&D(e.sourceCode.getScope(r),u)||i.push({node:r,name:r.id.name,path:a,expression:e.sourceCode.getText(r.init)});},"Program:exit"(){for(let r of i)Ue(n,r.path)||e.report({node:r.node,messageId:"propertyAccessAlias",data:{name:r.name,expression:r.expression}});}}}},st=new ie;var re=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:l({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"&&!_e(i.init)||We(i.id)&&e.report({node:i,messageId:"destructure",data:{source:e.sourceCode.getText(i.init)}}));}}}},ot=new re;var ne=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:l({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&&E(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);}}}},at=new ne;var se=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:l({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(!y(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),a=`/**
|
|
7
9
|
${r} * ${n}
|
|
8
|
-
${r} */`;return s.replaceTextRange(i.range,a)}});}}}}},
|
|
9
|
-
${e.properties.map(
|
|
10
|
+
${r} */`;return s.replaceTextRange(i.range,a)}});}}}}},lt=new se;var oe=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:l({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(b(n)||i(n))continue;let s=Le(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())});}}}}},pt=new oe;function ae(t){return /^[A-Z]/.test(t)}function v(t){return o.REACT.HOOK.test(t)}function ct(t){return o.REACT.CONTEXT_HOOK.test(t)}function le(t){return t?t.type==="ArrowFunctionExpression"||t.type==="FunctionExpression"?true:t.type==="CallExpression"&&t.callee.type==="Identifier"&&t.callee.name==="useCallback":false}function T(t){if(!t)return false;switch(t.type){case "JSXElement":case "JSXFragment":return true;case "ConditionalExpression":return T(t.consequent)||T(t.alternate);case "LogicalExpression":return T(t.left)||T(t.right);case "SequenceExpression":return T(t.expressions.at(-1));default:return false}}function N(t,e){return t.type==="ArrowFunctionExpression"&&t.body.type!=="BlockStatement"?T(t.body):R(t.body,e,T)}function mt(t,e){let i=x(t);return i===void 0?false:v(i)||ae(i)&&N(t,e)}function ut(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 a=r;if(!(!a||typeof a.type!="string")&&!o.FUNCTIONS.NODE_TYPES.has(a.type)&&ut(a,e))return true}}return false}function dt(t,e){return t.type==="ArrowFunctionExpression"||t.type==="FunctionExpression"?false:ut(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:l({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:l({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=J(e.sourceCode,h(n));if(s===null)return;let r=De(s),a=Qe(n),u=new Set(a.filter(d=>d.kind==="name").map(d=>d.name));for(let d of a){if(d.kind==="name"){r.has(d.name)||e.report({node:d.node,messageId:"missingParam",data:{name:d.name}});continue}if(d.names.every(f=>r.has(f.name)))continue;let g=new Set(d.names.map(f=>f.name));if(![...r].some(f=>!g.has(f)&&!u.has(f)))for(let f of d.names)r.has(f.name)||e.report({node:f.node,messageId:"missingParam",data:{name:f.name}});}we(s)||A(n,e.sourceCode.visitorKeys)||N(n,e.sourceCode.visitorKeys)||e.report({node:s,messageId:"missingReturns"});};return {FunctionDeclaration(n){i(n);},FunctionExpression(n){i(n);},ArrowFunctionExpression(n){i(n);}}}},ft=new pe;var gt={adonisjs:"AdonisJS",react:"React"};function Vt(t){let e=[];for(let i of t.ast.body)i.type==="ImportDeclaration"&&e.push(String(i.source.value));return e}function yt(t,e){let i=new Set,n=Vt(t);return n.some(r=>r.startsWith("@adonisjs/")||o.FRAMEWORKS.ADONIS_SUBPATH.test(r))&&i.add("adonisjs"),(n.some(r=>r==="react"||r.startsWith("react/")||r==="react-dom")||o.FRAMEWORKS.REACT_FILE.test(e))&&i.add("react"),i}var ce=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:l({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[o.PLUGIN_NAME]??{};return {Program(r){let a=yt(e.sourceCode,e.filename);for(let u of a)n.has(u)||s[u]||e.report({node:r,messageId:"missingConfig",data:{framework:gt[u],config:u}});}}}},St=new ce;var me=class extends p{name="require-function-jsdoc";defaultOptions=[];meta={type:"suggestion",docs:{description:"Require a JSDoc comment on top-level functions, except React component functions.",recommended:true},schema:[],messages:{missingJSDoc:l({problem:"The function `{{name}}` has no JSDoc comment.",why:"Top-level functions must document their purpose, parameters, and return value, React component functions are the only exception.",fix:"Add a `/** ... */` JSDoc block immediately above the function describing what it does."})}};create(e){let i=(n,s)=>{let r=x(n);if(r===void 0)return;let a=h(n);Ze(a)&&(tt(n)||ae(r)&&N(n,e.sourceCode.visitorKeys)||S(e.sourceCode,a)||e.report({node:s,messageId:"missingJSDoc",data:{name:r}}));};return {FunctionDeclaration(n){i(n,n.id??n);},VariableDeclarator(n){n.init&&(n.init.type!=="ArrowFunctionExpression"&&n.init.type!=="FunctionExpression"||i(n.init,n.id));}}}},ht=new me;function Tt(t,e,i){let s=(t.lines[e.loc.start.line-1]??"").match(/^\s*/)?.[0]??"",r=s+" ".repeat(i);return `{
|
|
11
|
+
${e.properties.map(u=>`${r}${t.getText(u)}`).join(`,
|
|
10
12
|
`)},
|
|
11
|
-
${s}}`}var
|
|
12
|
-
`)??[]).filter(
|
|
13
|
+
${s}}`}var ue=class extends p{name="require-multiline-object";defaultOptions=[{maxKeys:o.OBJECTS.MAX_INLINE_KEYS,indent:o.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:l({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??o.OBJECTS.MAX_INLINE_KEYS,s=i[0]?.indent??o.OBJECTS.INDENT_WIDTH;return {ObjectExpression(r){if(r.properties.length<=n||r.loc.start.line!==r.loc.end.line)return;let a=e.sourceCode.getCommentsInside(r).length>0;e.report({node:r,messageId:"shouldWrap",data:{count:r.properties.length,max:n},fix:a?null:u=>u.replaceText(r,Tt(e.sourceCode,r,s))});}}}},bt=new ue;var Et=120,de=class extends p{name="max-classname-length";defaultOptions=[{max:Et}];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:l({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??Et,s=(r,a)=>{if(r){if(r.type==="Literal"){typeof r.value=="string"&&a.push({node:r,text:r.value});return}if(r.type==="TemplateLiteral"){r.expressions.length===0&&a.push({node:r,text:r.quasis[0]?.value.cooked??""});return}for(let u of e.sourceCode.visitorKeys[r.type]??[]){let d=r[u],g=Array.isArray(d)?d:[d];for(let k of g){let f=k;!f||typeof f.type!="string"||o.FUNCTIONS.NODE_TYPES.has(f.type)||s(f,a);}}}};return {JSXAttribute(r){if(r.name.type!=="JSXIdentifier"||r.name.name!=="className"||r.value===null)return;let a=[];s(r.value,a);for(let{node:u,text:d}of a)d.length<=n||e.report({node:u,messageId:"tooLong",data:{length:d.length,max:n}});}}}},xt=new de;var fe=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:l({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"});}}}},Rt=new fe;var ge=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:l({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"||!ct(i.init.callee.name)||e.report({node:i,messageId:"destructure",data:{hook:i.init.callee.name,name:i.id.name}});}}}},Ot=new ge;var ye=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:l({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=et(i);n===null||!mt(n,e.sourceCode.visitorKeys)||dt(i.init,e.sourceCode.visitorKeys)&&e.report({node:i,messageId:"useMemo"});}}}},It=new ye;var Se=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:l({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(le(r))return true;if(r.type!=="Identifier")return false;let u=ASTUtils.findVariable(e.sourceCode.getScope(r),r.name)?.defs.at(-1)?.node;return u?.type==="VariableDeclarator"&&le(u.init)},n=r=>{e.report({node:r,messageId:"wrapInObject",fix:r.type==="Identifier"?a=>a.replaceText(r,`{ ${r.name} }`):void 0});},s=r=>{let a=x(r);if(!(a===void 0||!v(a))){if(r.type==="ArrowFunctionExpression"&&r.body.type!=="BlockStatement"){i(r.body)&&n(r.body);return}R(r.body,e.sourceCode.visitorKeys,u=>(u!==null&&i(u)&&n(u),false));}};return {FunctionDeclaration(r){s(r);},FunctionExpression(r){s(r);},ArrowFunctionExpression(r){s(r);}}}},Nt=new Se;var he=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:l({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:l({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"||!o.REACT.MEMO_HOOKS.has(i.init.callee.name))return;let n=i.parent;if(n.parent?.type==="ExportNamedDeclaration"&&(n=n.parent),!S(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(`
|
|
14
|
+
`)??[]).filter(u=>I(u)==="param").length<s.params.length&&e.report({node:i.id,messageId:"missingParam"});}}}},Lt=new he;var Kt=[Oe,ve,ze,Fe,Pe,Je,qe,Ge,$e,He,Xe,Ye,it,rt,nt,st,ot,at,lt,pt,ft,St,ht,bt,xt,Rt,Ot,It,Nt,Lt],L=Object.fromEntries(Kt.map(t=>[t.name,t.toRuleModule()]));function O(t){let e={};for(let[i,n]of Object.entries(L))(n.meta.docs?.category??"base")===t&&(e[`${o.PLUGIN_NAME}/${i}`]="warn");return e}function kt(){let t={};for(let e of Object.keys(L))t[`${o.PLUGIN_NAME}/${e}`]="warn";return t}function Ct(t){return {name:`${o.PLUGIN_NAME}/all`,plugins:{[o.PLUGIN_NAME]:t},settings:{[o.PLUGIN_NAME]:{adonisjs:true,react:true}},rules:kt()}}function z(t){return {name:`${o.PLUGIN_NAME}/base`,plugins:{[o.PLUGIN_NAME]:t},rules:O("base")}}function Dt(t){return {...z(t),name:`${o.PLUGIN_NAME}/recommended`}}var $t=["**/start/routes.ts","**/start/routes/**/*.ts"];function wt(t){return {name:`${o.PLUGIN_NAME}/adonisjs`,plugins:{[o.PLUGIN_NAME]:t},settings:{[o.PLUGIN_NAME]:{adonisjs:true}},rules:{...O("adonisjs"),[`${o.PLUGIN_NAME}/no-decorative-comment-separators`]:["warn",{allowIn:$t}]}}}function Mt(t){return {name:`${o.PLUGIN_NAME}/react`,plugins:{[o.PLUGIN_NAME]:t},settings:{[o.PLUGIN_NAME]:{react:true}},rules:O("react")}}function At(t){return {base:z(t),recommended:Dt(t),adonisjs:wt(t),react:Mt(t),all:Ct(t)}}var vt="0.7.6";var Te={meta:{name:`eslint-plugin-${o.PLUGIN_NAME}`,version:vt},rules:L,configs:{}};Te.configs=At(Te);var Sa=Te;export{Sa as default};//# sourceMappingURL=index.js.map
|
|
13
15
|
//# sourceMappingURL=index.js.map
|