@konvert7/klint 1.3.1 → 1.4.1
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 +74 -55
- package/klint.schema.json +1434 -607
- package/klint.schema.yaml +1100 -505
- package/package.json +10 -7
package/klint.schema.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://raw.githubusercontent.com/konvert7/klint/refs/tags/v1.
|
|
2
|
+
"$id": "https://raw.githubusercontent.com/konvert7/klint/refs/tags/v1.4.1/klint.schema.json",
|
|
3
3
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
4
|
"additionalProperties": false,
|
|
5
5
|
"description": "klint configuration. Lives at klint.yaml (or klint.config.json) next to biome.json and knip.json.",
|
|
@@ -545,7 +545,7 @@
|
|
|
545
545
|
"type": "array"
|
|
546
546
|
},
|
|
547
547
|
"plugins": {
|
|
548
|
-
"description": "
|
|
548
|
+
"description": "Deprecated (v1): named rule bundles. plugins: [sonar] is replaced by rules.recommended: true — run `klint migrate` to upgrade the config in place. Available: \"sonar\".",
|
|
549
549
|
"items": {
|
|
550
550
|
"enum": [
|
|
551
551
|
"sonar"
|
|
@@ -559,770 +559,1597 @@
|
|
|
559
559
|
"type": "string"
|
|
560
560
|
},
|
|
561
561
|
"rules": {
|
|
562
|
-
"
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
"
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
562
|
+
"anyOf": [
|
|
563
|
+
{
|
|
564
|
+
"additionalProperties": false,
|
|
565
|
+
"description": "v2 format: rule groups.",
|
|
566
|
+
"properties": {
|
|
567
|
+
"core": {
|
|
568
|
+
"additionalProperties": {
|
|
569
|
+
"anyOf": [
|
|
570
|
+
{
|
|
571
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
572
|
+
"enum": [
|
|
573
|
+
"error",
|
|
574
|
+
"warn",
|
|
575
|
+
"off"
|
|
576
|
+
],
|
|
577
|
+
"type": "string"
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
"additionalProperties": false,
|
|
581
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
582
|
+
"properties": {
|
|
583
|
+
"include": {
|
|
584
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
585
|
+
"items": {
|
|
586
|
+
"type": "string"
|
|
587
|
+
},
|
|
588
|
+
"type": "array"
|
|
589
|
+
},
|
|
590
|
+
"severity": {
|
|
591
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
592
|
+
"enum": [
|
|
593
|
+
"error",
|
|
594
|
+
"warn",
|
|
595
|
+
"off",
|
|
596
|
+
null
|
|
597
|
+
],
|
|
598
|
+
"type": "string"
|
|
599
|
+
}
|
|
600
|
+
},
|
|
601
|
+
"type": "object"
|
|
602
|
+
}
|
|
603
|
+
]
|
|
604
|
+
},
|
|
605
|
+
"description": "Built-in rules by name.",
|
|
606
|
+
"properties": {
|
|
607
|
+
"blank-line-after-block": {
|
|
608
|
+
"anyOf": [
|
|
609
|
+
{
|
|
610
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
611
|
+
"enum": [
|
|
612
|
+
"error",
|
|
613
|
+
"warn",
|
|
614
|
+
"off"
|
|
615
|
+
],
|
|
616
|
+
"type": "string"
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
"additionalProperties": false,
|
|
620
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
621
|
+
"properties": {
|
|
622
|
+
"include": {
|
|
623
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
624
|
+
"items": {
|
|
625
|
+
"type": "string"
|
|
626
|
+
},
|
|
627
|
+
"type": "array"
|
|
628
|
+
},
|
|
629
|
+
"severity": {
|
|
630
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
631
|
+
"enum": [
|
|
632
|
+
"error",
|
|
633
|
+
"warn",
|
|
634
|
+
"off",
|
|
635
|
+
null
|
|
636
|
+
],
|
|
637
|
+
"type": "string"
|
|
638
|
+
},
|
|
639
|
+
"statements": {
|
|
640
|
+
"description": "Block statement kinds this rule targets. Defaults to every kind: if, for, while, switch, try, guard, loop, with. match is an alias of switch. return is not a block statement. An empty list turns the rule off.",
|
|
641
|
+
"items": {
|
|
642
|
+
"description": "A block statement kind the rule targets. match is an alias of switch.",
|
|
643
|
+
"enum": [
|
|
644
|
+
"if",
|
|
645
|
+
"for",
|
|
646
|
+
"while",
|
|
647
|
+
"switch",
|
|
648
|
+
"match",
|
|
649
|
+
"try",
|
|
650
|
+
"guard",
|
|
651
|
+
"loop",
|
|
652
|
+
"with"
|
|
653
|
+
],
|
|
654
|
+
"type": "string"
|
|
655
|
+
},
|
|
656
|
+
"type": "array"
|
|
657
|
+
}
|
|
658
|
+
},
|
|
659
|
+
"type": "object"
|
|
660
|
+
}
|
|
661
|
+
],
|
|
662
|
+
"description": "Requires a blank line below a block statement (if, for, while, switch/match, try, guard, loop, with) when another statement follows it in the same block, like C# IDE2003. Works on TypeScript/JavaScript, Python, Swift, Rust and C#; `klint --fix` inserts the line.",
|
|
663
|
+
"examples": [
|
|
664
|
+
"blank-line-after-block: warn",
|
|
665
|
+
"blank-line-after-block:\n severity: warn\n include: [\"src/**\"]\n statements: [if, for, while, switch, try, guard, loop, with]"
|
|
666
|
+
]
|
|
667
|
+
},
|
|
668
|
+
"blank-line-before-control-flow": {
|
|
669
|
+
"anyOf": [
|
|
670
|
+
{
|
|
671
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
672
|
+
"enum": [
|
|
673
|
+
"error",
|
|
674
|
+
"warn",
|
|
675
|
+
"off"
|
|
676
|
+
],
|
|
677
|
+
"type": "string"
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
"additionalProperties": false,
|
|
681
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
682
|
+
"properties": {
|
|
683
|
+
"allowSetup": {
|
|
684
|
+
"description": "Skip an if, guard or switch statement whose condition uses a name assigned by the statement directly above it. Defaults to true.",
|
|
685
|
+
"type": "boolean"
|
|
686
|
+
},
|
|
687
|
+
"include": {
|
|
688
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
689
|
+
"items": {
|
|
690
|
+
"type": "string"
|
|
691
|
+
},
|
|
692
|
+
"type": "array"
|
|
693
|
+
},
|
|
694
|
+
"severity": {
|
|
695
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
696
|
+
"enum": [
|
|
697
|
+
"error",
|
|
698
|
+
"warn",
|
|
699
|
+
"off",
|
|
700
|
+
null
|
|
701
|
+
],
|
|
702
|
+
"type": "string"
|
|
703
|
+
},
|
|
704
|
+
"statements": {
|
|
705
|
+
"description": "Statement kinds this rule targets. Defaults to every kind: if, for, while, switch, try, return, guard, loop, with. match is an alias of switch. An empty list turns the rule off.",
|
|
706
|
+
"items": {
|
|
707
|
+
"description": "A statement kind the rule targets. match is an alias of switch.",
|
|
708
|
+
"enum": [
|
|
709
|
+
"if",
|
|
710
|
+
"for",
|
|
711
|
+
"while",
|
|
712
|
+
"switch",
|
|
713
|
+
"match",
|
|
714
|
+
"try",
|
|
715
|
+
"return",
|
|
716
|
+
"guard",
|
|
717
|
+
"loop",
|
|
718
|
+
"with"
|
|
719
|
+
],
|
|
720
|
+
"type": "string"
|
|
721
|
+
},
|
|
722
|
+
"type": "array"
|
|
723
|
+
}
|
|
724
|
+
},
|
|
725
|
+
"type": "object"
|
|
726
|
+
}
|
|
727
|
+
],
|
|
728
|
+
"description": "Requires a blank line above a control-flow statement (if, for, while, switch/match, try, return, guard, loop, with) that follows another statement in the same block. Works on TypeScript/JavaScript, Python, Swift, Rust and C#; `klint --fix` inserts the line.",
|
|
729
|
+
"examples": [
|
|
730
|
+
"blank-line-before-control-flow: error",
|
|
731
|
+
"blank-line-before-control-flow:\n severity: error\n include: [\"src/**\", \"!src/generated/**\"]\n statements: [if, for, while, switch, try, return, guard, loop, with]\n allowSetup: true"
|
|
732
|
+
]
|
|
581
733
|
},
|
|
582
|
-
"
|
|
734
|
+
"cognitive-complexity": {
|
|
735
|
+
"anyOf": [
|
|
736
|
+
{
|
|
737
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
738
|
+
"enum": [
|
|
739
|
+
"error",
|
|
740
|
+
"warn",
|
|
741
|
+
"off"
|
|
742
|
+
],
|
|
743
|
+
"type": "string"
|
|
744
|
+
},
|
|
745
|
+
{
|
|
746
|
+
"additionalProperties": false,
|
|
747
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
748
|
+
"properties": {
|
|
749
|
+
"include": {
|
|
750
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
751
|
+
"items": {
|
|
752
|
+
"type": "string"
|
|
753
|
+
},
|
|
754
|
+
"type": "array"
|
|
755
|
+
},
|
|
756
|
+
"max": {
|
|
757
|
+
"default": 15,
|
|
758
|
+
"description": "Highest cognitive complexity a function may have; a function scoring above it is reported. An integer of at least 1. Defaults to 15.",
|
|
759
|
+
"format": "uint32",
|
|
760
|
+
"minimum": 1,
|
|
761
|
+
"type": "integer"
|
|
762
|
+
},
|
|
763
|
+
"severity": {
|
|
764
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
765
|
+
"enum": [
|
|
766
|
+
"error",
|
|
767
|
+
"warn",
|
|
768
|
+
"off",
|
|
769
|
+
null
|
|
770
|
+
],
|
|
771
|
+
"type": "string"
|
|
772
|
+
}
|
|
773
|
+
},
|
|
774
|
+
"type": "object"
|
|
775
|
+
}
|
|
776
|
+
],
|
|
777
|
+
"description": "Reports every function whose cognitive complexity is above `max` (default 15), scored like `eslint-plugin-sonarjs` 3.0.5's `cognitive-complexity` (SonarSource rule S3776). Works on TypeScript/JavaScript, Python, Swift, Rust and C#. Opt-in; no autofix.",
|
|
778
|
+
"examples": [
|
|
779
|
+
"cognitive-complexity: error",
|
|
780
|
+
"cognitive-complexity:\n severity: warn\n include: [\"src/**\", \"!src/generated/**\"]\n max: 14"
|
|
781
|
+
]
|
|
782
|
+
},
|
|
783
|
+
"function-length": {
|
|
784
|
+
"anyOf": [
|
|
785
|
+
{
|
|
786
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
787
|
+
"enum": [
|
|
788
|
+
"error",
|
|
789
|
+
"warn",
|
|
790
|
+
"off"
|
|
791
|
+
],
|
|
792
|
+
"type": "string"
|
|
793
|
+
},
|
|
794
|
+
{
|
|
795
|
+
"additionalProperties": false,
|
|
796
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
797
|
+
"properties": {
|
|
798
|
+
"include": {
|
|
799
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
800
|
+
"items": {
|
|
801
|
+
"type": "string"
|
|
802
|
+
},
|
|
803
|
+
"type": "array"
|
|
804
|
+
},
|
|
805
|
+
"max": {
|
|
806
|
+
"default": 50,
|
|
807
|
+
"description": "Highest number of lines a function body may have; a function counting more is reported. An integer of at least 1. Defaults to 50.",
|
|
808
|
+
"format": "uint32",
|
|
809
|
+
"minimum": 1,
|
|
810
|
+
"type": "integer"
|
|
811
|
+
},
|
|
812
|
+
"severity": {
|
|
813
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
814
|
+
"enum": [
|
|
815
|
+
"error",
|
|
816
|
+
"warn",
|
|
817
|
+
"off",
|
|
818
|
+
null
|
|
819
|
+
],
|
|
820
|
+
"type": "string"
|
|
821
|
+
},
|
|
822
|
+
"skipBlankLines": {
|
|
823
|
+
"default": false,
|
|
824
|
+
"description": "Leave blank lines out of the count. Defaults to false.",
|
|
825
|
+
"type": "boolean"
|
|
826
|
+
}
|
|
827
|
+
},
|
|
828
|
+
"type": "object"
|
|
829
|
+
}
|
|
830
|
+
],
|
|
831
|
+
"description": "Reports every function whose body has more than `max` lines (default 50), counted like Biome 2.6.5's `noExcessiveLinesPerFunction`: brace lines do not count, comment and blank lines do (blank lines not with `skipBlankLines`), and a nested function's lines count toward its parent. Getters and setters are not checked. Works on TypeScript/JavaScript, Python, Swift, Rust and C#. Opt-in; no autofix.",
|
|
832
|
+
"examples": [
|
|
833
|
+
"function-length: error",
|
|
834
|
+
"function-length:\n severity: warn\n include: [\"src/**\", \"!src/generated/**\"]\n max: 40\n skipBlankLines: true"
|
|
835
|
+
]
|
|
836
|
+
},
|
|
837
|
+
"no-async-predicate": {
|
|
838
|
+
"anyOf": [
|
|
839
|
+
{
|
|
840
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
841
|
+
"enum": [
|
|
842
|
+
"error",
|
|
843
|
+
"warn",
|
|
844
|
+
"off"
|
|
845
|
+
],
|
|
846
|
+
"type": "string"
|
|
847
|
+
},
|
|
848
|
+
{
|
|
849
|
+
"additionalProperties": false,
|
|
850
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
851
|
+
"properties": {
|
|
852
|
+
"include": {
|
|
853
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
854
|
+
"items": {
|
|
855
|
+
"type": "string"
|
|
856
|
+
},
|
|
857
|
+
"type": "array"
|
|
858
|
+
},
|
|
859
|
+
"severity": {
|
|
860
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
861
|
+
"enum": [
|
|
862
|
+
"error",
|
|
863
|
+
"warn",
|
|
864
|
+
"off",
|
|
865
|
+
null
|
|
866
|
+
],
|
|
867
|
+
"type": "string"
|
|
868
|
+
}
|
|
869
|
+
},
|
|
870
|
+
"type": "object"
|
|
871
|
+
}
|
|
872
|
+
],
|
|
873
|
+
"description": "Flags `async` functions passed to `.filter`/`.some`/`.every`/`.find`/`.findIndex`. Array methods coerce the returned promise to truthy, so every element appears to match.",
|
|
874
|
+
"examples": [
|
|
875
|
+
"no-async-predicate: error"
|
|
876
|
+
]
|
|
877
|
+
},
|
|
878
|
+
"no-consecutive-array-push": {
|
|
879
|
+
"anyOf": [
|
|
880
|
+
{
|
|
881
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
882
|
+
"enum": [
|
|
883
|
+
"error",
|
|
884
|
+
"warn",
|
|
885
|
+
"off"
|
|
886
|
+
],
|
|
887
|
+
"type": "string"
|
|
888
|
+
},
|
|
889
|
+
{
|
|
890
|
+
"additionalProperties": false,
|
|
891
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
892
|
+
"properties": {
|
|
893
|
+
"include": {
|
|
894
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
895
|
+
"items": {
|
|
896
|
+
"type": "string"
|
|
897
|
+
},
|
|
898
|
+
"type": "array"
|
|
899
|
+
},
|
|
900
|
+
"severity": {
|
|
901
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
902
|
+
"enum": [
|
|
903
|
+
"error",
|
|
904
|
+
"warn",
|
|
905
|
+
"off",
|
|
906
|
+
null
|
|
907
|
+
],
|
|
908
|
+
"type": "string"
|
|
909
|
+
}
|
|
910
|
+
},
|
|
911
|
+
"type": "object"
|
|
912
|
+
}
|
|
913
|
+
],
|
|
914
|
+
"description": "Flags consecutive `arr.push(x); arr.push(y);` calls — combine into `arr.push(x, y)` or `arr.push(...items)`.",
|
|
915
|
+
"examples": [
|
|
916
|
+
"no-consecutive-array-push: warn"
|
|
917
|
+
]
|
|
918
|
+
},
|
|
919
|
+
"no-nested-template-literals": {
|
|
920
|
+
"anyOf": [
|
|
921
|
+
{
|
|
922
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
923
|
+
"enum": [
|
|
924
|
+
"error",
|
|
925
|
+
"warn",
|
|
926
|
+
"off"
|
|
927
|
+
],
|
|
928
|
+
"type": "string"
|
|
929
|
+
},
|
|
930
|
+
{
|
|
931
|
+
"additionalProperties": false,
|
|
932
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
933
|
+
"properties": {
|
|
934
|
+
"include": {
|
|
935
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
936
|
+
"items": {
|
|
937
|
+
"type": "string"
|
|
938
|
+
},
|
|
939
|
+
"type": "array"
|
|
940
|
+
},
|
|
941
|
+
"severity": {
|
|
942
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
943
|
+
"enum": [
|
|
944
|
+
"error",
|
|
945
|
+
"warn",
|
|
946
|
+
"off",
|
|
947
|
+
null
|
|
948
|
+
],
|
|
949
|
+
"type": "string"
|
|
950
|
+
}
|
|
951
|
+
},
|
|
952
|
+
"type": "object"
|
|
953
|
+
}
|
|
954
|
+
],
|
|
955
|
+
"description": "Flags template literals nested inside template literals — almost always unreadable; extract to a variable.",
|
|
956
|
+
"examples": [
|
|
957
|
+
"no-nested-template-literals: warn"
|
|
958
|
+
]
|
|
959
|
+
},
|
|
960
|
+
"no-string-match": {
|
|
961
|
+
"anyOf": [
|
|
962
|
+
{
|
|
963
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
964
|
+
"enum": [
|
|
965
|
+
"error",
|
|
966
|
+
"warn",
|
|
967
|
+
"off"
|
|
968
|
+
],
|
|
969
|
+
"type": "string"
|
|
970
|
+
},
|
|
971
|
+
{
|
|
972
|
+
"additionalProperties": false,
|
|
973
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
974
|
+
"properties": {
|
|
975
|
+
"include": {
|
|
976
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
977
|
+
"items": {
|
|
978
|
+
"type": "string"
|
|
979
|
+
},
|
|
980
|
+
"type": "array"
|
|
981
|
+
},
|
|
982
|
+
"severity": {
|
|
983
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
984
|
+
"enum": [
|
|
985
|
+
"error",
|
|
986
|
+
"warn",
|
|
987
|
+
"off",
|
|
988
|
+
null
|
|
989
|
+
],
|
|
990
|
+
"type": "string"
|
|
991
|
+
}
|
|
992
|
+
},
|
|
993
|
+
"type": "object"
|
|
994
|
+
}
|
|
995
|
+
],
|
|
996
|
+
"description": "Flags `String#match` — prefer `.matchAll()` for iteration or `.test()` for boolean checks. `.match()` returns different shapes depending on the `/g` flag.",
|
|
997
|
+
"examples": [
|
|
998
|
+
"no-string-match: error"
|
|
999
|
+
]
|
|
1000
|
+
},
|
|
1001
|
+
"no-sync-in-async": {
|
|
1002
|
+
"anyOf": [
|
|
1003
|
+
{
|
|
1004
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1005
|
+
"enum": [
|
|
1006
|
+
"error",
|
|
1007
|
+
"warn",
|
|
1008
|
+
"off"
|
|
1009
|
+
],
|
|
1010
|
+
"type": "string"
|
|
1011
|
+
},
|
|
1012
|
+
{
|
|
1013
|
+
"additionalProperties": false,
|
|
1014
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
1015
|
+
"properties": {
|
|
1016
|
+
"include": {
|
|
1017
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1018
|
+
"items": {
|
|
1019
|
+
"type": "string"
|
|
1020
|
+
},
|
|
1021
|
+
"type": "array"
|
|
1022
|
+
},
|
|
1023
|
+
"severity": {
|
|
1024
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1025
|
+
"enum": [
|
|
1026
|
+
"error",
|
|
1027
|
+
"warn",
|
|
1028
|
+
"off",
|
|
1029
|
+
null
|
|
1030
|
+
],
|
|
1031
|
+
"type": "string"
|
|
1032
|
+
}
|
|
1033
|
+
},
|
|
1034
|
+
"type": "object"
|
|
1035
|
+
}
|
|
1036
|
+
],
|
|
1037
|
+
"description": "Flags synchronous I/O (`readFileSync`, `execSync`, etc.) inside async functions — blocks the event loop when an async equivalent is available.",
|
|
1038
|
+
"examples": [
|
|
1039
|
+
"no-sync-in-async: error",
|
|
1040
|
+
"no-sync-in-async:\n severity: warn\n include: [\"src/server/**\"]"
|
|
1041
|
+
]
|
|
1042
|
+
},
|
|
1043
|
+
"no-unguarded-json-parse": {
|
|
1044
|
+
"anyOf": [
|
|
1045
|
+
{
|
|
1046
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1047
|
+
"enum": [
|
|
1048
|
+
"error",
|
|
1049
|
+
"warn",
|
|
1050
|
+
"off"
|
|
1051
|
+
],
|
|
1052
|
+
"type": "string"
|
|
1053
|
+
},
|
|
1054
|
+
{
|
|
1055
|
+
"additionalProperties": false,
|
|
1056
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
1057
|
+
"properties": {
|
|
1058
|
+
"include": {
|
|
1059
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1060
|
+
"items": {
|
|
1061
|
+
"type": "string"
|
|
1062
|
+
},
|
|
1063
|
+
"type": "array"
|
|
1064
|
+
},
|
|
1065
|
+
"severity": {
|
|
1066
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1067
|
+
"enum": [
|
|
1068
|
+
"error",
|
|
1069
|
+
"warn",
|
|
1070
|
+
"off",
|
|
1071
|
+
null
|
|
1072
|
+
],
|
|
1073
|
+
"type": "string"
|
|
1074
|
+
}
|
|
1075
|
+
},
|
|
1076
|
+
"type": "object"
|
|
1077
|
+
}
|
|
1078
|
+
],
|
|
1079
|
+
"description": "Flags `JSON.parse()` calls that aren't wrapped in try/catch — malformed input crashes the process.",
|
|
1080
|
+
"examples": [
|
|
1081
|
+
"no-unguarded-json-parse: error"
|
|
1082
|
+
]
|
|
1083
|
+
}
|
|
583
1084
|
},
|
|
584
|
-
"
|
|
1085
|
+
"type": "object"
|
|
1086
|
+
},
|
|
1087
|
+
"recommended": {
|
|
1088
|
+
"default": false,
|
|
1089
|
+
"description": "true enables the six sonar rules at error, as plugins: [sonar] did.",
|
|
1090
|
+
"type": "boolean"
|
|
1091
|
+
},
|
|
1092
|
+
"sonar": {
|
|
1093
|
+
"additionalProperties": {
|
|
1094
|
+
"anyOf": [
|
|
1095
|
+
{
|
|
1096
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1097
|
+
"enum": [
|
|
1098
|
+
"error",
|
|
1099
|
+
"warn",
|
|
1100
|
+
"off"
|
|
1101
|
+
],
|
|
1102
|
+
"type": "string"
|
|
1103
|
+
},
|
|
1104
|
+
{
|
|
1105
|
+
"additionalProperties": false,
|
|
1106
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
1107
|
+
"properties": {
|
|
1108
|
+
"include": {
|
|
1109
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1110
|
+
"items": {
|
|
1111
|
+
"type": "string"
|
|
1112
|
+
},
|
|
1113
|
+
"type": "array"
|
|
1114
|
+
},
|
|
1115
|
+
"severity": {
|
|
1116
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1117
|
+
"enum": [
|
|
1118
|
+
"error",
|
|
1119
|
+
"warn",
|
|
1120
|
+
"off",
|
|
1121
|
+
null
|
|
1122
|
+
],
|
|
1123
|
+
"type": "string"
|
|
1124
|
+
}
|
|
1125
|
+
},
|
|
1126
|
+
"type": "object"
|
|
1127
|
+
}
|
|
1128
|
+
]
|
|
1129
|
+
},
|
|
1130
|
+
"description": "Sonar rules without the sonar/ prefix.",
|
|
1131
|
+
"properties": {
|
|
1132
|
+
"no-single-char-class": {
|
|
1133
|
+
"anyOf": [
|
|
1134
|
+
{
|
|
1135
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1136
|
+
"enum": [
|
|
1137
|
+
"error",
|
|
1138
|
+
"warn",
|
|
1139
|
+
"off"
|
|
1140
|
+
],
|
|
1141
|
+
"type": "string"
|
|
1142
|
+
},
|
|
1143
|
+
{
|
|
1144
|
+
"additionalProperties": false,
|
|
1145
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
1146
|
+
"properties": {
|
|
1147
|
+
"include": {
|
|
1148
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1149
|
+
"items": {
|
|
1150
|
+
"type": "string"
|
|
1151
|
+
},
|
|
1152
|
+
"type": "array"
|
|
1153
|
+
},
|
|
1154
|
+
"severity": {
|
|
1155
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1156
|
+
"enum": [
|
|
1157
|
+
"error",
|
|
1158
|
+
"warn",
|
|
1159
|
+
"off",
|
|
1160
|
+
null
|
|
1161
|
+
],
|
|
1162
|
+
"type": "string"
|
|
1163
|
+
}
|
|
1164
|
+
},
|
|
1165
|
+
"type": "object"
|
|
1166
|
+
}
|
|
1167
|
+
],
|
|
1168
|
+
"description": "Flags single-character character classes in regex (e.g. `/[a]/`) — drop the brackets; the regex matches the same.",
|
|
1169
|
+
"examples": [
|
|
1170
|
+
"sonar/no-single-char-class: warn"
|
|
1171
|
+
]
|
|
1172
|
+
},
|
|
1173
|
+
"prefer-at": {
|
|
1174
|
+
"anyOf": [
|
|
1175
|
+
{
|
|
1176
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1177
|
+
"enum": [
|
|
1178
|
+
"error",
|
|
1179
|
+
"warn",
|
|
1180
|
+
"off"
|
|
1181
|
+
],
|
|
1182
|
+
"type": "string"
|
|
1183
|
+
},
|
|
1184
|
+
{
|
|
1185
|
+
"additionalProperties": false,
|
|
1186
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
1187
|
+
"properties": {
|
|
1188
|
+
"include": {
|
|
1189
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1190
|
+
"items": {
|
|
1191
|
+
"type": "string"
|
|
1192
|
+
},
|
|
1193
|
+
"type": "array"
|
|
1194
|
+
},
|
|
1195
|
+
"severity": {
|
|
1196
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1197
|
+
"enum": [
|
|
1198
|
+
"error",
|
|
1199
|
+
"warn",
|
|
1200
|
+
"off",
|
|
1201
|
+
null
|
|
1202
|
+
],
|
|
1203
|
+
"type": "string"
|
|
1204
|
+
}
|
|
1205
|
+
},
|
|
1206
|
+
"type": "object"
|
|
1207
|
+
}
|
|
1208
|
+
],
|
|
1209
|
+
"description": "Flags negative-index access via `arr[arr.length - 1]` — `.at(-1)` reads cleaner for last-element access.",
|
|
1210
|
+
"examples": [
|
|
1211
|
+
"sonar/prefer-at: warn"
|
|
1212
|
+
]
|
|
1213
|
+
},
|
|
1214
|
+
"prefer-nullish-coalescing-assign": {
|
|
1215
|
+
"anyOf": [
|
|
1216
|
+
{
|
|
1217
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1218
|
+
"enum": [
|
|
1219
|
+
"error",
|
|
1220
|
+
"warn",
|
|
1221
|
+
"off"
|
|
1222
|
+
],
|
|
1223
|
+
"type": "string"
|
|
1224
|
+
},
|
|
1225
|
+
{
|
|
1226
|
+
"additionalProperties": false,
|
|
1227
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
1228
|
+
"properties": {
|
|
1229
|
+
"include": {
|
|
1230
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1231
|
+
"items": {
|
|
1232
|
+
"type": "string"
|
|
1233
|
+
},
|
|
1234
|
+
"type": "array"
|
|
1235
|
+
},
|
|
1236
|
+
"severity": {
|
|
1237
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1238
|
+
"enum": [
|
|
1239
|
+
"error",
|
|
1240
|
+
"warn",
|
|
1241
|
+
"off",
|
|
1242
|
+
null
|
|
1243
|
+
],
|
|
1244
|
+
"type": "string"
|
|
1245
|
+
}
|
|
1246
|
+
},
|
|
1247
|
+
"type": "object"
|
|
1248
|
+
}
|
|
1249
|
+
],
|
|
1250
|
+
"description": "Flags explicit nullish assignment guards — `x ??= y` is the dedicated nullish assignment operator.",
|
|
1251
|
+
"examples": [
|
|
1252
|
+
"sonar/prefer-nullish-coalescing-assign: warn"
|
|
1253
|
+
]
|
|
1254
|
+
},
|
|
1255
|
+
"prefer-string-raw": {
|
|
1256
|
+
"anyOf": [
|
|
1257
|
+
{
|
|
1258
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1259
|
+
"enum": [
|
|
1260
|
+
"error",
|
|
1261
|
+
"warn",
|
|
1262
|
+
"off"
|
|
1263
|
+
],
|
|
1264
|
+
"type": "string"
|
|
1265
|
+
},
|
|
1266
|
+
{
|
|
1267
|
+
"additionalProperties": false,
|
|
1268
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
1269
|
+
"properties": {
|
|
1270
|
+
"include": {
|
|
1271
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1272
|
+
"items": {
|
|
1273
|
+
"type": "string"
|
|
1274
|
+
},
|
|
1275
|
+
"type": "array"
|
|
1276
|
+
},
|
|
1277
|
+
"severity": {
|
|
1278
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1279
|
+
"enum": [
|
|
1280
|
+
"error",
|
|
1281
|
+
"warn",
|
|
1282
|
+
"off",
|
|
1283
|
+
null
|
|
1284
|
+
],
|
|
1285
|
+
"type": "string"
|
|
1286
|
+
}
|
|
1287
|
+
},
|
|
1288
|
+
"type": "object"
|
|
1289
|
+
}
|
|
1290
|
+
],
|
|
1291
|
+
"description": "Flags string literals with multiple backslash escapes — `String.raw` is more readable (Windows paths, regex source, etc.).",
|
|
1292
|
+
"examples": [
|
|
1293
|
+
"sonar/prefer-string-raw: warn"
|
|
1294
|
+
]
|
|
1295
|
+
},
|
|
1296
|
+
"prefer-string-raw-regexp": {
|
|
1297
|
+
"anyOf": [
|
|
1298
|
+
{
|
|
1299
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1300
|
+
"enum": [
|
|
1301
|
+
"error",
|
|
1302
|
+
"warn",
|
|
1303
|
+
"off"
|
|
1304
|
+
],
|
|
1305
|
+
"type": "string"
|
|
1306
|
+
},
|
|
1307
|
+
{
|
|
1308
|
+
"additionalProperties": false,
|
|
1309
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
1310
|
+
"properties": {
|
|
1311
|
+
"include": {
|
|
1312
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1313
|
+
"items": {
|
|
1314
|
+
"type": "string"
|
|
1315
|
+
},
|
|
1316
|
+
"type": "array"
|
|
1317
|
+
},
|
|
1318
|
+
"severity": {
|
|
1319
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1320
|
+
"enum": [
|
|
1321
|
+
"error",
|
|
1322
|
+
"warn",
|
|
1323
|
+
"off",
|
|
1324
|
+
null
|
|
1325
|
+
],
|
|
1326
|
+
"type": "string"
|
|
1327
|
+
}
|
|
1328
|
+
},
|
|
1329
|
+
"type": "object"
|
|
1330
|
+
}
|
|
1331
|
+
],
|
|
1332
|
+
"description": "Flags regex literals built from escape-heavy string concatenation — `String.raw` drops the double backslashes.",
|
|
1333
|
+
"examples": [
|
|
1334
|
+
"sonar/prefer-string-raw-regexp: warn"
|
|
1335
|
+
]
|
|
1336
|
+
},
|
|
1337
|
+
"prefer-string-replaceall": {
|
|
1338
|
+
"anyOf": [
|
|
1339
|
+
{
|
|
1340
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1341
|
+
"enum": [
|
|
1342
|
+
"error",
|
|
1343
|
+
"warn",
|
|
1344
|
+
"off"
|
|
1345
|
+
],
|
|
1346
|
+
"type": "string"
|
|
1347
|
+
},
|
|
1348
|
+
{
|
|
1349
|
+
"additionalProperties": false,
|
|
1350
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
1351
|
+
"properties": {
|
|
1352
|
+
"include": {
|
|
1353
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1354
|
+
"items": {
|
|
1355
|
+
"type": "string"
|
|
1356
|
+
},
|
|
1357
|
+
"type": "array"
|
|
1358
|
+
},
|
|
1359
|
+
"severity": {
|
|
1360
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1361
|
+
"enum": [
|
|
1362
|
+
"error",
|
|
1363
|
+
"warn",
|
|
1364
|
+
"off",
|
|
1365
|
+
null
|
|
1366
|
+
],
|
|
1367
|
+
"type": "string"
|
|
1368
|
+
}
|
|
1369
|
+
},
|
|
1370
|
+
"type": "object"
|
|
1371
|
+
}
|
|
1372
|
+
],
|
|
1373
|
+
"description": "Flags `.replace(/x/g, y)` on strings — `.replaceAll('x', y)` is clearer and faster for all-occurrence replacements.",
|
|
1374
|
+
"examples": [
|
|
1375
|
+
"sonar/prefer-string-replaceall: error"
|
|
1376
|
+
]
|
|
1377
|
+
}
|
|
1378
|
+
},
|
|
1379
|
+
"type": "object"
|
|
1380
|
+
}
|
|
1381
|
+
},
|
|
1382
|
+
"type": "object"
|
|
1383
|
+
},
|
|
1384
|
+
{
|
|
1385
|
+
"additionalProperties": {
|
|
1386
|
+
"anyOf": [
|
|
1387
|
+
{
|
|
585
1388
|
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
586
1389
|
"enum": [
|
|
587
1390
|
"error",
|
|
588
1391
|
"warn",
|
|
589
|
-
"off"
|
|
590
|
-
null
|
|
1392
|
+
"off"
|
|
591
1393
|
],
|
|
592
1394
|
"type": "string"
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
605
|
-
"enum": [
|
|
606
|
-
"error",
|
|
607
|
-
"warn",
|
|
608
|
-
"off"
|
|
609
|
-
],
|
|
610
|
-
"type": "string"
|
|
611
|
-
},
|
|
612
|
-
{
|
|
613
|
-
"additionalProperties": false,
|
|
614
|
-
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
615
|
-
"properties": {
|
|
616
|
-
"include": {
|
|
617
|
-
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
618
|
-
"items": {
|
|
619
|
-
"type": "string"
|
|
1395
|
+
},
|
|
1396
|
+
{
|
|
1397
|
+
"additionalProperties": false,
|
|
1398
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
1399
|
+
"properties": {
|
|
1400
|
+
"include": {
|
|
1401
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1402
|
+
"items": {
|
|
1403
|
+
"type": "string"
|
|
1404
|
+
},
|
|
1405
|
+
"type": "array"
|
|
620
1406
|
},
|
|
621
|
-
"
|
|
1407
|
+
"severity": {
|
|
1408
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1409
|
+
"enum": [
|
|
1410
|
+
"error",
|
|
1411
|
+
"warn",
|
|
1412
|
+
"off",
|
|
1413
|
+
null
|
|
1414
|
+
],
|
|
1415
|
+
"type": "string"
|
|
1416
|
+
}
|
|
622
1417
|
},
|
|
623
|
-
"
|
|
1418
|
+
"type": "object"
|
|
1419
|
+
}
|
|
1420
|
+
]
|
|
1421
|
+
},
|
|
1422
|
+
"description": "v1 format (deprecated): flat map of rule name → severity or options, sonar rules prefixed with sonar/. Run `klint migrate` to upgrade it to rules.recommended / rules.core / rules.sonar.",
|
|
1423
|
+
"properties": {
|
|
1424
|
+
"blank-line-after-block": {
|
|
1425
|
+
"anyOf": [
|
|
1426
|
+
{
|
|
624
1427
|
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
625
1428
|
"enum": [
|
|
626
1429
|
"error",
|
|
627
1430
|
"warn",
|
|
628
|
-
"off"
|
|
629
|
-
null
|
|
1431
|
+
"off"
|
|
630
1432
|
],
|
|
631
1433
|
"type": "string"
|
|
632
1434
|
},
|
|
633
|
-
|
|
634
|
-
"
|
|
635
|
-
"
|
|
636
|
-
|
|
637
|
-
"
|
|
638
|
-
"
|
|
639
|
-
"
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
"
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
"
|
|
646
|
-
"
|
|
647
|
-
|
|
648
|
-
|
|
1435
|
+
{
|
|
1436
|
+
"additionalProperties": false,
|
|
1437
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
1438
|
+
"properties": {
|
|
1439
|
+
"include": {
|
|
1440
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1441
|
+
"items": {
|
|
1442
|
+
"type": "string"
|
|
1443
|
+
},
|
|
1444
|
+
"type": "array"
|
|
1445
|
+
},
|
|
1446
|
+
"severity": {
|
|
1447
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1448
|
+
"enum": [
|
|
1449
|
+
"error",
|
|
1450
|
+
"warn",
|
|
1451
|
+
"off",
|
|
1452
|
+
null
|
|
1453
|
+
],
|
|
1454
|
+
"type": "string"
|
|
1455
|
+
},
|
|
1456
|
+
"statements": {
|
|
1457
|
+
"description": "Block statement kinds this rule targets. Defaults to every kind: if, for, while, switch, try, guard, loop, with. match is an alias of switch. return is not a block statement. An empty list turns the rule off.",
|
|
1458
|
+
"items": {
|
|
1459
|
+
"description": "A block statement kind the rule targets. match is an alias of switch.",
|
|
1460
|
+
"enum": [
|
|
1461
|
+
"if",
|
|
1462
|
+
"for",
|
|
1463
|
+
"while",
|
|
1464
|
+
"switch",
|
|
1465
|
+
"match",
|
|
1466
|
+
"try",
|
|
1467
|
+
"guard",
|
|
1468
|
+
"loop",
|
|
1469
|
+
"with"
|
|
1470
|
+
],
|
|
1471
|
+
"type": "string"
|
|
1472
|
+
},
|
|
1473
|
+
"type": "array"
|
|
1474
|
+
}
|
|
649
1475
|
},
|
|
650
|
-
"type": "
|
|
1476
|
+
"type": "object"
|
|
651
1477
|
}
|
|
652
|
-
},
|
|
653
|
-
"type": "object"
|
|
654
|
-
}
|
|
655
|
-
],
|
|
656
|
-
"description": "Requires a blank line below a block statement (if, for, while, switch/match, try, guard, loop, with) when another statement follows it in the same block, like C# IDE2003. Works on TypeScript/JavaScript, Python, Swift, Rust and C#; `klint --fix` inserts the line.",
|
|
657
|
-
"examples": [
|
|
658
|
-
"blank-line-after-block: warn",
|
|
659
|
-
"blank-line-after-block:\n severity: warn\n include: [\"src/**\"]\n statements: [if, for, while, switch, try, guard, loop, with]"
|
|
660
|
-
]
|
|
661
|
-
},
|
|
662
|
-
"blank-line-before-control-flow": {
|
|
663
|
-
"anyOf": [
|
|
664
|
-
{
|
|
665
|
-
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
666
|
-
"enum": [
|
|
667
|
-
"error",
|
|
668
|
-
"warn",
|
|
669
|
-
"off"
|
|
670
1478
|
],
|
|
671
|
-
"
|
|
1479
|
+
"description": "Requires a blank line below a block statement (if, for, while, switch/match, try, guard, loop, with) when another statement follows it in the same block, like C# IDE2003. Works on TypeScript/JavaScript, Python, Swift, Rust and C#; `klint --fix` inserts the line.",
|
|
1480
|
+
"examples": [
|
|
1481
|
+
"blank-line-after-block: warn",
|
|
1482
|
+
"blank-line-after-block:\n severity: warn\n include: [\"src/**\"]\n statements: [if, for, while, switch, try, guard, loop, with]"
|
|
1483
|
+
]
|
|
672
1484
|
},
|
|
673
|
-
{
|
|
674
|
-
"
|
|
675
|
-
|
|
676
|
-
"properties": {
|
|
677
|
-
"allowSetup": {
|
|
678
|
-
"description": "Skip an if, guard or switch statement whose condition uses a name assigned by the statement directly above it. Defaults to true.",
|
|
679
|
-
"type": "boolean"
|
|
680
|
-
},
|
|
681
|
-
"include": {
|
|
682
|
-
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
683
|
-
"items": {
|
|
684
|
-
"type": "string"
|
|
685
|
-
},
|
|
686
|
-
"type": "array"
|
|
687
|
-
},
|
|
688
|
-
"severity": {
|
|
1485
|
+
"blank-line-before-control-flow": {
|
|
1486
|
+
"anyOf": [
|
|
1487
|
+
{
|
|
689
1488
|
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
690
1489
|
"enum": [
|
|
691
1490
|
"error",
|
|
692
1491
|
"warn",
|
|
693
|
-
"off"
|
|
694
|
-
null
|
|
1492
|
+
"off"
|
|
695
1493
|
],
|
|
696
1494
|
"type": "string"
|
|
697
1495
|
},
|
|
698
|
-
|
|
699
|
-
"
|
|
700
|
-
"
|
|
701
|
-
|
|
702
|
-
"
|
|
703
|
-
"if",
|
|
704
|
-
"
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
"
|
|
708
|
-
"
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
"
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
1496
|
+
{
|
|
1497
|
+
"additionalProperties": false,
|
|
1498
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
1499
|
+
"properties": {
|
|
1500
|
+
"allowSetup": {
|
|
1501
|
+
"description": "Skip an if, guard or switch statement whose condition uses a name assigned by the statement directly above it. Defaults to true.",
|
|
1502
|
+
"type": "boolean"
|
|
1503
|
+
},
|
|
1504
|
+
"include": {
|
|
1505
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1506
|
+
"items": {
|
|
1507
|
+
"type": "string"
|
|
1508
|
+
},
|
|
1509
|
+
"type": "array"
|
|
1510
|
+
},
|
|
1511
|
+
"severity": {
|
|
1512
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1513
|
+
"enum": [
|
|
1514
|
+
"error",
|
|
1515
|
+
"warn",
|
|
1516
|
+
"off",
|
|
1517
|
+
null
|
|
1518
|
+
],
|
|
1519
|
+
"type": "string"
|
|
1520
|
+
},
|
|
1521
|
+
"statements": {
|
|
1522
|
+
"description": "Statement kinds this rule targets. Defaults to every kind: if, for, while, switch, try, return, guard, loop, with. match is an alias of switch. An empty list turns the rule off.",
|
|
1523
|
+
"items": {
|
|
1524
|
+
"description": "A statement kind the rule targets. match is an alias of switch.",
|
|
1525
|
+
"enum": [
|
|
1526
|
+
"if",
|
|
1527
|
+
"for",
|
|
1528
|
+
"while",
|
|
1529
|
+
"switch",
|
|
1530
|
+
"match",
|
|
1531
|
+
"try",
|
|
1532
|
+
"return",
|
|
1533
|
+
"guard",
|
|
1534
|
+
"loop",
|
|
1535
|
+
"with"
|
|
1536
|
+
],
|
|
1537
|
+
"type": "string"
|
|
1538
|
+
},
|
|
1539
|
+
"type": "array"
|
|
1540
|
+
}
|
|
715
1541
|
},
|
|
716
|
-
"type": "
|
|
1542
|
+
"type": "object"
|
|
717
1543
|
}
|
|
718
|
-
},
|
|
719
|
-
"type": "object"
|
|
720
|
-
}
|
|
721
|
-
],
|
|
722
|
-
"description": "Requires a blank line above a control-flow statement (if, for, while, switch/match, try, return, guard, loop, with) that follows another statement in the same block. Works on TypeScript/JavaScript, Python, Swift, Rust and C#; `klint --fix` inserts the line.",
|
|
723
|
-
"examples": [
|
|
724
|
-
"blank-line-before-control-flow: error",
|
|
725
|
-
"blank-line-before-control-flow:\n severity: error\n include: [\"src/**\", \"!src/generated/**\"]\n statements: [if, for, while, switch, try, return, guard, loop, with]\n allowSetup: true"
|
|
726
|
-
]
|
|
727
|
-
},
|
|
728
|
-
"cognitive-complexity": {
|
|
729
|
-
"anyOf": [
|
|
730
|
-
{
|
|
731
|
-
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
732
|
-
"enum": [
|
|
733
|
-
"error",
|
|
734
|
-
"warn",
|
|
735
|
-
"off"
|
|
736
1544
|
],
|
|
737
|
-
"
|
|
1545
|
+
"description": "Requires a blank line above a control-flow statement (if, for, while, switch/match, try, return, guard, loop, with) that follows another statement in the same block. Works on TypeScript/JavaScript, Python, Swift, Rust and C#; `klint --fix` inserts the line.",
|
|
1546
|
+
"examples": [
|
|
1547
|
+
"blank-line-before-control-flow: error",
|
|
1548
|
+
"blank-line-before-control-flow:\n severity: error\n include: [\"src/**\", \"!src/generated/**\"]\n statements: [if, for, while, switch, try, return, guard, loop, with]\n allowSetup: true"
|
|
1549
|
+
]
|
|
738
1550
|
},
|
|
739
|
-
{
|
|
740
|
-
"
|
|
741
|
-
|
|
742
|
-
"properties": {
|
|
743
|
-
"include": {
|
|
744
|
-
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
745
|
-
"items": {
|
|
746
|
-
"type": "string"
|
|
747
|
-
},
|
|
748
|
-
"type": "array"
|
|
749
|
-
},
|
|
750
|
-
"max": {
|
|
751
|
-
"default": 15,
|
|
752
|
-
"description": "Highest cognitive complexity a function may have; a function scoring above it is reported. An integer of at least 1. Defaults to 15.",
|
|
753
|
-
"format": "uint32",
|
|
754
|
-
"minimum": 1,
|
|
755
|
-
"type": "integer"
|
|
756
|
-
},
|
|
757
|
-
"severity": {
|
|
1551
|
+
"cognitive-complexity": {
|
|
1552
|
+
"anyOf": [
|
|
1553
|
+
{
|
|
758
1554
|
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
759
1555
|
"enum": [
|
|
760
1556
|
"error",
|
|
761
1557
|
"warn",
|
|
762
|
-
"off"
|
|
763
|
-
null
|
|
1558
|
+
"off"
|
|
764
1559
|
],
|
|
765
1560
|
"type": "string"
|
|
1561
|
+
},
|
|
1562
|
+
{
|
|
1563
|
+
"additionalProperties": false,
|
|
1564
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
1565
|
+
"properties": {
|
|
1566
|
+
"include": {
|
|
1567
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1568
|
+
"items": {
|
|
1569
|
+
"type": "string"
|
|
1570
|
+
},
|
|
1571
|
+
"type": "array"
|
|
1572
|
+
},
|
|
1573
|
+
"max": {
|
|
1574
|
+
"default": 15,
|
|
1575
|
+
"description": "Highest cognitive complexity a function may have; a function scoring above it is reported. An integer of at least 1. Defaults to 15.",
|
|
1576
|
+
"format": "uint32",
|
|
1577
|
+
"minimum": 1,
|
|
1578
|
+
"type": "integer"
|
|
1579
|
+
},
|
|
1580
|
+
"severity": {
|
|
1581
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1582
|
+
"enum": [
|
|
1583
|
+
"error",
|
|
1584
|
+
"warn",
|
|
1585
|
+
"off",
|
|
1586
|
+
null
|
|
1587
|
+
],
|
|
1588
|
+
"type": "string"
|
|
1589
|
+
}
|
|
1590
|
+
},
|
|
1591
|
+
"type": "object"
|
|
766
1592
|
}
|
|
767
|
-
},
|
|
768
|
-
"type": "object"
|
|
769
|
-
}
|
|
770
|
-
],
|
|
771
|
-
"description": "Reports every function whose cognitive complexity is above `max` (default 15), scored like Biome 2.6.5's `noExcessiveCognitiveComplexity` (the SonarSource Cognitive Complexity model). Works on TypeScript/JavaScript, Python, Swift, Rust and C#. Opt-in; no autofix.",
|
|
772
|
-
"examples": [
|
|
773
|
-
"cognitive-complexity: error",
|
|
774
|
-
"cognitive-complexity:\n severity: warn\n include: [\"src/**\", \"!src/generated/**\"]\n max: 14"
|
|
775
|
-
]
|
|
776
|
-
},
|
|
777
|
-
"function-length": {
|
|
778
|
-
"anyOf": [
|
|
779
|
-
{
|
|
780
|
-
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
781
|
-
"enum": [
|
|
782
|
-
"error",
|
|
783
|
-
"warn",
|
|
784
|
-
"off"
|
|
785
1593
|
],
|
|
786
|
-
"
|
|
1594
|
+
"description": "Reports every function whose cognitive complexity is above `max` (default 15), scored like `eslint-plugin-sonarjs` 3.0.5's `cognitive-complexity` (SonarSource rule S3776). Works on TypeScript/JavaScript, Python, Swift, Rust and C#. Opt-in; no autofix.",
|
|
1595
|
+
"examples": [
|
|
1596
|
+
"cognitive-complexity: error",
|
|
1597
|
+
"cognitive-complexity:\n severity: warn\n include: [\"src/**\", \"!src/generated/**\"]\n max: 14"
|
|
1598
|
+
]
|
|
787
1599
|
},
|
|
788
|
-
{
|
|
789
|
-
"
|
|
790
|
-
|
|
791
|
-
"properties": {
|
|
792
|
-
"include": {
|
|
793
|
-
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
794
|
-
"items": {
|
|
795
|
-
"type": "string"
|
|
796
|
-
},
|
|
797
|
-
"type": "array"
|
|
798
|
-
},
|
|
799
|
-
"max": {
|
|
800
|
-
"default": 50,
|
|
801
|
-
"description": "Highest number of lines a function body may have; a function counting more is reported. An integer of at least 1. Defaults to 50.",
|
|
802
|
-
"format": "uint32",
|
|
803
|
-
"minimum": 1,
|
|
804
|
-
"type": "integer"
|
|
805
|
-
},
|
|
806
|
-
"severity": {
|
|
1600
|
+
"function-length": {
|
|
1601
|
+
"anyOf": [
|
|
1602
|
+
{
|
|
807
1603
|
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
808
1604
|
"enum": [
|
|
809
1605
|
"error",
|
|
810
1606
|
"warn",
|
|
811
|
-
"off"
|
|
812
|
-
null
|
|
1607
|
+
"off"
|
|
813
1608
|
],
|
|
814
1609
|
"type": "string"
|
|
815
1610
|
},
|
|
816
|
-
|
|
817
|
-
"
|
|
818
|
-
"description": "
|
|
819
|
-
"
|
|
1611
|
+
{
|
|
1612
|
+
"additionalProperties": false,
|
|
1613
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
1614
|
+
"properties": {
|
|
1615
|
+
"include": {
|
|
1616
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1617
|
+
"items": {
|
|
1618
|
+
"type": "string"
|
|
1619
|
+
},
|
|
1620
|
+
"type": "array"
|
|
1621
|
+
},
|
|
1622
|
+
"max": {
|
|
1623
|
+
"default": 50,
|
|
1624
|
+
"description": "Highest number of lines a function body may have; a function counting more is reported. An integer of at least 1. Defaults to 50.",
|
|
1625
|
+
"format": "uint32",
|
|
1626
|
+
"minimum": 1,
|
|
1627
|
+
"type": "integer"
|
|
1628
|
+
},
|
|
1629
|
+
"severity": {
|
|
1630
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1631
|
+
"enum": [
|
|
1632
|
+
"error",
|
|
1633
|
+
"warn",
|
|
1634
|
+
"off",
|
|
1635
|
+
null
|
|
1636
|
+
],
|
|
1637
|
+
"type": "string"
|
|
1638
|
+
},
|
|
1639
|
+
"skipBlankLines": {
|
|
1640
|
+
"default": false,
|
|
1641
|
+
"description": "Leave blank lines out of the count. Defaults to false.",
|
|
1642
|
+
"type": "boolean"
|
|
1643
|
+
}
|
|
1644
|
+
},
|
|
1645
|
+
"type": "object"
|
|
820
1646
|
}
|
|
821
|
-
},
|
|
822
|
-
"type": "object"
|
|
823
|
-
}
|
|
824
|
-
],
|
|
825
|
-
"description": "Reports every function whose body has more than `max` lines (default 50), counted like Biome 2.6.5's `noExcessiveLinesPerFunction`: brace lines do not count, comment and blank lines do (blank lines not with `skipBlankLines`), and a nested function's lines count toward its parent. Getters and setters are not checked. Works on TypeScript/JavaScript, Python, Swift, Rust and C#. Opt-in; no autofix.",
|
|
826
|
-
"examples": [
|
|
827
|
-
"function-length: error",
|
|
828
|
-
"function-length:\n severity: warn\n include: [\"src/**\", \"!src/generated/**\"]\n max: 40\n skipBlankLines: true"
|
|
829
|
-
]
|
|
830
|
-
},
|
|
831
|
-
"no-async-predicate": {
|
|
832
|
-
"anyOf": [
|
|
833
|
-
{
|
|
834
|
-
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
835
|
-
"enum": [
|
|
836
|
-
"error",
|
|
837
|
-
"warn",
|
|
838
|
-
"off"
|
|
839
1647
|
],
|
|
840
|
-
"
|
|
1648
|
+
"description": "Reports every function whose body has more than `max` lines (default 50), counted like Biome 2.6.5's `noExcessiveLinesPerFunction`: brace lines do not count, comment and blank lines do (blank lines not with `skipBlankLines`), and a nested function's lines count toward its parent. Getters and setters are not checked. Works on TypeScript/JavaScript, Python, Swift, Rust and C#. Opt-in; no autofix.",
|
|
1649
|
+
"examples": [
|
|
1650
|
+
"function-length: error",
|
|
1651
|
+
"function-length:\n severity: warn\n include: [\"src/**\", \"!src/generated/**\"]\n max: 40\n skipBlankLines: true"
|
|
1652
|
+
]
|
|
841
1653
|
},
|
|
842
|
-
{
|
|
843
|
-
"
|
|
844
|
-
|
|
845
|
-
"properties": {
|
|
846
|
-
"include": {
|
|
847
|
-
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
848
|
-
"items": {
|
|
849
|
-
"type": "string"
|
|
850
|
-
},
|
|
851
|
-
"type": "array"
|
|
852
|
-
},
|
|
853
|
-
"severity": {
|
|
1654
|
+
"no-async-predicate": {
|
|
1655
|
+
"anyOf": [
|
|
1656
|
+
{
|
|
854
1657
|
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
855
1658
|
"enum": [
|
|
856
1659
|
"error",
|
|
857
1660
|
"warn",
|
|
858
|
-
"off"
|
|
859
|
-
null
|
|
1661
|
+
"off"
|
|
860
1662
|
],
|
|
861
1663
|
"type": "string"
|
|
1664
|
+
},
|
|
1665
|
+
{
|
|
1666
|
+
"additionalProperties": false,
|
|
1667
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
1668
|
+
"properties": {
|
|
1669
|
+
"include": {
|
|
1670
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1671
|
+
"items": {
|
|
1672
|
+
"type": "string"
|
|
1673
|
+
},
|
|
1674
|
+
"type": "array"
|
|
1675
|
+
},
|
|
1676
|
+
"severity": {
|
|
1677
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1678
|
+
"enum": [
|
|
1679
|
+
"error",
|
|
1680
|
+
"warn",
|
|
1681
|
+
"off",
|
|
1682
|
+
null
|
|
1683
|
+
],
|
|
1684
|
+
"type": "string"
|
|
1685
|
+
}
|
|
1686
|
+
},
|
|
1687
|
+
"type": "object"
|
|
862
1688
|
}
|
|
863
|
-
},
|
|
864
|
-
"type": "object"
|
|
865
|
-
}
|
|
866
|
-
],
|
|
867
|
-
"description": "Flags `async` functions passed to `.filter`/`.some`/`.every`/`.find`/`.findIndex`. Array methods coerce the returned promise to truthy, so every element appears to match.",
|
|
868
|
-
"examples": [
|
|
869
|
-
"no-async-predicate: error"
|
|
870
|
-
]
|
|
871
|
-
},
|
|
872
|
-
"no-consecutive-array-push": {
|
|
873
|
-
"anyOf": [
|
|
874
|
-
{
|
|
875
|
-
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
876
|
-
"enum": [
|
|
877
|
-
"error",
|
|
878
|
-
"warn",
|
|
879
|
-
"off"
|
|
880
1689
|
],
|
|
881
|
-
"
|
|
1690
|
+
"description": "Flags `async` functions passed to `.filter`/`.some`/`.every`/`.find`/`.findIndex`. Array methods coerce the returned promise to truthy, so every element appears to match.",
|
|
1691
|
+
"examples": [
|
|
1692
|
+
"no-async-predicate: error"
|
|
1693
|
+
]
|
|
882
1694
|
},
|
|
883
|
-
{
|
|
884
|
-
"
|
|
885
|
-
|
|
886
|
-
"properties": {
|
|
887
|
-
"include": {
|
|
888
|
-
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
889
|
-
"items": {
|
|
890
|
-
"type": "string"
|
|
891
|
-
},
|
|
892
|
-
"type": "array"
|
|
893
|
-
},
|
|
894
|
-
"severity": {
|
|
1695
|
+
"no-consecutive-array-push": {
|
|
1696
|
+
"anyOf": [
|
|
1697
|
+
{
|
|
895
1698
|
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
896
1699
|
"enum": [
|
|
897
1700
|
"error",
|
|
898
1701
|
"warn",
|
|
899
|
-
"off"
|
|
900
|
-
null
|
|
1702
|
+
"off"
|
|
901
1703
|
],
|
|
902
1704
|
"type": "string"
|
|
1705
|
+
},
|
|
1706
|
+
{
|
|
1707
|
+
"additionalProperties": false,
|
|
1708
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
1709
|
+
"properties": {
|
|
1710
|
+
"include": {
|
|
1711
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1712
|
+
"items": {
|
|
1713
|
+
"type": "string"
|
|
1714
|
+
},
|
|
1715
|
+
"type": "array"
|
|
1716
|
+
},
|
|
1717
|
+
"severity": {
|
|
1718
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1719
|
+
"enum": [
|
|
1720
|
+
"error",
|
|
1721
|
+
"warn",
|
|
1722
|
+
"off",
|
|
1723
|
+
null
|
|
1724
|
+
],
|
|
1725
|
+
"type": "string"
|
|
1726
|
+
}
|
|
1727
|
+
},
|
|
1728
|
+
"type": "object"
|
|
903
1729
|
}
|
|
904
|
-
},
|
|
905
|
-
"type": "object"
|
|
906
|
-
}
|
|
907
|
-
],
|
|
908
|
-
"description": "Flags consecutive `arr.push(x); arr.push(y);` calls — combine into `arr.push(x, y)` or `arr.push(...items)`.",
|
|
909
|
-
"examples": [
|
|
910
|
-
"no-consecutive-array-push: warn"
|
|
911
|
-
]
|
|
912
|
-
},
|
|
913
|
-
"no-nested-template-literals": {
|
|
914
|
-
"anyOf": [
|
|
915
|
-
{
|
|
916
|
-
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
917
|
-
"enum": [
|
|
918
|
-
"error",
|
|
919
|
-
"warn",
|
|
920
|
-
"off"
|
|
921
1730
|
],
|
|
922
|
-
"
|
|
1731
|
+
"description": "Flags consecutive `arr.push(x); arr.push(y);` calls — combine into `arr.push(x, y)` or `arr.push(...items)`.",
|
|
1732
|
+
"examples": [
|
|
1733
|
+
"no-consecutive-array-push: warn"
|
|
1734
|
+
]
|
|
923
1735
|
},
|
|
924
|
-
{
|
|
925
|
-
"
|
|
926
|
-
|
|
927
|
-
"properties": {
|
|
928
|
-
"include": {
|
|
929
|
-
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
930
|
-
"items": {
|
|
931
|
-
"type": "string"
|
|
932
|
-
},
|
|
933
|
-
"type": "array"
|
|
934
|
-
},
|
|
935
|
-
"severity": {
|
|
1736
|
+
"no-nested-template-literals": {
|
|
1737
|
+
"anyOf": [
|
|
1738
|
+
{
|
|
936
1739
|
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
937
1740
|
"enum": [
|
|
938
1741
|
"error",
|
|
939
1742
|
"warn",
|
|
940
|
-
"off"
|
|
941
|
-
null
|
|
1743
|
+
"off"
|
|
942
1744
|
],
|
|
943
1745
|
"type": "string"
|
|
1746
|
+
},
|
|
1747
|
+
{
|
|
1748
|
+
"additionalProperties": false,
|
|
1749
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
1750
|
+
"properties": {
|
|
1751
|
+
"include": {
|
|
1752
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1753
|
+
"items": {
|
|
1754
|
+
"type": "string"
|
|
1755
|
+
},
|
|
1756
|
+
"type": "array"
|
|
1757
|
+
},
|
|
1758
|
+
"severity": {
|
|
1759
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1760
|
+
"enum": [
|
|
1761
|
+
"error",
|
|
1762
|
+
"warn",
|
|
1763
|
+
"off",
|
|
1764
|
+
null
|
|
1765
|
+
],
|
|
1766
|
+
"type": "string"
|
|
1767
|
+
}
|
|
1768
|
+
},
|
|
1769
|
+
"type": "object"
|
|
944
1770
|
}
|
|
945
|
-
},
|
|
946
|
-
"type": "object"
|
|
947
|
-
}
|
|
948
|
-
],
|
|
949
|
-
"description": "Flags template literals nested inside template literals — almost always unreadable; extract to a variable.",
|
|
950
|
-
"examples": [
|
|
951
|
-
"no-nested-template-literals: warn"
|
|
952
|
-
]
|
|
953
|
-
},
|
|
954
|
-
"no-string-match": {
|
|
955
|
-
"anyOf": [
|
|
956
|
-
{
|
|
957
|
-
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
958
|
-
"enum": [
|
|
959
|
-
"error",
|
|
960
|
-
"warn",
|
|
961
|
-
"off"
|
|
962
1771
|
],
|
|
963
|
-
"
|
|
1772
|
+
"description": "Flags template literals nested inside template literals — almost always unreadable; extract to a variable.",
|
|
1773
|
+
"examples": [
|
|
1774
|
+
"no-nested-template-literals: warn"
|
|
1775
|
+
]
|
|
964
1776
|
},
|
|
965
|
-
{
|
|
966
|
-
"
|
|
967
|
-
|
|
968
|
-
"properties": {
|
|
969
|
-
"include": {
|
|
970
|
-
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
971
|
-
"items": {
|
|
972
|
-
"type": "string"
|
|
973
|
-
},
|
|
974
|
-
"type": "array"
|
|
975
|
-
},
|
|
976
|
-
"severity": {
|
|
1777
|
+
"no-string-match": {
|
|
1778
|
+
"anyOf": [
|
|
1779
|
+
{
|
|
977
1780
|
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
978
1781
|
"enum": [
|
|
979
1782
|
"error",
|
|
980
1783
|
"warn",
|
|
981
|
-
"off"
|
|
982
|
-
null
|
|
1784
|
+
"off"
|
|
983
1785
|
],
|
|
984
1786
|
"type": "string"
|
|
1787
|
+
},
|
|
1788
|
+
{
|
|
1789
|
+
"additionalProperties": false,
|
|
1790
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
1791
|
+
"properties": {
|
|
1792
|
+
"include": {
|
|
1793
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1794
|
+
"items": {
|
|
1795
|
+
"type": "string"
|
|
1796
|
+
},
|
|
1797
|
+
"type": "array"
|
|
1798
|
+
},
|
|
1799
|
+
"severity": {
|
|
1800
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1801
|
+
"enum": [
|
|
1802
|
+
"error",
|
|
1803
|
+
"warn",
|
|
1804
|
+
"off",
|
|
1805
|
+
null
|
|
1806
|
+
],
|
|
1807
|
+
"type": "string"
|
|
1808
|
+
}
|
|
1809
|
+
},
|
|
1810
|
+
"type": "object"
|
|
985
1811
|
}
|
|
986
|
-
},
|
|
987
|
-
"type": "object"
|
|
988
|
-
}
|
|
989
|
-
],
|
|
990
|
-
"description": "Flags `String#match` — prefer `.matchAll()` for iteration or `.test()` for boolean checks. `.match()` returns different shapes depending on the `/g` flag.",
|
|
991
|
-
"examples": [
|
|
992
|
-
"no-string-match: error"
|
|
993
|
-
]
|
|
994
|
-
},
|
|
995
|
-
"no-sync-in-async": {
|
|
996
|
-
"anyOf": [
|
|
997
|
-
{
|
|
998
|
-
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
999
|
-
"enum": [
|
|
1000
|
-
"error",
|
|
1001
|
-
"warn",
|
|
1002
|
-
"off"
|
|
1003
1812
|
],
|
|
1004
|
-
"
|
|
1813
|
+
"description": "Flags `String#match` — prefer `.matchAll()` for iteration or `.test()` for boolean checks. `.match()` returns different shapes depending on the `/g` flag.",
|
|
1814
|
+
"examples": [
|
|
1815
|
+
"no-string-match: error"
|
|
1816
|
+
]
|
|
1005
1817
|
},
|
|
1006
|
-
{
|
|
1007
|
-
"
|
|
1008
|
-
|
|
1009
|
-
"properties": {
|
|
1010
|
-
"include": {
|
|
1011
|
-
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1012
|
-
"items": {
|
|
1013
|
-
"type": "string"
|
|
1014
|
-
},
|
|
1015
|
-
"type": "array"
|
|
1016
|
-
},
|
|
1017
|
-
"severity": {
|
|
1818
|
+
"no-sync-in-async": {
|
|
1819
|
+
"anyOf": [
|
|
1820
|
+
{
|
|
1018
1821
|
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1019
1822
|
"enum": [
|
|
1020
1823
|
"error",
|
|
1021
1824
|
"warn",
|
|
1022
|
-
"off"
|
|
1023
|
-
null
|
|
1825
|
+
"off"
|
|
1024
1826
|
],
|
|
1025
1827
|
"type": "string"
|
|
1828
|
+
},
|
|
1829
|
+
{
|
|
1830
|
+
"additionalProperties": false,
|
|
1831
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
1832
|
+
"properties": {
|
|
1833
|
+
"include": {
|
|
1834
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1835
|
+
"items": {
|
|
1836
|
+
"type": "string"
|
|
1837
|
+
},
|
|
1838
|
+
"type": "array"
|
|
1839
|
+
},
|
|
1840
|
+
"severity": {
|
|
1841
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1842
|
+
"enum": [
|
|
1843
|
+
"error",
|
|
1844
|
+
"warn",
|
|
1845
|
+
"off",
|
|
1846
|
+
null
|
|
1847
|
+
],
|
|
1848
|
+
"type": "string"
|
|
1849
|
+
}
|
|
1850
|
+
},
|
|
1851
|
+
"type": "object"
|
|
1026
1852
|
}
|
|
1027
|
-
},
|
|
1028
|
-
"type": "object"
|
|
1029
|
-
}
|
|
1030
|
-
],
|
|
1031
|
-
"description": "Flags synchronous I/O (`readFileSync`, `execSync`, etc.) inside async functions — blocks the event loop when an async equivalent is available.",
|
|
1032
|
-
"examples": [
|
|
1033
|
-
"no-sync-in-async: error",
|
|
1034
|
-
"no-sync-in-async:\n severity: warn\n include: [\"src/server/**\"]"
|
|
1035
|
-
]
|
|
1036
|
-
},
|
|
1037
|
-
"no-unguarded-json-parse": {
|
|
1038
|
-
"anyOf": [
|
|
1039
|
-
{
|
|
1040
|
-
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1041
|
-
"enum": [
|
|
1042
|
-
"error",
|
|
1043
|
-
"warn",
|
|
1044
|
-
"off"
|
|
1045
1853
|
],
|
|
1046
|
-
"
|
|
1854
|
+
"description": "Flags synchronous I/O (`readFileSync`, `execSync`, etc.) inside async functions — blocks the event loop when an async equivalent is available.",
|
|
1855
|
+
"examples": [
|
|
1856
|
+
"no-sync-in-async: error",
|
|
1857
|
+
"no-sync-in-async:\n severity: warn\n include: [\"src/server/**\"]"
|
|
1858
|
+
]
|
|
1047
1859
|
},
|
|
1048
|
-
{
|
|
1049
|
-
"
|
|
1050
|
-
|
|
1051
|
-
"properties": {
|
|
1052
|
-
"include": {
|
|
1053
|
-
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1054
|
-
"items": {
|
|
1055
|
-
"type": "string"
|
|
1056
|
-
},
|
|
1057
|
-
"type": "array"
|
|
1058
|
-
},
|
|
1059
|
-
"severity": {
|
|
1860
|
+
"no-unguarded-json-parse": {
|
|
1861
|
+
"anyOf": [
|
|
1862
|
+
{
|
|
1060
1863
|
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1061
1864
|
"enum": [
|
|
1062
1865
|
"error",
|
|
1063
1866
|
"warn",
|
|
1064
|
-
"off"
|
|
1065
|
-
null
|
|
1867
|
+
"off"
|
|
1066
1868
|
],
|
|
1067
1869
|
"type": "string"
|
|
1870
|
+
},
|
|
1871
|
+
{
|
|
1872
|
+
"additionalProperties": false,
|
|
1873
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
1874
|
+
"properties": {
|
|
1875
|
+
"include": {
|
|
1876
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1877
|
+
"items": {
|
|
1878
|
+
"type": "string"
|
|
1879
|
+
},
|
|
1880
|
+
"type": "array"
|
|
1881
|
+
},
|
|
1882
|
+
"severity": {
|
|
1883
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1884
|
+
"enum": [
|
|
1885
|
+
"error",
|
|
1886
|
+
"warn",
|
|
1887
|
+
"off",
|
|
1888
|
+
null
|
|
1889
|
+
],
|
|
1890
|
+
"type": "string"
|
|
1891
|
+
}
|
|
1892
|
+
},
|
|
1893
|
+
"type": "object"
|
|
1068
1894
|
}
|
|
1069
|
-
},
|
|
1070
|
-
"type": "object"
|
|
1071
|
-
}
|
|
1072
|
-
],
|
|
1073
|
-
"description": "Flags `JSON.parse()` calls that aren't wrapped in try/catch — malformed input crashes the process.",
|
|
1074
|
-
"examples": [
|
|
1075
|
-
"no-unguarded-json-parse: error"
|
|
1076
|
-
]
|
|
1077
|
-
},
|
|
1078
|
-
"sonar/no-single-char-class": {
|
|
1079
|
-
"anyOf": [
|
|
1080
|
-
{
|
|
1081
|
-
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1082
|
-
"enum": [
|
|
1083
|
-
"error",
|
|
1084
|
-
"warn",
|
|
1085
|
-
"off"
|
|
1086
1895
|
],
|
|
1087
|
-
"
|
|
1896
|
+
"description": "Flags `JSON.parse()` calls that aren't wrapped in try/catch — malformed input crashes the process.",
|
|
1897
|
+
"examples": [
|
|
1898
|
+
"no-unguarded-json-parse: error"
|
|
1899
|
+
]
|
|
1088
1900
|
},
|
|
1089
|
-
{
|
|
1090
|
-
"
|
|
1091
|
-
|
|
1092
|
-
"properties": {
|
|
1093
|
-
"include": {
|
|
1094
|
-
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1095
|
-
"items": {
|
|
1096
|
-
"type": "string"
|
|
1097
|
-
},
|
|
1098
|
-
"type": "array"
|
|
1099
|
-
},
|
|
1100
|
-
"severity": {
|
|
1901
|
+
"sonar/no-single-char-class": {
|
|
1902
|
+
"anyOf": [
|
|
1903
|
+
{
|
|
1101
1904
|
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1102
1905
|
"enum": [
|
|
1103
1906
|
"error",
|
|
1104
1907
|
"warn",
|
|
1105
|
-
"off"
|
|
1106
|
-
null
|
|
1908
|
+
"off"
|
|
1107
1909
|
],
|
|
1108
1910
|
"type": "string"
|
|
1911
|
+
},
|
|
1912
|
+
{
|
|
1913
|
+
"additionalProperties": false,
|
|
1914
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
1915
|
+
"properties": {
|
|
1916
|
+
"include": {
|
|
1917
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1918
|
+
"items": {
|
|
1919
|
+
"type": "string"
|
|
1920
|
+
},
|
|
1921
|
+
"type": "array"
|
|
1922
|
+
},
|
|
1923
|
+
"severity": {
|
|
1924
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1925
|
+
"enum": [
|
|
1926
|
+
"error",
|
|
1927
|
+
"warn",
|
|
1928
|
+
"off",
|
|
1929
|
+
null
|
|
1930
|
+
],
|
|
1931
|
+
"type": "string"
|
|
1932
|
+
}
|
|
1933
|
+
},
|
|
1934
|
+
"type": "object"
|
|
1109
1935
|
}
|
|
1110
|
-
},
|
|
1111
|
-
"type": "object"
|
|
1112
|
-
}
|
|
1113
|
-
],
|
|
1114
|
-
"description": "Flags single-character character classes in regex (e.g. `/[a]/`) — drop the brackets; the regex matches the same.",
|
|
1115
|
-
"examples": [
|
|
1116
|
-
"sonar/no-single-char-class: warn"
|
|
1117
|
-
]
|
|
1118
|
-
},
|
|
1119
|
-
"sonar/prefer-at": {
|
|
1120
|
-
"anyOf": [
|
|
1121
|
-
{
|
|
1122
|
-
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1123
|
-
"enum": [
|
|
1124
|
-
"error",
|
|
1125
|
-
"warn",
|
|
1126
|
-
"off"
|
|
1127
1936
|
],
|
|
1128
|
-
"
|
|
1937
|
+
"description": "Flags single-character character classes in regex (e.g. `/[a]/`) — drop the brackets; the regex matches the same.",
|
|
1938
|
+
"examples": [
|
|
1939
|
+
"sonar/no-single-char-class: warn"
|
|
1940
|
+
]
|
|
1129
1941
|
},
|
|
1130
|
-
{
|
|
1131
|
-
"
|
|
1132
|
-
|
|
1133
|
-
"properties": {
|
|
1134
|
-
"include": {
|
|
1135
|
-
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1136
|
-
"items": {
|
|
1137
|
-
"type": "string"
|
|
1138
|
-
},
|
|
1139
|
-
"type": "array"
|
|
1140
|
-
},
|
|
1141
|
-
"severity": {
|
|
1942
|
+
"sonar/prefer-at": {
|
|
1943
|
+
"anyOf": [
|
|
1944
|
+
{
|
|
1142
1945
|
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1143
1946
|
"enum": [
|
|
1144
1947
|
"error",
|
|
1145
1948
|
"warn",
|
|
1146
|
-
"off"
|
|
1147
|
-
null
|
|
1949
|
+
"off"
|
|
1148
1950
|
],
|
|
1149
1951
|
"type": "string"
|
|
1952
|
+
},
|
|
1953
|
+
{
|
|
1954
|
+
"additionalProperties": false,
|
|
1955
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
1956
|
+
"properties": {
|
|
1957
|
+
"include": {
|
|
1958
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1959
|
+
"items": {
|
|
1960
|
+
"type": "string"
|
|
1961
|
+
},
|
|
1962
|
+
"type": "array"
|
|
1963
|
+
},
|
|
1964
|
+
"severity": {
|
|
1965
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1966
|
+
"enum": [
|
|
1967
|
+
"error",
|
|
1968
|
+
"warn",
|
|
1969
|
+
"off",
|
|
1970
|
+
null
|
|
1971
|
+
],
|
|
1972
|
+
"type": "string"
|
|
1973
|
+
}
|
|
1974
|
+
},
|
|
1975
|
+
"type": "object"
|
|
1150
1976
|
}
|
|
1151
|
-
},
|
|
1152
|
-
"type": "object"
|
|
1153
|
-
}
|
|
1154
|
-
],
|
|
1155
|
-
"description": "Flags negative-index access via `arr[arr.length - 1]` — `.at(-1)` reads cleaner for last-element access.",
|
|
1156
|
-
"examples": [
|
|
1157
|
-
"sonar/prefer-at: warn"
|
|
1158
|
-
]
|
|
1159
|
-
},
|
|
1160
|
-
"sonar/prefer-nullish-coalescing-assign": {
|
|
1161
|
-
"anyOf": [
|
|
1162
|
-
{
|
|
1163
|
-
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1164
|
-
"enum": [
|
|
1165
|
-
"error",
|
|
1166
|
-
"warn",
|
|
1167
|
-
"off"
|
|
1168
1977
|
],
|
|
1169
|
-
"
|
|
1978
|
+
"description": "Flags negative-index access via `arr[arr.length - 1]` — `.at(-1)` reads cleaner for last-element access.",
|
|
1979
|
+
"examples": [
|
|
1980
|
+
"sonar/prefer-at: warn"
|
|
1981
|
+
]
|
|
1170
1982
|
},
|
|
1171
|
-
{
|
|
1172
|
-
"
|
|
1173
|
-
|
|
1174
|
-
"properties": {
|
|
1175
|
-
"include": {
|
|
1176
|
-
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1177
|
-
"items": {
|
|
1178
|
-
"type": "string"
|
|
1179
|
-
},
|
|
1180
|
-
"type": "array"
|
|
1181
|
-
},
|
|
1182
|
-
"severity": {
|
|
1983
|
+
"sonar/prefer-nullish-coalescing-assign": {
|
|
1984
|
+
"anyOf": [
|
|
1985
|
+
{
|
|
1183
1986
|
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1184
1987
|
"enum": [
|
|
1185
1988
|
"error",
|
|
1186
1989
|
"warn",
|
|
1187
|
-
"off"
|
|
1188
|
-
null
|
|
1990
|
+
"off"
|
|
1189
1991
|
],
|
|
1190
1992
|
"type": "string"
|
|
1993
|
+
},
|
|
1994
|
+
{
|
|
1995
|
+
"additionalProperties": false,
|
|
1996
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
1997
|
+
"properties": {
|
|
1998
|
+
"include": {
|
|
1999
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
2000
|
+
"items": {
|
|
2001
|
+
"type": "string"
|
|
2002
|
+
},
|
|
2003
|
+
"type": "array"
|
|
2004
|
+
},
|
|
2005
|
+
"severity": {
|
|
2006
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
2007
|
+
"enum": [
|
|
2008
|
+
"error",
|
|
2009
|
+
"warn",
|
|
2010
|
+
"off",
|
|
2011
|
+
null
|
|
2012
|
+
],
|
|
2013
|
+
"type": "string"
|
|
2014
|
+
}
|
|
2015
|
+
},
|
|
2016
|
+
"type": "object"
|
|
1191
2017
|
}
|
|
1192
|
-
},
|
|
1193
|
-
"type": "object"
|
|
1194
|
-
}
|
|
1195
|
-
],
|
|
1196
|
-
"description": "Flags explicit nullish assignment guards — `x ??= y` is the dedicated nullish assignment operator.",
|
|
1197
|
-
"examples": [
|
|
1198
|
-
"sonar/prefer-nullish-coalescing-assign: warn"
|
|
1199
|
-
]
|
|
1200
|
-
},
|
|
1201
|
-
"sonar/prefer-string-raw": {
|
|
1202
|
-
"anyOf": [
|
|
1203
|
-
{
|
|
1204
|
-
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1205
|
-
"enum": [
|
|
1206
|
-
"error",
|
|
1207
|
-
"warn",
|
|
1208
|
-
"off"
|
|
1209
2018
|
],
|
|
1210
|
-
"
|
|
2019
|
+
"description": "Flags explicit nullish assignment guards — `x ??= y` is the dedicated nullish assignment operator.",
|
|
2020
|
+
"examples": [
|
|
2021
|
+
"sonar/prefer-nullish-coalescing-assign: warn"
|
|
2022
|
+
]
|
|
1211
2023
|
},
|
|
1212
|
-
{
|
|
1213
|
-
"
|
|
1214
|
-
|
|
1215
|
-
"properties": {
|
|
1216
|
-
"include": {
|
|
1217
|
-
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1218
|
-
"items": {
|
|
1219
|
-
"type": "string"
|
|
1220
|
-
},
|
|
1221
|
-
"type": "array"
|
|
1222
|
-
},
|
|
1223
|
-
"severity": {
|
|
2024
|
+
"sonar/prefer-string-raw": {
|
|
2025
|
+
"anyOf": [
|
|
2026
|
+
{
|
|
1224
2027
|
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1225
2028
|
"enum": [
|
|
1226
2029
|
"error",
|
|
1227
2030
|
"warn",
|
|
1228
|
-
"off"
|
|
1229
|
-
null
|
|
2031
|
+
"off"
|
|
1230
2032
|
],
|
|
1231
2033
|
"type": "string"
|
|
2034
|
+
},
|
|
2035
|
+
{
|
|
2036
|
+
"additionalProperties": false,
|
|
2037
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
2038
|
+
"properties": {
|
|
2039
|
+
"include": {
|
|
2040
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
2041
|
+
"items": {
|
|
2042
|
+
"type": "string"
|
|
2043
|
+
},
|
|
2044
|
+
"type": "array"
|
|
2045
|
+
},
|
|
2046
|
+
"severity": {
|
|
2047
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
2048
|
+
"enum": [
|
|
2049
|
+
"error",
|
|
2050
|
+
"warn",
|
|
2051
|
+
"off",
|
|
2052
|
+
null
|
|
2053
|
+
],
|
|
2054
|
+
"type": "string"
|
|
2055
|
+
}
|
|
2056
|
+
},
|
|
2057
|
+
"type": "object"
|
|
1232
2058
|
}
|
|
1233
|
-
},
|
|
1234
|
-
"type": "object"
|
|
1235
|
-
}
|
|
1236
|
-
],
|
|
1237
|
-
"description": "Flags string literals with multiple backslash escapes — `String.raw` is more readable (Windows paths, regex source, etc.).",
|
|
1238
|
-
"examples": [
|
|
1239
|
-
"sonar/prefer-string-raw: warn"
|
|
1240
|
-
]
|
|
1241
|
-
},
|
|
1242
|
-
"sonar/prefer-string-raw-regexp": {
|
|
1243
|
-
"anyOf": [
|
|
1244
|
-
{
|
|
1245
|
-
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1246
|
-
"enum": [
|
|
1247
|
-
"error",
|
|
1248
|
-
"warn",
|
|
1249
|
-
"off"
|
|
1250
2059
|
],
|
|
1251
|
-
"
|
|
2060
|
+
"description": "Flags string literals with multiple backslash escapes — `String.raw` is more readable (Windows paths, regex source, etc.).",
|
|
2061
|
+
"examples": [
|
|
2062
|
+
"sonar/prefer-string-raw: warn"
|
|
2063
|
+
]
|
|
1252
2064
|
},
|
|
1253
|
-
{
|
|
1254
|
-
"
|
|
1255
|
-
|
|
1256
|
-
"properties": {
|
|
1257
|
-
"include": {
|
|
1258
|
-
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1259
|
-
"items": {
|
|
1260
|
-
"type": "string"
|
|
1261
|
-
},
|
|
1262
|
-
"type": "array"
|
|
1263
|
-
},
|
|
1264
|
-
"severity": {
|
|
2065
|
+
"sonar/prefer-string-raw-regexp": {
|
|
2066
|
+
"anyOf": [
|
|
2067
|
+
{
|
|
1265
2068
|
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1266
2069
|
"enum": [
|
|
1267
2070
|
"error",
|
|
1268
2071
|
"warn",
|
|
1269
|
-
"off"
|
|
1270
|
-
null
|
|
2072
|
+
"off"
|
|
1271
2073
|
],
|
|
1272
2074
|
"type": "string"
|
|
2075
|
+
},
|
|
2076
|
+
{
|
|
2077
|
+
"additionalProperties": false,
|
|
2078
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
2079
|
+
"properties": {
|
|
2080
|
+
"include": {
|
|
2081
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
2082
|
+
"items": {
|
|
2083
|
+
"type": "string"
|
|
2084
|
+
},
|
|
2085
|
+
"type": "array"
|
|
2086
|
+
},
|
|
2087
|
+
"severity": {
|
|
2088
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
2089
|
+
"enum": [
|
|
2090
|
+
"error",
|
|
2091
|
+
"warn",
|
|
2092
|
+
"off",
|
|
2093
|
+
null
|
|
2094
|
+
],
|
|
2095
|
+
"type": "string"
|
|
2096
|
+
}
|
|
2097
|
+
},
|
|
2098
|
+
"type": "object"
|
|
1273
2099
|
}
|
|
1274
|
-
},
|
|
1275
|
-
"type": "object"
|
|
1276
|
-
}
|
|
1277
|
-
],
|
|
1278
|
-
"description": "Flags regex literals built from escape-heavy string concatenation — `String.raw` drops the double backslashes.",
|
|
1279
|
-
"examples": [
|
|
1280
|
-
"sonar/prefer-string-raw-regexp: warn"
|
|
1281
|
-
]
|
|
1282
|
-
},
|
|
1283
|
-
"sonar/prefer-string-replaceall": {
|
|
1284
|
-
"anyOf": [
|
|
1285
|
-
{
|
|
1286
|
-
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1287
|
-
"enum": [
|
|
1288
|
-
"error",
|
|
1289
|
-
"warn",
|
|
1290
|
-
"off"
|
|
1291
2100
|
],
|
|
1292
|
-
"
|
|
2101
|
+
"description": "Flags regex literals built from escape-heavy string concatenation — `String.raw` drops the double backslashes.",
|
|
2102
|
+
"examples": [
|
|
2103
|
+
"sonar/prefer-string-raw-regexp: warn"
|
|
2104
|
+
]
|
|
1293
2105
|
},
|
|
1294
|
-
{
|
|
1295
|
-
"
|
|
1296
|
-
|
|
1297
|
-
"properties": {
|
|
1298
|
-
"include": {
|
|
1299
|
-
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
1300
|
-
"items": {
|
|
1301
|
-
"type": "string"
|
|
1302
|
-
},
|
|
1303
|
-
"type": "array"
|
|
1304
|
-
},
|
|
1305
|
-
"severity": {
|
|
2106
|
+
"sonar/prefer-string-replaceall": {
|
|
2107
|
+
"anyOf": [
|
|
2108
|
+
{
|
|
1306
2109
|
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
1307
2110
|
"enum": [
|
|
1308
2111
|
"error",
|
|
1309
2112
|
"warn",
|
|
1310
|
-
"off"
|
|
1311
|
-
null
|
|
2113
|
+
"off"
|
|
1312
2114
|
],
|
|
1313
2115
|
"type": "string"
|
|
2116
|
+
},
|
|
2117
|
+
{
|
|
2118
|
+
"additionalProperties": false,
|
|
2119
|
+
"description": "Rule options object. Omit severity to default to \"error\". Add include to scope the rule to specific files.",
|
|
2120
|
+
"properties": {
|
|
2121
|
+
"include": {
|
|
2122
|
+
"description": "Glob patterns scoping this rule to a subset of files. Prefix with ! to exclude. Example: [\"src/hooks/**\", \"!src/hooks/scripts/**\"]",
|
|
2123
|
+
"items": {
|
|
2124
|
+
"type": "string"
|
|
2125
|
+
},
|
|
2126
|
+
"type": "array"
|
|
2127
|
+
},
|
|
2128
|
+
"severity": {
|
|
2129
|
+
"description": "Rule severity. \"error\" exits with code 2; \"warn\" reports but exits 0; \"off\" silences.",
|
|
2130
|
+
"enum": [
|
|
2131
|
+
"error",
|
|
2132
|
+
"warn",
|
|
2133
|
+
"off",
|
|
2134
|
+
null
|
|
2135
|
+
],
|
|
2136
|
+
"type": "string"
|
|
2137
|
+
}
|
|
2138
|
+
},
|
|
2139
|
+
"type": "object"
|
|
1314
2140
|
}
|
|
1315
|
-
|
|
1316
|
-
"
|
|
2141
|
+
],
|
|
2142
|
+
"description": "Flags `.replace(/x/g, y)` on strings — `.replaceAll('x', y)` is clearer and faster for all-occurrence replacements.",
|
|
2143
|
+
"examples": [
|
|
2144
|
+
"sonar/prefer-string-replaceall: error"
|
|
2145
|
+
]
|
|
1317
2146
|
}
|
|
1318
|
-
|
|
1319
|
-
"
|
|
1320
|
-
"examples": [
|
|
1321
|
-
"sonar/prefer-string-replaceall: error"
|
|
1322
|
-
]
|
|
2147
|
+
},
|
|
2148
|
+
"type": "object"
|
|
1323
2149
|
}
|
|
1324
|
-
|
|
1325
|
-
"
|
|
2150
|
+
],
|
|
2151
|
+
"default": null,
|
|
2152
|
+
"description": "Rules, in groups: recommended (true enables the six sonar rules at error), core (built-in rules) and sonar (sonar rules, without the sonar/ prefix). Example: { \"recommended\": true, \"core\": { \"no-string-match\": \"error\" }, \"sonar\": { \"prefer-at\": \"warn\" } }. The v1 flat map (rule name → severity or options, sonar/ prefixed) is still read; run `klint migrate` to upgrade it."
|
|
1326
2153
|
}
|
|
1327
2154
|
},
|
|
1328
2155
|
"type": "object"
|