3.7.72 • Published 11 months ago

@hishprorg/voluptas-consectetur v3.7.72

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

@hishprorg/voluptas-consectetur

Sort Angular and NestJS module imports, declarations, exports, controls, etc. Make it easier to find modules in the arrays by having an auto sort.

Installation

NPM

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install @hishprorg/voluptas-consectetur:

npm install @hishprorg/voluptas-consectetur --save-dev

Usage

Add ng-module-sort to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "ng-module-sort"
    ]
}

Then configure the rules you want to use under the rules section.

Rules

decorator-array-items

With this rule you can detect unsorted arrays of imports, declarations, providers, exports, controllers and bootstrap in the following Angular and NestJS decorators:

  • NgModule
  • Component
  • Pipe
  • Decorator
  • Module
{
    "rules": {
        "ng-module-sort/decorator-array-items": [
            "error", {
                "reverseSort": false
            }
        ]
    }
}

A few example of it:

  • Error
import {Component} from '@angular/core';

@Component({
  selector: 'app-example',
  template: '',
  standalone: true,
  imports: [ // Run `eslint --fix .` to sort the members of imports.
    MatButtonModule,
    SharedModule,
    CommonModule,
    MagicComponent,
  ],
})
  • Fix with default options
import {Component} from '@angular/core';

@Component({
  selector: 'app-example',
  template: '',
  standalone: true,
  imports: [
    CommonModule,
    MagicComponent,
    MatButtonModule,
    SharedModule,
  ],
})
  • With option "reverseSort": true
import {Component} from '@angular/core';

@Component({
  selector: 'app-example',
  template: '',
  standalone: true,
  imports: [
    SharedModule,
    MatButtonModule,
    MagicComponent,
    CommonModule,
  ],
})

decorator-properties

This rule is still in progress, but basically it will check if the properties in the above decorators are sorted, and provide an autofix to sort them.

RegExp#flagscomputed-typesback-endbannerpromiseenvqueryhasOwnPropertyECMAScript 6PushshrinkwrapArrayBuffer.prototype.slicemovepipeless.jstoSortedcallbindsimpledbpredictableaccessorsymbolsinstallindirectorywarningcolourcores3everypreprocessorserializeglaciersyntaxObject.valueshardlinkswidthhookscircularfastcopyECMAScript 3jsxperformanttouchnegative zerodeterministicdirchromiumvalidatorstylespinofront-endchannelentriessliceeslint-plugin.gitignoretestnativefantasy-landmulti-packagegloboffsetgetJSON-SchemabcrypthookformrangeerroramazonautoscalingauthenticationqueueMicrotaskunicodeesTypeBoxio-tsES3bundlerform-validationtacitvalidgroupByserviceinputglobalswhatwgregexpmetadatautilsoptimizerUint8ArrayObject.getPrototypeOfquoteisautoprefixermake dirclientflattenspinnerdomnumbercallboundsameValueZerorequestdescriptorsgetterhttpsString.prototype.matchAlles2016fpcachevpcmockUnderscorepreserve-symlinksjson-schemareduxa11ykinesisbeanstalkoutputwalkvariablessyntaxerrorString.prototype.trimpyyamlvisualweaksetfindLastIndexjsonbootstrap lessES6ArrayrgbstringifyhelperssignalsprotobuffersuperagentkeydragECMAScript 2022ES2015CSSStyleDeclarationserializerdatetrimStartiamsnseslintconfigreal-timebinaryECMAScript 2019higher-ordercloudfrontredactnopeincludesprotocol-bufferstypesafeTypedArrayObject.fromEntriestc39class-validatortypeerrorweakmapbindslotStreamsenvironmentsUint32Arrayassertionelmbddcurltddcall-boundcolumnspeedhandlerflagsRFC-6455propertieslogexit-codefast-deep-copyECMAScript 2021windowserializationpersistentJSONObservableyamlfunctions0gdpr__proto__handlerspoint-freeWeakMapmakestylesheetlesscssec2command-lineStyleSheeteventsreuseObject.definePropertylastArrayBuffercloudsearchArray.prototype.flatMapirqchineseliveECMAScript 2018ESnextvarES5fastclonelrucss variablefastifylinttextsesstringlinuxes2017springimportexportMapES2016file systemcontainsignorecss lesslinkmonorepoexpresssigtermwindowszxFloat32ArrayacornformsloadbalancingjapanesejestclifindLastquerystringopenssloperating-systemtesterPromiseshimnodejspackagesauthglobal objectcompile lessmockingES8takeFloat64ArrayexitmaphashAsyncIteratorstylinggitignoreregular expressiontypanionrequireenvironmentspinnersl10ncsscloudwatchemrStreampatcheast-asian-widthbytebabelimmutablesortxtermvalidatedefinePropertyobjectlistenersreact-componentcreatedataless cssapollobyteOffsetchaifastclassesbrowserslistRxgetintrinsicinternal slotES2017package managerarrayrulesECMAScript 2016browserlibphonenumbergetPrototypeOfloggerpopmotionconfigclonedeepcloneschemaasyncespreees-shimszodrobustswfreadableisConcatSpreadablebusygraphqlReactiveExtensionsviewInt32Arraydeepcopywriteformlockfilecore-jsReflect.getPrototypeOf_.extendObject.isprotobufchromeURLSearchParamsreducersequenceownsetterregexcomparerouteschemepurecolorsscheme-validationidentifierstrimRightbinarieses-abstractargumentjsdifflocalECMAScript 2020progressqueuearktype$.extendfullwidthcollectionsafeextendsidetrimLeftjsdomelasticachebabel-coretoArraysqscryptmixinsES2022check-0ECMAScript 2015astwritableconsoleregular-expressiones8json-schema-validationencryptiondescriptionapitypescriptoptionmkdirpfnmatchperformancethreeinvariantreplayshebangeventDispatcheroptimisttypeofjwtcss nestingworkspace:*trimgradients cssES7speccallbackCSScallrecursive
3.7.72

11 months ago

3.7.71

11 months ago

3.7.70

11 months ago

3.7.69

11 months ago

3.7.68

11 months ago

3.7.67

11 months ago

3.7.66

11 months ago

3.7.65

11 months ago

3.7.64

11 months ago

3.7.63

11 months ago

3.7.62

11 months ago

3.7.61

11 months ago

3.7.60

11 months ago

3.7.59

11 months ago

3.6.59

11 months ago

3.5.59

11 months ago

2.5.59

11 months ago

2.5.58

11 months ago

2.5.57

12 months ago

2.5.56

12 months ago

2.5.55

12 months ago

2.5.54

12 months ago

2.5.53

12 months ago

2.5.52

12 months ago

2.5.51

12 months ago

2.5.50

12 months ago

2.5.49

12 months ago

2.5.48

12 months ago

2.5.47

12 months ago

2.5.46

12 months ago

2.5.45

12 months ago

2.5.44

12 months ago

2.4.44

12 months ago

2.4.43

12 months ago

2.4.42

12 months ago

2.3.42

12 months ago

2.3.41

12 months ago

2.3.40

12 months ago

2.3.39

1 year ago

2.3.38

1 year ago

2.3.37

1 year ago

2.3.36

1 year ago

2.3.35

1 year ago

2.3.34

1 year ago

2.3.33

1 year ago

2.3.32

1 year ago

2.3.31

1 year ago

2.3.30

1 year ago

2.3.29

1 year ago

2.3.28

1 year ago

2.3.27

1 year ago

2.3.26

1 year ago

2.3.25

1 year ago

2.3.24

1 year ago

2.3.23

1 year ago

2.3.22

1 year ago

2.3.21

1 year ago

2.3.20

1 year ago

2.3.19

1 year ago

2.3.18

1 year ago

2.2.18

1 year ago

2.2.17

1 year ago

2.2.16

1 year ago

2.2.15

1 year ago

2.1.15

1 year ago

2.1.14

1 year ago

2.1.13

1 year ago

2.1.12

1 year ago

2.1.11

1 year ago

2.1.10

1 year ago

2.1.9

1 year ago

2.1.8

1 year ago

2.1.7

1 year ago

2.1.6

1 year ago

2.1.5

1 year ago

2.1.4

1 year ago

2.1.3

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago