PageSourceSearch

https://typescript-eslint.netlify.app/assets/js/3721eef1.9bec05a2.js

js typescript-eslint.netlify.app collected 2026-10-03 11:36:27 UTC 65,144 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["4664"],{80538(e,t,n){n.r(t),n.d(t,{metadata:()=>i,default:()=>h,frontMatter:()=>l,contentTitle:()=>o,toc:()=>p,assets:()=>d});var i=JSON.parse('{"id":"member-ordering","title":"member-ordering","description":"Require a consistent member declaration order.","source":"@site/../eslint-plugin/docs/rules/member-ordering.mdx","sourceDirName":".","slug":"/member-ordering","permalink":"/rules/member-ordering","draft":false,"unlisted":false,"editUrl":"https://github.com/typescript-eslint/typescript-eslint/edit/main/packages/website/../eslint-plugin/docs/rules/member-ordering.mdx","tags":[],"version":"current","frontMatter":{"description":"Require a consistent member declaration order.","image":"/img/og/rules/member-ordering.png"},"sidebar":"rulesSidebar","previous":{"title":"max-params","permalink":"/rules/max-params"},"next":{"title":"method-signature-style","permalink":"/rules/method-signature-style"}}'),r=n(65723),s=n(7143),a=n(70503),c=n(46742);let l={description:"Require a consistent member declaration order.",image:"/img/og/rules/member-ordering.png"},o,d={},p=[{value:"Options",id:"options",level:2},{value:"Groups",id:"groups",level:3},{value:"Orders",id:"orders",level:3},{value:"Default configuration",id:"default-configuration",level:3},{value:"Examples",id:"examples",level:2},{value:"General Order on All Constructs",id:"general-order-on-all-constructs",level:3},{value:"Classes",id:"classes",level:3},{value:"Public Instance Methods Before Public Static Fields",id:"public-instance-methods-before-public-static-fields",level:4},{value:"Static Fields Before Instance Fields",id:"static-fields-before-instance-fields",level:4},{value:"Class Declarations",id:"class-declarations",level:4},{value:"Class Expressions",id:"class-expressions",level:4},{value:"Interfaces",id:"interfaces",level:3},{value:"Type Literals",id:"type-literals",level:3},{value:"Sorting Options",id:"sorting-options",level:3},{value:"Sorting Alphabetically Within Member Groups",id:"sorting-alphabetically-within-member-groups",level:4},{value:"Sorting Alphabetically Within Custom Member Groups",id:"sorting-alphabetically-within-custom-member-groups",level:4},{value:"Sorting Alphabetically Case Insensitive Within Member Groups",id:"sorting-alphabetically-case-insensitive-within-member-groups",level:4},{value:"Sorting Alphabetically Ignoring Member Groups",id:"sorting-alphabetically-ignoring-member-groups",level:4},{value:"Sorting Optional Members First or Last",id:"sorting-optional-members-first-or-last",level:4},{value:"All Supported Options",id:"all-supported-options",level:2},{value:"Member Types (Granular Form)",id:"member-types-granular-form",level:3},{value:"Member Group Types (With Accessibility, Ignoring Scope)",id:"member-group-types-with-accessibility-ignoring-scope",level:3},{value:"Member Group Types (With Accessibility and a Decorator)",id:"member-group-types-with-accessibility-and-a-decorator",level:3},{value:"Member Group Types (With Scope, Ignoring Accessibility)",id:"member-group-types-with-scope-ignoring-accessibility",level:3},{value:"Member Group Types (With Scope and Accessibility)",id:"member-group-types-with-scope-and-accessibility",level:3},{value:"Member Group Types (Readonly Fields)",id:"member-group-types-readonly-fields",level:3},{value:"Grouping Different Member Types at the Same Rank",id:"grouping-different-member-types-at-the-same-rank",level:3},{value:"When Not To Use It",id:"when-not-to-use-it",level:2},{value:"Resources",id:"resources",level:2}];function u(e){let t={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",em:"em",h2:"h2",h3:"h3",h4:"h4",li:"li",meta:"meta",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components},{Head:n,RuleAttributes:i,TryInPlayground:l}=t;return n||A("Head",!0),i||A("RuleAttributes",!0),l||A("TryInPlayground",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(t.blockquote,{children:["\n",(0,r.jsx)(t.p,{children:"Require a consistent member declaration order."}),"\n"]})}),"\n",(0,r.jsx)(i,{name:"member-ordering"}
1),"\n","\n",(0,r.jsx)(t.p,{children:"This rule aims to standardize the way classes, interfaces, and type literals are structured and ordered.\nA consistent ordering of fields, methods and constructors can make code easier to read, navigate, and edit."}),"\n",(0,r.jsxs)(t.admonition,{type:"note",children:[(0,r.jsxs)(t.p,{children:["This rule is ",(0,r.jsx)(t.em,{children:"feature frozen"}),": it will no longer receive new features such as new options.\nIt still will accept bug and documentation fixes for its existing area of features."]}),(0,r.jsxs)(t.p,{children:["Stylistic rules that enforce naming and/or sorting conventions tend to grow incomprehensibly complex as increasingly obscure features are requested.\nThis rule has reached the limit of what is reasonable for the typescript-eslint project to maintain.\nSee ",(0,r.jsx)(t.a,{href:"https://github.com/typescript-eslint/typescript-eslint/issues/8792",children:"eslint-plugin: Feature freeze naming and sorting stylistic rules"})," for more information."]})]}),"\n",(0,r.jsxs)(a.A,{children:[(0,r.jsx)(c.A,{value:"Flat Config",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-js",metastring:'title="eslint.config.mjs"',children:'export default defineConfig({\n  rules: {\n    "@typescript-eslint/member-ordering": "error"\n  }\n});\n'})})}),(0,r.jsx)(c.A,{value:"Legacy Config",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-js",metastring:'title=".eslintrc.cjs"',children:'module.exports = {\n  "rules": {\n    "@typescript-eslint/member-ordering": "error"\n  }\n};\n'})})})]}),"\n",(0,r.jsx)(l,{eslintrcHash:"N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0UPtCGRwYAL4hFQA",children:(0,r.jsx)(t.p,{children:"Try this rule in the playground \u2197"})}),"\n",(0,r.jsx)(t.h2,{id:"options",children:"Options"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",children:"interface Options {\n  default?: OrderConfig;\n  classes?: OrderConfig;\n  classExpressions?: OrderConfig;\n  interfaces?: OrderConfig;\n  typeLiterals?: OrderConfig;\n}\n\ntype OrderConfig = MemberType[] | SortedOrderConfig | 'never';\n\ninterface SortedOrderConfig {\n  memberTypes?: MemberType[] | 'never';\n  optionalityOrder?: 'optional-first' | 'required-first';\n  order?:\n    | 'alphabetically'\n    | 'alphabetically-case-insensitive'\n    | 'as-written'\n    | 'natural'\n    | 'natural-case-insensitive';\n}\n\n// See below for the more specific MemberType strings\ntype MemberType = string | string[];\n"})}),"\n",(0,r.jsxs)(t.p,{children:["You can configure ",(0,r.jsx)(t.code,{children:"OrderConfig"})," options for:"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:(0,r.jsx)(t.code,{children:"default"})}),": all constructs (used as a fallback)"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:(0,r.jsx)(t.code,{children:"classes"})}),"?: override ordering specifically for classes"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:(0,r.jsx)(t.code,{children:"classExpressions"})}),"?: override ordering specifically for class expressions"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:(0,r.jsx)(t.code,{children:"interfaces"})}),"?: override ordering specifically for interfaces"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:(0,r.jsx)(t.code,{children:"typeLiterals"})}),"?: override ordering specifically for type literals"]}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.code,{children:"OrderConfig"})," settings for each kind of construct may configure sorting on up to three levels:"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:(0,r.jsx)(t.code,{children:"memberTypes"})}),": organizing on member type groups such as methods vs. properties"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:(0,r.jsx)(t.code,{children:"optionalityOrder"})}),": whether to put all optional members first or all required members first"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:(0,r.jsx)(t.code,{children:"order"})}),": organizing based on member names, such as alphabetically"]}),"\n"]}),"\n",(0,r.jsx)(t.h3,{id:"groups",children:"Groups"}),"\n",(0,r.jsx)(t.p,{children:"You can define many different groups based on different attributes of members.\nThe supported member attributes are, in order:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Accessibility"})," (",(0,r.jsx)(t.code,{children:"'public' | 'protected' | 'private' | '#private'"}),")"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Decoration"})," (",(0,r.jsx)(t.code,{children:"'decorated'"}),"): Whether the member has an explicit accessibility decorator"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Kind"})," (",(0,r.jsx)(t.code,{children:"'call-signature' | 'constructor' | 'field' | 'readonly-field' | 'get' | 'method' | 'set' | 'signature' | 'readonly-signature'"}),")"]}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["Member attributes may be joined with a ",(0,r.jsx)(t.code,{children:"'-'"})," to combine into more specific groups.\nFor example, ",(0,r.jsx)(t.code,{children:"'public-field'"})," would come before ",(0,r.jsx)(t.code,{children:"'private-field'"}),"."]}),"\n",(0,r.jsx)(t.h3,{id:"orders",children:"Orders"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.code,{children:"order"})," value specifies what order members should be within a group.\nIt defaults to ",(0,r.jsx)(t.code,{children:"as-written"}),", meaning any order is fine.\nOther allowed values are:"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"alphabetically"}),": Sorted in a-z alphabetical order, directly using string ",(0,r.jsx)(t.code,{children:"<"})," comparison (so ",(0,r.jsx)(t.code,{children:"B"})," comes before ",(0,r.jsx)(t.code,{children:"a"}),")"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"alphabetically-case-insensitive"}),": Sorted in a-z alphabetical order, ignoring case (so ",(0,r.jsx)(t.code,{children:"a"})," comes before ",(0,r.jsx)(t.code,{children:"B"}),")"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"natural"}),": Same as ",(0,r.jsx)(t.code,{children:"alphabetically"}),", but using ",(0,r.jsx)(t.a,{href:"https://github.com/litejs/natural-compare-lite",children:(0,r.jsx)(t.code,{children:"natural-compare-lite"})})," for more friendly sorting of numbers"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"natural-case-insensitive"}),": Same as ",(0,r.jsx)(t.code,{children:"alphabetically-case-insensitive"}),", but using ",(0,r.jsx)(t.a,{href:"https://github.com/litejs/natural-compare-lite",children:(0,r.jsx)(t.code,{children:"natural-compare-lite"})})," for more friendly sorting of numbers"]}),"\n"]}),"\n",(0,r.jsx)(t.h3,{id:"default-configuration",children:"Default configuration"}),"\n",(0,r.jsx)(t.p,{children:"The default configuration looks as follows:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsonc",children:'{\n  "default": {\n    "memberTypes": [\n      // Index signature\n      "signature",\n      "call-signature",\n\n      // Fields\n      "public-static-field",\n      "protected-static-field",\n      "private-static-field",\n      "#private-static-field",\n\n      "public-decorated-field",\n      "protected-decorated-field",\n      "private-decorated-field",\n\n      "public-instance-field",\n      "protected-instance-field",\n      "private-instance-field",\n      "#private-instance-field",\n\n      "public-abstract-field",\n      "protected-abstract-field",\n\n      "public-field",\n      "protected-field",\n      "private-field",\n      "#private-field",\n\n      "static-field",\n      "instance-field",\n      "abstract-field",\n\n      "decorated-field",\n\n      "field",\n\n      // Static initialization\n      "static-initialization",\n\n      // Constructors\n      "public-constructor",\n      "protected-constructor",\n      "private-constructor",\n\n      "constructor",\n\n      // Accessors\n      "public-static-accessor",\n      "protected-static-accessor",\n      "private-static-accessor",\n      "#private-static-accessor",\n\n      "public-decorated-accessor",\n      "protected-decorated-accessor",\n      "private-decorated-accessor",\n\n      "public-instance-accessor",\n      "protected-instance-accessor",\n      "private-instance-accessor",\n      "#private-instance-accessor",\n\n      "public-abstract-accessor",\n      "protected-abstract-accessor",\n\n      "public-accessor",\n      "protected-accessor",\n      "private-accessor",\n      "#private-accessor",\n\n      "static-accessor",\n      "instance-accessor",\n      "abstract-accessor",\n\n      "decorated-accessor",\n\n      "accessor",\n\n      // Getters\n      "public-static-get",\n      "protected-static-get",\n      "private-static-get",\n      "#private-static-get",\n\n      "public-decorated-get",\n      "protected-decorated-get",\n      "private-decorated-get",\n\n      "public-instance-get",\n      "protected-instance-get",\n      "private-instance-get",\n      "#private-instance-get",\n\n      "public-abstract-get",\n      "protected-abstract-get",\n\n      "public-get",\n      "protected-get",\n      "private-get",\n      "#private-get",\n\n      "static-get",\n      "instance-get",\n      "abstract-get",\n\n      "decorated-get",\n\n      "get",\n\n      // Setters\n      "public-static-set",\n      "protected-static-set",\n      "private-static-set",\n      "#private-static-set",\n\n      "public-decorated-set",\n      "protected-decorated-set",\n      "private-decorated-set",\n\n      "public-instance-set",\n      "protected-instance-set",\n      "private-instance-set",\n      "#private-instance-set",\n\n      "public-abstract-set",\n      "protected-abstract-set",\n\n      "public-set",\n      "protected-set",\n      "private-set",\n      "#private-set",\n\n      "static-set",\n      "instance-set",\n      "abstract-set",\n\n      "decorated-set",\n\n      "set",\n\n      // Methods\n      "public-static-method",\n      "protected-static-method",\n      "private-static-method",\n      "#private-static-method",\n\n      "public-decorated-method",\n      "protected-decorated-method",\n      "private-decorated-method",\n\n      "public-instance-method",\n      "protected-instance-method",\n      "private-instance-method",\n      "#private-instance-method",\n\n      "public-abstract-method",\n      "protected-abstract-method",\n\n      "public-method",\n      "protected-method",\n      "private-method",\n      "#private-method",\n\n      "static-method",\n      "instance-method",\n      "abstract-method",\n\n      "decorated-method",\n\n      "method",\n    ],\n  },\n}\n'})}),"\n",(0,r.jsx)(t.admonition,{type:"note",children:(0,r.jsx)(t.p,{children:"The default configuration contains member group types which contain other member types.\nThis is intentional to provide better error messages."})}),"\n",(0,r.jsx)(t.admonition,{type:"tip",children:(0,r.jsx)(t.p,{children:"By default, the members are not sorted.\nIf you want to sort them alphabetically, you have to provide a custom configuration."})}),"\n",(0,r.jsx)(t.h2,{id:"examples",children:"Examples"}
1),"\n",(0,r.jsx)(t.h3,{id:"general-order-on-all-constructs",children:"General Order on All Constructs"}),"\n",(0,r.jsx)(t.p,{children:"This config specifies the order for all constructs.\nIt ignores member types other than signatures, methods, constructors, and fields.\nIt also ignores accessibility and scope."}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsonc",children:'// .eslintrc.json\n{\n  "rules": {\n    "@typescript-eslint/member-ordering": [\n      "error",\n      { "default": ["signature", "method", "constructor", "field"] },\n    ],\n  },\n}\n'})}),"\n",(0,r.jsxs)(a.A,{children:[(0,r.jsxs)(c.A,{value:"\u274C Incorrect",children:[(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "default": ["signature", "method", "constructor", "field"] }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4psrVsjJK4pvvyxoiVerNRO+ABYDhTl9rICmZHw4MnxlNV8cXUpEeG9neQBdBLAAX2dkiHTUoA"',children:"interface Foo {\n  B: string; // -> field\n\n  new (); // -> constructor\n\n  A(): void; // -> method\n\n  [Z: string]: any; // -> signature\n}\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "default": ["signature", "method", "constructor", "field"] }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4psrVsjJK4pvvyxoiVerNRO+ABYDhTl9rICmZHw4MnxlNV8cXUpEeG9neQBdBLAAX2dkiHTUoA"',children:"type Foo = {\n  B: string; // -> field\n\n  // no constructor\n\n  A(): void; // -> method\n\n  // no signature\n};\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "default": ["signature", "method", "constructor", "field"] }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4psrVsjJK4pvvyxoiVerNRO+ABYDhTl9rICmZHw4MnxlNV8cXUpEeG9neQBdBLAAX2dkiHTUoA"',children:"class Foo {\n  private C: string; // -> field\n  public D: string; // -> field\n  protected static E: string; // -> field\n\n  constructor() {} // -> constructor\n\n  public static A(): void {} // -> method\n  public B(): void {} // -> method\n\n  [Z: string]: any; // -> signature\n}\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "default": ["signature", "method", "constructor", "field"] }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4psrVsjJK4pvvyxoiVerNRO+ABYDhTl9rICmZHw4MnxlNV8cXUpEeG9neQBdBLAAX2dkiHTUoA"',children:"const Foo = class {\n  private C: string; // -> field\n  public D: string; // -> field\n\n  constructor() {} // -> constructor\n\n  public static A(): void {} // -> method\n  public B(): void {} // -> method\n\n  [Z: string]: any; // -> signature\n\n  protected static E: string; // -> field\n};\n"})})]}),(0,r.jsxs)(c.A,{value:"\u2705 Correct",children:[(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "default": ["signature", "method", "constructor", "field"] }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4psrVsjJK4pvvyxoiVerNRO+ABYDhTl9rICmZHw4MnxlNV8cXUpEeG9neQBdBLAAX2dkiHTUoA"',children:"interface Foo {\n  [Z: string]: any; // -> signature\n\n  A(): void; // -> method\n\n  new (); // -> constructor\n\n  B: string; // -> field\n}\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "default": ["signature", "method", "constructor", "field"] }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4psrVsjJK4pvvyxoiVerNRO+ABYDhTl9rICmZHw4MnxlNV8cXUpEeG9neQBdBLAAX2dkiHTUoA"',children:"type Foo = {\n  // no signature\n\n  A(): void; // -> method\n\n  // no constructor\n\n  B: string; // -> field\n};\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "default": ["signature", "method", "constructor", "field"] }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4psr
1VsjJK4pvvyxoiVerNRO+ABYDhTl9rICmZHw4MnxlNV8cXUpEeG9neQBdBLAAX2dkiHTUoA"',children:"class Foo {\n  [Z: string]: any; // -> signature\n\n  public static A(): void {} // -> method\n  public B(): void {} // -> method\n\n  constructor() {} // -> constructor\n\n  private C: string; // -> field\n  public D: string; // -> field\n  protected static E: string; // -> field\n}\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "default": ["signature", "method", "constructor", "field"] }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4psrVsjJK4pvvyxoiVerNRO+ABYDhTl9rICmZHw4MnxlNV8cXUpEeG9neQBdBLAAX2dkiHTUoA"',children:"const Foo = class {\n  [Z: string]: any; // -> signature\n\n  public static A(): void {} // -> method\n  public B(): void {} // -> method\n\n  constructor() {} // -> constructor\n\n  private C: string; // -> field\n  public D: string; // -> field\n  protected static E: string; // -> field\n};\n"})})]})]}),"\n",(0,r.jsx)(t.h3,{id:"classes",children:"Classes"}),"\n",(0,r.jsx)(t.h4,{id:"public-instance-methods-before-public-static-fields",children:"Public Instance Methods Before Public Static Fields"}),"\n",(0,r.jsx)(t.p,{children:"This config specifies that public instance methods should come first before public static fields.\nEverything else can be placed anywhere.\nIt doesn't apply to interfaces or type literals as accessibility and scope are not part of them."}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsonc",children:'// .eslintrc.json\n{\n  "rules": {\n    "@typescript-eslint/member-ordering": [\n      "error",\n      { "default": ["public-instance-method", "public-static-field"] },\n    ],\n  },\n}\n'})}),"\n",(0,r.jsxs)(a.A,{children:[(0,r.jsxs)(c.A,{value:"\u274C Incorrect",children:[(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "default": ["public-instance-method", "public-static-field"] }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4psrVsjFY3RmVrNk+fUzKJanfAAsBw1erNRLa0pbB318YNpdSkR4Hz95AF14sABfPySINJSgA"',children:"class Foo {\n  private C: string; // (irrelevant)\n\n  public D: string; // (irrelevant)\n\n  public static E: string; // -> public static field\n\n  constructor() {} // (irrelevant)\n\n  public static A(): void {} // (irrelevant)\n\n  [Z: string]: any; // (irrelevant)\n\n  public B(): void {} // -> public instance method\n}\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "default": ["public-instance-method", "public-static-field"] }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4psrVsjFY3RmVrNk+fUzKJanfAAsBw1erNRLa0pbB318YNpdSkR4Hz95AF14sABfPySINJSgA"',children:"const Foo = class {\n  private C: string; // (irrelevant)\n\n  [Z: string]: any; // (irrelevant)\n\n  public static E: string; // -> public static field\n\n  public D: string; // (irrelevant)\n\n  constructor() {} // (irrelevant)\n\n  public static A(): void {} // (irrelevant)\n\n  public B(): void {} // -> public instance method\n};\n"})})]}),(0,r.jsxs)(c.A,{value:"\u2705 Correct",children:[(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "default": ["public-instance-method", "public-static-field"] }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4psrVsjFY3RmVrNk+fUzKJanfAAsBw1erNRLa0pbB318YNpdSkR4Hz95AF14sABfPySINJSgA"',children:"class Foo {\n  public B(): void {} // -> public instance method\n\n  private C: string; // (irrelevant)\n\n  public D: string; // (irrelevant)\n\n  public static E: string; // -> public static field\n\n  constructor() {} // (irrelevant)\n\n  public static A(): void {} // (irrelevant)\n\n  [Z: string]: any; // (irrelevant)\n}\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "default": ["public-instance-method", "public-static-field"] }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4psr
1VsjFY3RmVrNk+fUzKJanfAAsBw1erNRLa0pbB318YNpdSkR4Hz95AF14sABfPySINJSgA"',children:"const Foo = class {\n  public B(): void {} // -> public instance method\n\n  private C: string; // (irrelevant)\n\n  [Z: string]: any; // (irrelevant)\n\n  public D: string; // (irrelevant)\n\n  constructor() {} // (irrelevant)\n\n  public static A(): void {} // (irrelevant)\n\n  public static E: string; // -> public static field\n};\n"})})]})]}),"\n",(0,r.jsx)(t.h4,{id:"static-fields-before-instance-fields",children:"Static Fields Before Instance Fields"}),"\n",(0,r.jsx)(t.p,{children:"This config specifies that static fields should come before instance fields, with public static fields first.\nIt doesn't apply to interfaces or type literals as accessibility and scope are not part of them."}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsonc",children:'{\n  "rules": {\n    "@typescript-eslint/member-ordering": [\n      "error",\n      { "default": ["public-static-field", "static-field", "instance-field"] },\n    ],\n  },\n}\n'})}),"\n",(0,r.jsxs)(a.A,{children:[(0,r.jsxs)(c.A,{value:"\u274C Incorrect",children:[(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "default": ["public-static-field", "static-field", "instance-field"] }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4psrVsjFY3RmVrJ8+-JVu7KieMNXqzUe4+e0ru6eaj7azH5MZIiBbh6Q3vIAuolgAL7eKRAZaUA"',children:"class Foo {\n  private E: string; // -> instance field\n\n  private static B: string; // -> static field\n  protected static C: string; // -> static field\n  private static D: string; // -> static field\n\n  public static A: string; // -> public static field\n\n  [Z: string]: any; // (irrelevant)\n}\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "default": ["public-static-field", "static-field", "instance-field"] }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4psrVsjFY3RmVrJ8+-JVu7KieMNXqzUe4+e0ru6eaj7azH5MZIiBbh6Q3vIAuolgAL7eKRAZaUA"',children:"const foo = class {\n  public T(): void {} // method (irrelevant)\n\n  private static B: string; // -> static field\n\n  constructor() {} // constructor (irrelevant)\n\n  private E: string; // -> instance field\n\n  protected static C: string; // -> static field\n  private static D: string; // -> static field\n\n  [Z: string]: any; // signature (irrelevant)\n\n  public static A: string; // -> public static field\n};\n"})})]}),(0,r.jsxs)(c.A,{value:"\u2705 Correct",children:[(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "default": ["public-static-field", "static-field", "instance-field"] }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4psrVsjFY3RmVrJ8+-JVu7KieMNXqzUe4+e0ru6eaj7azH5MZIiBbh6Q3vIAuolgAL7eKRAZaUA"',children:"class Foo {\n  public static A: string; // -> public static field\n\n  private static B: string; // -> static field\n  protected static C: string; // -> static field\n  private static D: string; // -> static field\n\n  private E: string; // -> instance field\n\n  [Z: string]: any; // (irrelevant)\n}\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "default": ["public-static-field", "static-field", "instance-field"] }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4psrVsjFY3RmVrJ8+-JVu7KieMNXqzUe4+e0ru6eaj7azH5MZIiBbh6Q3vIAuolgAL7eKRAZaUA"',children:"const foo = class {\n  [Z: string]: any; // -> signature (irrelevant)\n\n  public static A: string; // -> public static field\n\n  constructor() {} // -> constructor (irrelevant)\n\n  private static B: string; // -> static field\n  protected static C: string; // -> static field\n  private static D: string; // -> static field\n\n  private E: string; // -> instance field\n\n  public T(): void {} // -> method (irrelevant)\n};\n"})})]})]}),"\n",(0,r.jsx)(t.h4,{id:"class-declarations",children:"Class Declarations"}),"\n",(0,r.jsxs)(t.p,{children:["This config only specifies an order for classes: methods, then the constructor, then fields.\nIt does not apply to class expressions (use ",(0,r.jsx)(t.code,{children:"classExpressions"})," for them).\nDefault settings will be used for class declarations and all other syntax constructs other than class declarations."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsonc",children:'// .eslintrc.json\n{\n  "rules": {\
1n    "@typescript-eslint/member-ordering": [\n      "error",\n      { "classes": ["method", "constructor", "field"] },\n    ],\n  },\n}\n'})}),"\n",(0,r.jsxs)(a.A,{children:[(0,r.jsx)(c.A,{value:"\u274C Incorrect",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "classes": ["method", "constructor", "field"] }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SGXgBDZMhRTZWrZE74AFgOGr1ZqGQFNk+OGXzK1j7QDNKRHg7B3kAXVCwAF8HCIgYqKA"',children:"class Foo {\n  private C: string; // -> field\n  public D: string; // -> field\n  protected static E: string; // -> field\n\n  constructor() {} // -> constructor\n\n  public static A(): void {} // -> method\n  public B(): void {} // -> method\n}\n"})})}),(0,r.jsx)(c.A,{value:"\u2705 Correct",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "classes": ["method", "constructor", "field"] }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SGXgBDZMhRTZWrZE74AFgOGr1ZqGQFNk+OGXzK1j7QDNKRHg7B3kAXVCwAF8HCIgYqKA"',children:"class Foo {\n  public static A(): void {} // -> method\n  public B(): void {} // -> method\n\n  constructor() {} // -> constructor\n\n  private C: string; // -> field\n  public D: string; // -> field\n  protected static E: string; // -> field\n}\n"})})})]}),"\n",(0,r.jsx)(t.h4,{id:"class-expressions",children:"Class Expressions"}),"\n",(0,r.jsxs)(t.p,{children:["This config only specifies an order for classes expressions: methods, then the constructor, then fields.\nIt does not apply to class declarations (use ",(0,r.jsx)(t.code,{children:"classes"})," for them).\nDefault settings will be used for class declarations and all other syntax constructs other than class expressions."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsonc",children:'// .eslintrc.json\n{\n  "rules": {\n    "@typescript-eslint/member-ordering": [\n      "error",\n      { "classExpressions": ["method", "constructor", "field"] },\n    ],\n  },\n}\n'})}),"\n",(0,r.jsxs)(a.A,{children:[(0,r.jsx)(c.A,{value:"\u274C Incorrect",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "classExpressions": ["method", "constructor", "field"] }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SGXgBDZMgCiAD2LQUySgKaoMsrVsid8ACwHDV6x1DI3k+HBk+MpqPtoAZpSI8J7e8gC68WAAvt5JEGkpQA"',children:"const foo = class {\n  private C: string; // -> field\n  public D: string; // -> field\n  protected static E: string; // -> field\n\n  constructor() {} // -> constructor\n\n  public static A(): void {} // -> method\n  public B(): void {} // -> method\n};\n"})})}),(0,r.jsx)(c.A,{value:"\u2705 Correct",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "classExpressions": ["method", "constructor", "field"] }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SGXgBDZMgCiAD2LQUySgKaoMsrVsid8ACwHDV6x1DI3k+HBk+MpqPtoAZpSI8J7e8gC68WAAvt5JEGkpQA"',children:"const foo = class {\n  public static A(): void {} // -> method\n  public B(): void {} // -> method\n\n  constructor() {} // -> constructor\n\n  private C: string; // -> field\n  public D: string; // -> field\n  protected static E: string; // -> field\n};\n"})})})]}),"\n",(0,r.jsx)(t.h3,{id:"interfaces",children:"Interfaces"}),"\n",(0,r.jsxs)(t.p,{children:["This config only specifies an order for interfaces: signatures, then methods, then constructors, then fields.\nIt does not apply to type literals (use ",(0,r.jsx)(t.code,{children:"typeLiterals"})," for them).\nDefault settings will be used for type literals and all other syntax constructs other than class expressions."]}),"\n",(0,r.jsx)(t.admonition,{type:"note",children:(0,r.jsxs)(t.p,{children:["These member types are the only ones allowed for ",(0,r.jsx)(t.code,{children:"interfaces"}),"."]})}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsonc",children:'// .eslintrc.json\n{\n  "rules": {\
1n    "@typescript-eslint/member-ordering": [\n      "error",\n      { "interfaces": ["signature", "method", "constructor", "field"] },\n    ],\n  },\n}\n'})}),"\n",(0,r.jsxs)(a.A,{children:[(0,r.jsx)(c.A,{value:"\u274C Incorrect",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "interfaces": ["signature", "method", "constructor", "field"] }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SM3x8AZgEMyKKbK1bIySuKaH8saIlXqLUTvgAWA4S7fayASZkfDgyfGU1fxx9SkR4X1d5AF0ksABfV1SITPSgA"',children:"interface Foo {\n  B: string; // -> field\n\n  new (); // -> constructor\n\n  A(): void; // -> method\n\n  [Z: string]: any; // -> signature\n}\n"})})}),(0,r.jsx)(c.A,{value:"\u2705 Correct",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "interfaces": ["signature", "method", "constructor", "field"] }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SM3x8AZgEMyKKbK1bIySuKaH8saIlXqLUTvgAWA4S7fayASZkfDgyfGU1fxx9SkR4X1d5AF0ksABfV1SITPSgA"',children:"interface Foo {\n  [Z: string]: any; // -> signature\n\n  A(): void; // -> method\n\n  new (); // -> constructor\n\n  B: string; // -> field\n}\n"})})})]}),"\n",(0,r.jsx)(t.h3,{id:"type-literals",children:"Type Literals"}),"\n",(0,r.jsxs)(t.p,{children:["This config only specifies an order for type literals: signatures, then methods, then constructors, then fields.\nIt does not apply to interfaces (use ",(0,r.jsx)(t.code,{children:"interfaces"})," for them).\nDefault settings will be used for interfaces and all other syntax constructs other than class expressions."]}),"\n",(0,r.jsx)(t.admonition,{type:"note",children:(0,r.jsxs)(t.p,{children:["These member types are the only ones allowed for ",(0,r.jsx)(t.code,{children:"typeLiterals"}),"."]})}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsonc",children:'// .eslintrc.json\n{\n  "rules": {\n    "@typescript-eslint/member-ordering": [\n      "error",\n      { "typeLiterals": ["signature", "method", "constructor", "field"] },\n    ],\n  },\n}\n'})}),"\n",(0,r.jsxs)(a.A,{children:[(0,r.jsx)(c.A,{value:"\u274C Incorrect",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "typeLiterals": ["signature", "method", "constructor", "field"] }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SEVIAZSvj4BDeKgyytWyMkrimx-LGiJV6q1E74AFgOFuPbTIBJmR8ODJ8ZTVAnAAzSkR4f3d5AF1UsABfdwyIHKygA"',children:"type Foo = {\n  B: string; // -> field\n\n  A(): void; // -> method\n\n  new (); // -> constructor\n\n  [Z: string]: any; // -> signature\n};\n"})})}),(0,r.jsx)(c.A,{value:"\u2705 Correct",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "typeLiterals": ["signature", "method", "constructor", "field"] }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SEVIAZSvj4BDeKgyytWyMkrimx-LGiJV6q1E74AFgOFuPbTIBJmR8ODJ8ZTVAnAAzSkR4f3d5AF1UsABfdwyIHKygA"',children:"type Foo = {\n  [Z: string]: any; // -> signature\n\n  A(): void; // -> method\n\n  new (); // -> constructor\n\n  B: string; // -> field\n};\n"})})})]}),"\n",(0,r.jsx)(t.h3,{id:"sorting-options",children:"Sorting Options"}),"\n",(0,r.jsx)(t.h4,{id:"sorting-alphabetically-within-member-groups",children:"Sorting Alphabetically Within Member Groups"}),"\n",(0,r.jsxs)(t.p,{children:["The default member order will be applied if ",(0,r.jsx)(t.code,{children:"memberTypes"})," is not specified.\nYou can see the default order in ",(0,r.jsx)(t.a,{href:"#default-configuration",children:"Default Configuration"}),"."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsonc",children:'// .eslintrc.json\n{\n  "rules": {\n    "@typescript-eslint/member-ordering": [\n      "error",\n      {\n        "default": {\n          "order": "alphabetically",\n        },\n      },\n    ],\n  },\n}\n'})}),"\n",(0,r.jsxs)(a.A,{children:[(0,r.jsx)(c.A,{value:"\u274C Incorrect",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{"default":{"order":"alphabetically"}}\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4pmrdqGjoUyPvjEAFvt75KZW-EKR1WgL7eIfvIAunJ+PkA"',children:"interface Foo {\n  a: x;\n  B: x;\n  c: x;\n\n  B(): void;\n  c(): void;\n  a(): void;\n}\n"})})}),(0,r.jsx)(c.A,{value:"\u2705 Correct",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{"default":{"order":"alphabetically"}}\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4pmrdqGjoUyPvjEAFvt75KZW-EKR1WgL7eIfvIAunJ+PkA"',children:"interface Foo {\n  B: x;\n  a: x;\n  c: x;\n\n  B(): void;\n  a(): void;\n  c(): void;\n}\n"})})})]}),"\n",(0,r.jsx)(t.h4,{id:"sorting-alphabetically-within-custom-member-groups",children:"Sorting Alphabetically Within Custom Member Groups"}),"\n",(0,r.jsxs)(t.p,{children:["This config specifies that within each custom ",(0,r.jsx)(t.code,{children:"memberTypes"})," group, members are in an alphabetic case-sensitive order."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsonc",children:'// .eslintrc.json\n{\n  "rules": {\
1n    "@typescript-eslint/member-ordering": [\n      "error",\n      {\n        "default": {\n          "memberTypes": ["method", "field"],\n          "order": "alphabetically",\n        },\n      },\n    ],\n  },\n}\n'})}),"\n",(0,r.jsxs)(a.A,{children:[(0,r.jsx)(c.A,{value:"\u274C Incorrect",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{"default":{"memberTypes":["method","field"],"order":"alphabetically"}}\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4pmrds48+AFRIopss2cid8ACwHDV6xzl2VE8J7eZgC6aj44QqLQUpD68MSu+rz4lGTx8ISQwdgAvjn58iFy+blAA"',children:"interface Foo {\n  B(): void;\n  c(): void;\n  a(): void;\n\n  a: x;\n  B: x;\n  c: x;\n}\n"})})}),(0,r.jsx)(c.A,{value:"\u2705 Correct",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{"default":{"memberTypes":["method","field"],"order":"alphabetically"}}\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4pmrds48+AFRIopss2cid8ACwHDV6xzl2VE8J7eZgC6aj44QqLQUpD68MSu+rz4lGTx8ISQwdgAvjn58iFy+blAA"',children:"interface Foo {\n  B(): void;\n  a(): void;\n  c(): void;\n\n  B: x;\n  a: x;\n  c: x;\n}\n"})})})]}),"\n",(0,r.jsx)(t.h4,{id:"sorting-alphabetically-case-insensitive-within-member-groups",children:"Sorting Alphabetically Case Insensitive Within Member Groups"}),"\n",(0,r.jsxs)(t.p,{children:["The default member order will be applied if ",(0,r.jsx)(t.code,{children:"memberTypes"})," is not specified.\nYou can see the default order in ",(0,r.jsx)(t.a,{href:"#default-configuration",children:"Default Configuration"}),"."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsonc",children:'// .eslintrc.json\n{\n  "rules": {\n    "@typescript-eslint/member-ordering": [\n      "error",\n      {\n        "default": {\n          "order": "alphabetically-case-insensitive",\n        },\n      },\n    ],\n  },\n}\n'})}),"\n",(0,r.jsxs)(a.A,{children:[(0,r.jsx)(c.A,{value:"\u274C Incorrect",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{"default":{"order":"alphabetically-case-insensitive"}}\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4pmrdqGjoUyPvjEAFvt75KZW-EK03yRLWY+mZEoXADdESHUtAF9IiBj5AF05GKigA"',children:"interface Foo {\n  B: x;\n  a: x;\n  c: x;\n\n  B(): void;\n  c(): void;\n  a(): void;\n}\n"})})}),(0,r.jsx)(c.A,{value:"\u2705 Correct",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{"default":{"order":"alphabetically-case-insensitive"}}\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4pmrdqGjoUyPvjEAFvt75KZW-EK03yRLWY+mZEoXADdESHUtAF9IiBj5AF05GKigA"',children:"interface Foo {\n  a: x;\n  B: x;\n  c: x;\n\n  a(): void;\n  B(): void;\n  c(): void;\n}\n"})})})]}),"\n",(0,r.jsx)(t.h4,{id:"sorting-alphabetically-ignoring-member-groups",children:"Sorting Alphabetically Ignoring Member Groups"}),"\n",(0,r.jsxs)(t.p,{children:["This config specifies that members are all sorted in an alphabetic case-sensitive order.\nIt ignores any member group types completely by specifying ",(0,r.jsx)(t.code,{children:'"never"'})," for ",(0,r.jsx)(t.code,{children:"memberTypes"}),"."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsonc",children:'// .eslintrc.json\n{\n  "rules": {\n    "@typescript-eslint/member-ordering": [\n      "error",\n      { "default": { "memberTypes": "never", "order": "alphabetically" } },\n    ],\n  },\n}\n'})}),"\n",(0,r.jsxs)(a.A,{children:[(0,r.jsx)(c.A,{value:"\u274C Incorrect",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "default": { "memberTypes": "never", "order": "alphabetically" } }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4pmrds48+AFRIopkJogBufVerNQho6Pf3xiABb6vPiUZH7whJDu8gC+MWDx8gC6cvGxQA"',children:"interface Foo {\n  b(): void;\n  a: boolean;\n\n  [a: string]: number;\n  new (): Bar;\n  (): Baz;\n}\n"})})}),(0,r.jsx)(c.A,{value:"\u2705 Correct",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "default": { "memberTypes": "never", "order": "alphabetically" } }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4pmrds48+AFRIopkJogBufVerNQho6Pf3xiABb6vPiUZH7whJDu8gC+MWDx8gC6cvGxQA"',children:"interface Foo {\n  [a: string]: number;\n  a: boolean;\n  b(): void;\n\n  (): Baz;\n  new (): Bar;\n}\n"})})})]}),"\n",(0,r.jsx)(t.h4,{id:"sorting-optional-members-first-or-last",children:"Sorting Optional Members First or Last"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.code,{children:"optionalityOrder"})," option may be enabled to place all optional members in a group at the beginning or end of that group."]}),"\n",(0,r.jsx)(t.p,{children:"This config places all optional members before all required members:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsonc",children:'// .eslintrc.json\n{\n  "rules": {\
1n    "@typescript-eslint/member-ordering": [\n      "error",\n      {\n        "default": {\n          "optionalityOrder": "optional-first",\n          "order": "alphabetically",\n        },\n      },\n    ],\n  },\n}\n'})}),"\n",(0,r.jsxs)(a.A,{children:[(0,r.jsx)(c.A,{value:"\u274C Incorrect",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "default": { "optionalityOrder": "optional-first", "order": "alphabetically" } }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4pmrdoE1KApvsZEA8iL5TIF-FZvxauytGTG1M3lXJ2gXW2IAC31edzJbeEJIdS0AXxSIdPkAXTl01KA"',children:"interface Foo {\n  a: boolean;\n  b?: number;\n  c: string;\n}\n"})})}),(0,r.jsx)(c.A,{value:"\u2705 Correct",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "default": { "optionalityOrder": "optional-first", "order": "alphabetically" } }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4pmrdoE1KApvsZEA8iL5TIF-FZvxauytGTG1M3lXJ2gXW2IAC31edzJbeEJIdS0AXxSIdPkAXTl01KA"',children:"interface Foo {\n  b?: number;\n  a: boolean;\n  c: string;\n}\n"})})})]}),"\n",(0,r.jsx)(t.p,{children:"This config places all required members before all optional members:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsonc",children:'// .eslintrc.json\n{\n  "rules": {\n    "@typescript-eslint/member-ordering": [\n      "error",\n      {\n        "default": {\n          "optionalityOrder": "required-first",\n          "order": "alphabetically",\n        },\n      },\n    ],\n  },\n}\n'})}),"\n",(0,r.jsxs)(a.A,{children:[(0,r.jsx)(c.A,{value:"\u274C Incorrect",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "default": { "optionalityOrder": "required-first", "order": "alphabetically" } }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4pmrdoE1KApvsZEA8iL5SYiAI6xK0RMNq6vyMZqZvKQQqLQLrbEABb6vPiUZLbwhJDqWgC+GRDZ8gC6ctmZQA"',children:"interface Foo {\n  a: boolean;\n  b?: number;\n  c: string;\n}\n"})})}),(0,r.jsx)(c.A,{value:"\u2705 Correct",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'option=\'{ "default": { "optionalityOrder": "required-first", "order": "alphabetically" } }\' eslintrcHash="N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AW0XYCNFpaA9tAAmfZgHN0YANrhsOPtCGQANHPlZ52SKIBmAQwT4pmrdoE1KApvsZEA8iL5SYiAI6xK0RMNq6vyMZqZvKQQqLQLrbEABb6vPiUZLbwhJDqWgC+GRDZ8gC6ctmZQA"',children:"interface Foo {\n  a: boolean;\n  c: string;\n  b?: number;\n}\n"})})})]}),"\n",(0,r.jsx)(t.h2,{id:"all-supported-options",children:"All Supported Options"}),"\n",(0,r.jsx)(t.h3,{id:"member-types-granular-form",children:"Member Types (Granular Form)"}),"\n",(0,r.jsx)(t.p,{children:"There are multiple ways to specify the member types.\nThe most explicit and granular form is the following:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsonc",children:'[\n  // Index signature\n  "signature",\n  "readonly-signature",\n\n  // Fields\n  "public-static-field",\n  "public-static-readonly-field",\n  "protected-static-field",\n  "protected-static-readonly-field",\n  "private-static-field",\n  "private-static-readonly-field",\n  "#private-static-field",\n  "#private-static-readonly-field",\n\n  "public-decorated-field",\n  "public-decorated-readonly-field",\n  "protected-decorated-field",\n  "protected-decorated-readonly-field",\n  "private-decorated-field",\n  "private-decorated-readonly-field",\n\n  "public-instance-field",\n  "public-instance-readonly-field",\n  "protected-instance-field",\n  "protected-instance-readonly-field",\n  "private-instance-field",\n  "private-instance-readonly-field",\n  "#private-instance-field",\n  "#private-instance-readonly-field",\n\n  "public-abstract-field",\n  "public-abstract-readonly-field",\n  "protected-abstract-field",\n  "protected-abstract-readonly-field",\n\n  "public-field",\n  "public-readonly-field",\n  "protected-field",\n  "protected-readonly-field",\n  "private-field",\n  "private-readonly-field",\n  "#private-field",\n  "#private-readonly-field",\n\n  "static-field",\n  "static-readonly-field",\n  "instance-field",\n  "instance-readonly-field",\n  "abstract-field",\n  "abstract-readonly-field",\n\n  "decorated-field",\n  "decorated-readonly-field",\n\n  "field",\n  "readonly-field",\n\n  // Static initialization\n  "static-initialization",\n\n  // Constructors\n  "public-constructor",\n  "protected-constructor",\n  "private-constructor",\n\n  // Getters\n  "public-static-get",\n  "protected-static-get",\n  "private-static-get",\n  "#private-static-get",\n\n  "public-decorated-get",\n  "protected-decorated-get",\n  "private-decorated-get",\n\n  "public-instance-get",\n  "protected-instance-get",\n  "private-instance-get",\n  "#private-instance-get",\n\n  "public-abstract-get",\n  "protected-abstract-get",\n\n  "public-get",\n  "protected-get",\n  "private-get",\n  "#private-get",\n\n  "static-get",\n  "instance-get",\n  "abstract-get",\n\n  "decorated-get",\n\n  "get",\n\n  // Setters\n  "public-static-set",\n  "protected-static-set",\n  "private-static-set",\n  "#private-static-set",\n\n  "public-decorated-set",\n  "protected-decorated-set",\n  "private-decorated-set",\n\n  "public-instance-set",\n  "protected-instance-set",\n  "private-instance-set",\n  "#private-instance-set",\n\n  "public-abstract-set",\n  "protected-abstract-set",\n\n  "public-set",\n  "protected-set",\n  "private-set",\n\n  "static-set",\n  "instance-set",\n  "abstract-set",\n\n  "decorated-set",\n\n  "set",\n\n  // Methods\n  "public-static-method",\n  "protected-static-method",\n  "private-static-method",\n  "#private-static-method",\n  "public-decorated-method",\n  "protected-decorated-method",\n  "private-decorated-method",\n  "public-instance-method",\n  "protected-instance-method",\n  "private-instance-method",\n  "#private-instance-method",\n  "public-abstract-method",\n  "protected-abstract-method",\n]\n'})}),"\n",(0,r.jsx)(t.admonition,{type:"note",children:(0,r.jsx)(t.p,{children:"If you only specify some of the possible types, the non-specified ones can have any particular order.\nThis means that they can be placed before, within or after the specified types and the linter won't complain about it."})}),"\n",(0,r.jsx)(t.h3,{id:"member-group-types-with-accessibility-ignoring-scope",children:"Member Group Types (With Accessibility, Ignoring Scope)"}),"\n",(0,r.jsxs)(t.p,{children:["It is also possible to group member types by their accessibility (",(0,r.jsx)(t.code,{children:"static"}),", ",(0,r.jsx)(t.code,{children:"instance"}),", ",(0,r.jsx)(t.code,{children:"abstract"}),"), ignoring their scope."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsonc",children:'[\n  // Index signature\n  // No accessibility for index signature.\n\n  // Fields\n  "public-field", // = ["public-static-field", "public-instance-field"]\n  "protected-field", // = ["protected-static-field", "protected-instance-field"]\n  "private-field", // = ["private-static-field", "private-instance-field"]\n\n  // Static initialization\n  // No accessibility for static initialization.\n\n  // Constructors\n  // Only the accessibility of constructors is configurable. See below.\n\n  // Getters\n  "public-get", // = ["public-static-get", "public-instance-get"]\n  "protected-get", // = ["protected-static-get", "protected-instance-get"]\n  "private-get", // = ["private-static-get", "private-instance-get"]\n\n  // Setters\n  "public-set", // = ["public-static-set", "public-instance-set"]\n  "protected-set", // = ["protected-static-set", "protected-instance-set"]\n  "private-set", // = ["private-static-set", "private-instance-set"]\n\n  // Methods\n  "public-method", // = ["public-static-method", "public-instance-method"]\n  "protected-method", // = ["protected-static-method", "protected-instance-method"]\n  "private-method", // = ["private-static-method", "private-instance-method"]\n]\n'})}),"\n",(0,r.jsx)(t.h3,{id:"member-group-types-with-accessibility-and-a-decorator",children:"Member Group Types (With Accessibility and a Decorator)"}),"\n",(0,r.jsx)(t.p,{children:"It is also possible to group methods or fields with a decorator separately, optionally specifying\ntheir accessibility."}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsonc",children:'[\n  // Index signature\n  // No decorators for index signature.\n\n  // Fields\n  "public-decorated-field",\n  "protected-decorated-field",\n  "private-decorated-field",\n\n  "decorated-field", // = ["public-decorated-field", "protected-decorated-field", "private-decorated-field"]\n\n  // Static initialization\n  // No decorators for static initialization.\n\n  // Constructors\n  // There are no decorators for constructors.\n\n  // Getters\n  "public-decorated-get",\n  "protected-decorated-get",\n  "private-decorated-get",\n\n  "decorated-get", // = ["public-decorated-get", "protected-decorated-get", "private-decorated-get"]\n\n  // Setters\n  "public-decorated-set",\n  "protected-decorated-set",\n  "private-decorated-set",\n\n  "decorated-set", // = ["public-decorated-set", "protected-decorated-set", "private-decorated-set"]\n\n  // Methods\n  "public-decorated-method",\n  "protected-decorated-method",\n  "private-decorated-method",\n\n  "decorated-method", // = ["public-decorated-method", "protected-decorated-method", "private-decorated-method"]\n]\n'})}),"\n",(0,r.jsx)(t.h3,{id:"member-group-types-with-scope-ignoring-accessibility",children:"Member Group Types (With Scope, Ignoring Accessibility)"}),"\n",(0,r.jsxs)(t.p,{children:["Another option is to group the member types by their scope (",(0,r.jsx)(t.code,{children:"public"}),", ",(0,r.jsx)(t.code,{children:"protected"}),", ",(0,r.jsx)(t.code,{children:"private"}),"), ignoring their accessibility."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsonc",children:'[\n  // Index signature\n  // No scope for index signature.\n\n  // Fields\n  "static-field", // = ["public-static-field", "protected-static-field", "private-static-field"]\n  "instance-field", // = ["public-instance-field", "protected-instance-field", "private-instance-field"]\n  "abstract-field", // = ["public-abstract-field", "protected-abstract-field"]\n\n  // Static initialization\n  // No scope for static initialization.\n\n  // Constructors\n  "constructor", // = ["public-constructor", "protected-constructor", "private-constructor"]\n\n  // Getters\n  "static-get", // = ["public-static-get", "protected-static-get", "private-static-get"]\n  "instance-get", // = ["public-instance-get", "protected-instance-get", "private-instance-get"]\n  "abstract-get", // = ["public-abstract-get", "protected-abstract-get"]\n\n  // Setters\n  "static-set", // = ["public-static-set", "protected-static-set", "private-static-set"]\n  "instance-set", // = ["public-instance-set", "protected-instance-set", "private-instance-set"]\n  "abstract-set", // = ["public-abstract-set", "protected-abstract-set"]\n\n  // Methods\n  "static-method", // = ["public-static-method", "protected-static-method", "private-static-method"]\n  "instance-method", // = ["public-instance-method", "protected-instance-method", "private-instance-method"]\n  "abstract-method", // = ["public-abstract-method", "protected-abstract-method"]\n]\n'})}),"\n",(0,r.jsx)(t.h3,{id:"member-group-types-with-scope-and-accessibility",children:"Member Group Types (With Scope and Accessibility)"}),"\n",(0,r.jsx)(t.p,{children:"The third grouping option is to ignore both scope and accessibility."}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsonc",children:'[\n  // Index signature\n  // No grouping for index signature.\n\n  // Fields\n  "field", // = ["public-static-field", "protected-static-field", "private-static-field", "public-instance-field", "protected-instance-field", "private-instance-field",\n  //              "public-abstract-field", "protected-abstract-field"]\n\n  // Static initialization\n  // No grouping for static initialization.\n\n  // Constructors\n  // Only the accessibility of constructors is configurable.\n\n  // Getters\n  "get", // = ["public-static-get", "protected-static-get", "private-static-get", "public-instance-get", "protected-instance-get", "private-instance-get",\n  //                "public-abstract-get", "protected-abstract-get"]\n\n  // Setters\n  "set", // = ["public-static-set", "protected-static-set", "private-static-set", "public-instance-set", "protected-instance-set", "private-instance-set",\n  //                "public-abstract-set", "protected-abstract-set"]\n\n  // Methods\n  "method", // = ["public-static-method", "protected-static-method", "private-static-method", "public-instance-method", "protected-instance-method", "private-instance-method",\n  //                "public-abstract-method", "protected-abstract-method"]\n]\n'})}),"\n",(0,r.jsx)(t.h3,{id:"member-group-types-readonly-fields",children:"Member Group Types (Readonly Fields)"}),"\n",(0,r.jsxs)(t.p,{children:["It is possible to group fields by their ",(0,r.jsx)(t.code,{children:"readonly"})," modifiers."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsonc",children:'[\n  // Index signature\n  "readonly-signature",\n  "signature",\n\n  // Fields\n  "readonly-field", // = ["public-static-readonly-field", "protected-static-readonly-field", "private-static-readonly-field", "public-instance-readonly-field", "protected-instance-readonly-field", "private-instance-readonly-field", "public-abstract-readonly-field", "protected-abstract-readonly-field"]\n  "field", // = ["public-static-field", "protected-static-field", "private-static-field", "public-instance-field", "protected-instance-field", "private-instance-field", "public-abstract-field", "protected-abstract-field"]\n]\n'})}),"\n",(0,r.jsx)(t.h3,{id:"grouping-different-member-types-at-the-same-rank",children:"Grouping Different Member Types at the Same Rank"}),"\n",(0,r.jsx)(t.p,{children:"It is also possible to group different member types at the same rank."}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-jsonc",children:'[\n  // Index signature\n  "signature",\n\n  // Fields\n  "field",\n\n  // Static initialization\n  "static-initialization",\n\n  // Constructors\n  "constructor",\n\n  // Getters and Setters at the same rank\n  ["get", "set"],\n\n  // Methods\n  "method",\n]\n'})}),"\n",(0,r.jsx)(t.h2,{id:"when-not-to-use-it",children:"When Not To Use It"}),"\n",(0,r.jsx)(t.p,{children:"If you don't care about the general order of your members, then you will not need this rule."}),"\n",(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h2,{id:"resources",children:"Resources"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.a,{href:"https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/rules/member-ordering.ts",children:"Rule source"})}),"\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.a,{href:"https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/tests/rules/member-ordering.test.ts",children:"Test source"})}),"\n"]})]}),"\n",(0,r.jsx)(n,{children:(0,r.jsx)(t.meta,{content:"member-ordering: Require a consistent member declaration order",name:"twitter:image:alt"})})]})}function h(e={}){let{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(u,{...e})}):u(e)}function A(e,t){throw Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},46742(e,t,n){n.d(t,{A:()=>c});var i=n(65723);n(22155);var r=n(70851),s=n(28226);function a({children:e,className:t,hidden:n}){return(0,i.jsx)("div",{role:"tabpanel",className:(0,r.A)("tabItem_eQ9s",t),hidden:n,children:e})}function c({children:e,className:t,value:n}){let{selectedValue:r,lazy:l}=(0,s.uc)(),o=n===r;return!o&&l?null:(0,i.jsx)(a,{className:t,hidden:!o,children:e})}},70503(e,t,n){n.d(t,{A:()=>u});var i=n(65723);n(22155);var r=n(70851),s=n(98838),a=n(28226),c=n(26309),l=n(29021);function o({className:e}
1){let{selectedValue:t,selectValue:n,tabValues:s,block:l}=(0,a.uc)(),d=[],{blockElementScrollPositionUntilNextRender:p}=(0,c.a_)(),u=e=>{let i=e.currentTarget,r=s[d.indexOf(i)].value;r!==t&&(p(i),n(r))},h=e=>{let t=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{let n=d.indexOf(e.currentTarget)+1;t=d[n]??d[0];break}case"ArrowLeft":{let n=d.indexOf(e.currentTarget)-1;t=d[n]??d[d.length-1]}}t?.focus()};return(0,i.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":l},e),children:s.map(({value:e,label:n,attributes:s})=>(0,i.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{d.push(e)},onKeyDown:h,onClick:u,...s,className:(0,r.A)("tabs__item","tabItem_e1w9",s?.className,{"tabs__item--active":t===e}),children:n??e},e))})}function d({children:e}){return(0,i.jsx)("div",{className:"margin-top--md",children:e})}function p({className:e,children:t}){return(0,i.jsxs)("div",{className:(0,r.A)(s.G.tabs.container,"tabs-container","tabList_mVW_"),children:[(0,i.jsx)(o,{className:e}),(0,i.jsx)(d,{children:t})]})}function u(e){let t=(0,l.A)(),n=(0,a.OC)(e);return(0,i.jsx)(a.O_,{value:n,children:(0,i.jsx)(p,{className:e.className,children:(0,a.vT)(e.children)})},String(t))}},28226(e,t,n){n.d(t,{OC:()=>u,O_:()=>g,uc:()=>A,vT:()=>d});var i=n(65723),r=n(22155),s=n(62934),a=n(24127),c=n(12910),l=n(22399),o=n(6660);function d(e){return r.Children.toArray(e).filter(e=>"\n"!==e)}function p({value:e,tabValues:t}){return t.some(t=>t.value===e)}function u(e){let t,{defaultValue:n,queryString:i=!1,groupId:d}=e,u=function(e){let{values:t,children:n}=e;return(0,r.useMemo)(()=>{let e=t??r.Children.toArray(n).flatMap(e=>{if(!e)return[];if((0,r.isValidElement)(e)&&function(e){let{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return[e];let t="string"==typeof e.type?e.type:e.type.name;throw Error(`Docusaurus error: Bad <Tabs> child <${t}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.
2If you do not want to pass on a "value" prop to the direct children of <Tabs>, you can also pass an explicit <Tabs values={...}> prop.`)}).map(({props:{value:e,label:t,attributes:n,default:i}})=>({value:e,label:t,attributes:n,default:i})),i=(0,l.XI)(e,(e,t)=>e.value===t.value);if(i.length>0)throw Error(`Docusaurus error: Duplicate values "${i.map(e=>`'${e.value}'`).join(", ")}" found in <Tabs>. Every value needs to be unique.`);return e},[t,n])}(e),[h,A]=(0,r.useState)(()=>(function({defaultValue:e,tabValues:t}){if(0===t.length)throw Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(e){if(!p({value:e,tabValues:t}))throw Error(`Docusaurus error: The <Tabs> has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${t.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}let n=t.find(e=>e.default)??t[0];if(!n)throw Error("Unexpected error: 0 tabValues");return n.value})({defaultValue:n,tabValues:u})),[g,m]=function({queryString:e=!1,groupId:t}){let n=(0,s.W6)(),i=function({queryString:e=!1,groupId:t}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!t)throw Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:e,groupId:t});return[(0,c.aZ)(i),(0,r.useCallback)(e=>{if(!i)return;let t=new URLSearchParams(n.location.search);t.set(i,e),n.replace({...n.location,search:t.toString()})},[i,n])]}({queryString:i,groupId:d}),[f,b]=function({groupId:e}){let t=e?`docusaurus.tab.${e}`:null,[n,i]=(0,o.Dv)(t);return[n,(0,r.useCallback)(e=>{t&&i.set(e)},[t,i])]}({groupId:d}),x=p({value:t=g??f,tabValues:u})?t:null;return(0,a.A)(()=>{x&&A(x)},[x]),{selectedValue:h,selectValue:(0,r.useCallback)(e=>{if(!p({value:e,tabValues:u}))throw Error(`Can't select invalid tab value=${e}`);A(e),m(e),b(e)},[m,b,u]),tabValues:u,lazy:e.lazy??!1,block:e.block??!1}}let h=(0,r.createContext)(null);function A(){let e=r.useContext(h);if(!e)throw Error("useTabsContext() must be used within a Tabs component");return e}function g(e){return(0,i.jsx)(h.Provider,{value:e.value,children:e.children})}},7143(e,t,n){n.d(t,{R:()=>a,x:()=>c});var i=n(22155);let r={},s=i.createContext(r);function a(e){let t=i.useContext(s);return i.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),i.createElement(s.Provider,{value:t},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.