@isentinel/eslint-config 6.0.0-beta.4 → 6.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +123 -40
- package/dist/index.mjs +556 -554
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -200,8 +200,7 @@ const parserPlain = {
|
|
|
200
200
|
};
|
|
201
201
|
}
|
|
202
202
|
};
|
|
203
|
-
function createTsParser(
|
|
204
|
-
const { componentExtensions = [], configName, files, ignores, outOfProjectFiles, parser, parserOptions = {}, parserOptionsNonTypeAware = {}, parserOptionsTypeAware = {}, tsconfigPath, typeAware } = options;
|
|
203
|
+
function createTsParser({ componentExtensions = [], configName, files, ignores, outOfProjectFiles, parser, parserOptions = {}, parserOptionsNonTypeAware = {}, parserOptionsTypeAware = {}, tsconfigPath, typeAware }) {
|
|
205
204
|
return {
|
|
206
205
|
name: `isentinel/${configName}/${typeAware ? "type-aware-parser" : "parser"}`,
|
|
207
206
|
files,
|
|
@@ -479,8 +478,7 @@ async function ceaseNonsense(options = {}) {
|
|
|
479
478
|
}
|
|
480
479
|
//#endregion
|
|
481
480
|
//#region src/configs/comments.ts
|
|
482
|
-
async function comments(
|
|
483
|
-
const { prettierOptions = {}, stylistic = true } = options;
|
|
481
|
+
async function comments({ prettierOptions = {}, stylistic = true } = {}) {
|
|
484
482
|
const [pluginCommentLength, pluginComments, pluginStylistic] = await Promise.all([
|
|
485
483
|
interopDefault(import("eslint-plugin-comment-length")),
|
|
486
484
|
interopDefault(import("@eslint-community/eslint-plugin-eslint-comments")),
|
|
@@ -516,8 +514,7 @@ async function comments(options = {}) {
|
|
|
516
514
|
}
|
|
517
515
|
//#endregion
|
|
518
516
|
//#region src/configs/disables.ts
|
|
519
|
-
async function disables(
|
|
520
|
-
const { root } = options;
|
|
517
|
+
async function disables({ root }) {
|
|
521
518
|
return [
|
|
522
519
|
{
|
|
523
520
|
name: "isentinel/disables/scripts",
|
|
@@ -615,8 +612,7 @@ async function disables(options) {
|
|
|
615
612
|
}
|
|
616
613
|
//#endregion
|
|
617
614
|
//#region src/configs/e18e.ts
|
|
618
|
-
async function e18e(
|
|
619
|
-
const { isInEditor = false, modernization = true, type = "game", moduleReplacements = type === "package" && isInEditor, overrides = {}, performanceImprovements = true } = options;
|
|
615
|
+
async function e18e({ isInEditor = false, modernization = true, type = "game", moduleReplacements = type === "package" && isInEditor, overrides = {}, performanceImprovements = true } = {}) {
|
|
620
616
|
const pluginE18e = await interopDefault(import("@e18e/eslint-plugin"));
|
|
621
617
|
const { configs } = pluginE18e;
|
|
622
618
|
return [{
|
|
@@ -632,8 +628,7 @@ async function e18e(options = {}) {
|
|
|
632
628
|
}
|
|
633
629
|
//#endregion
|
|
634
630
|
//#region src/configs/eslint-plugin.ts
|
|
635
|
-
async function eslintPlugin(
|
|
636
|
-
const { files = [GLOB_SRC], overrides = {} } = options;
|
|
631
|
+
async function eslintPlugin({ files = [GLOB_SRC], overrides = {} } = {}) {
|
|
637
632
|
await ensurePackages(["eslint-plugin-eslint-plugin"]);
|
|
638
633
|
return [{
|
|
639
634
|
name: "isentinel/eslint-plugin/setup",
|
|
@@ -684,296 +679,15 @@ async function eslintPlugin(options = {}) {
|
|
|
684
679
|
}
|
|
685
680
|
//#endregion
|
|
686
681
|
//#region src/configs/flawless.ts
|
|
687
|
-
async function flawless(
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
name: "isentinel/flawless/setup",
|
|
697
|
-
plugins: { flawless: eslintPluginFlawless }
|
|
698
|
-
},
|
|
699
|
-
...isTypeAware ? [{
|
|
700
|
-
name: "isentinel/flawless/ts/rules-type-aware",
|
|
701
|
-
files: tsFilesTypeAware,
|
|
702
|
-
ignores: ignoresTypeAware,
|
|
703
|
-
rules: {
|
|
704
|
-
"flawless/naming-convention": [
|
|
705
|
-
"error",
|
|
706
|
-
{
|
|
707
|
-
format: ["strictCamelCase"],
|
|
708
|
-
selector: "default"
|
|
709
|
-
},
|
|
710
|
-
{
|
|
711
|
-
format: null,
|
|
712
|
-
selector: "import"
|
|
713
|
-
},
|
|
714
|
-
{
|
|
715
|
-
format: null,
|
|
716
|
-
modifiers: ["destructured"],
|
|
717
|
-
selector: "variable"
|
|
718
|
-
},
|
|
719
|
-
{
|
|
720
|
-
format: ["strictCamelCase"],
|
|
721
|
-
leadingUnderscore: "allow",
|
|
722
|
-
selector: "variable"
|
|
723
|
-
},
|
|
724
|
-
{
|
|
725
|
-
format: null,
|
|
726
|
-
modifiers: ["destructured"],
|
|
727
|
-
selector: "parameter"
|
|
728
|
-
},
|
|
729
|
-
{
|
|
730
|
-
format: ["strictCamelCase"],
|
|
731
|
-
leadingUnderscore: "allow",
|
|
732
|
-
selector: "parameter"
|
|
733
|
-
},
|
|
734
|
-
{
|
|
735
|
-
format: ["StrictPascalCase"],
|
|
736
|
-
selector: "enumMember"
|
|
737
|
-
},
|
|
738
|
-
{
|
|
739
|
-
format: ["UPPER_CASE"],
|
|
740
|
-
leadingUnderscore: "forbid",
|
|
741
|
-
modifiers: ["global"],
|
|
742
|
-
selector: "variable",
|
|
743
|
-
trailingUnderscore: "forbid",
|
|
744
|
-
types: [
|
|
745
|
-
"boolean",
|
|
746
|
-
"number",
|
|
747
|
-
"string"
|
|
748
|
-
]
|
|
749
|
-
},
|
|
750
|
-
{
|
|
751
|
-
filter: {
|
|
752
|
-
match: false,
|
|
753
|
-
regex: "^success$"
|
|
754
|
-
},
|
|
755
|
-
format: ["PascalCase"],
|
|
756
|
-
prefix: [
|
|
757
|
-
"is",
|
|
758
|
-
"should",
|
|
759
|
-
"has",
|
|
760
|
-
"can",
|
|
761
|
-
"did",
|
|
762
|
-
"will"
|
|
763
|
-
],
|
|
764
|
-
selector: "variable",
|
|
765
|
-
types: ["boolean"]
|
|
766
|
-
},
|
|
767
|
-
{
|
|
768
|
-
filter: {
|
|
769
|
-
match: false,
|
|
770
|
-
regex: "^success$"
|
|
771
|
-
},
|
|
772
|
-
format: ["UPPER_CASE"],
|
|
773
|
-
modifiers: ["global"],
|
|
774
|
-
prefix: [
|
|
775
|
-
"IS_",
|
|
776
|
-
"SHOULD_",
|
|
777
|
-
"HAS_",
|
|
778
|
-
"CAN_",
|
|
779
|
-
"DID_",
|
|
780
|
-
"WILL_"
|
|
781
|
-
],
|
|
782
|
-
selector: "variable",
|
|
783
|
-
types: ["boolean"]
|
|
784
|
-
},
|
|
785
|
-
{
|
|
786
|
-
format: ["strictCamelCase"],
|
|
787
|
-
selector: ["function", "classMethod"]
|
|
788
|
-
},
|
|
789
|
-
{
|
|
790
|
-
format: ["strictCamelCase"],
|
|
791
|
-
selector: ["method"]
|
|
792
|
-
},
|
|
793
|
-
{
|
|
794
|
-
format: ["strictCamelCase"],
|
|
795
|
-
leadingUnderscore: "forbid",
|
|
796
|
-
selector: "classProperty"
|
|
797
|
-
},
|
|
798
|
-
{
|
|
799
|
-
format: ["UPPER_CASE"],
|
|
800
|
-
modifiers: ["static", "readonly"],
|
|
801
|
-
selector: "classProperty"
|
|
802
|
-
},
|
|
803
|
-
{
|
|
804
|
-
format: null,
|
|
805
|
-
selector: "objectLiteralProperty"
|
|
806
|
-
},
|
|
807
|
-
{
|
|
808
|
-
format: ["StrictPascalCase"],
|
|
809
|
-
selector: "typeLike"
|
|
810
|
-
},
|
|
811
|
-
{
|
|
812
|
-
format: ["StrictPascalCase"],
|
|
813
|
-
selector: "objectStyleEnum"
|
|
814
|
-
},
|
|
815
|
-
{
|
|
816
|
-
format: ["strictCamelCase", "UPPER_CASE"],
|
|
817
|
-
modifiers: ["global"],
|
|
818
|
-
selector: "variable"
|
|
819
|
-
},
|
|
820
|
-
{
|
|
821
|
-
format: null,
|
|
822
|
-
modifiers: ["destructured", "global"],
|
|
823
|
-
selector: "variable"
|
|
824
|
-
}
|
|
825
|
-
],
|
|
826
|
-
...overridesTypeAware
|
|
827
|
-
}
|
|
828
|
-
}] : [],
|
|
829
|
-
...isTypeAware ? [{
|
|
830
|
-
name: "isentinel/flawless/tsx/rules-type-aware",
|
|
831
|
-
files: tsxFilesTypeAware,
|
|
832
|
-
ignores: ignoresTypeAware,
|
|
833
|
-
rules: {
|
|
834
|
-
"flawless/naming-convention": [
|
|
835
|
-
"error",
|
|
836
|
-
{
|
|
837
|
-
format: ["strictCamelCase"],
|
|
838
|
-
selector: "default"
|
|
839
|
-
},
|
|
840
|
-
{
|
|
841
|
-
format: ["PascalCase", "strictCamelCase"],
|
|
842
|
-
selector: ["objectLiteralMethod", "objectLiteralProperty"]
|
|
843
|
-
},
|
|
844
|
-
{
|
|
845
|
-
format: ["strictCamelCase", "StrictPascalCase"],
|
|
846
|
-
selector: "typeProperty"
|
|
847
|
-
},
|
|
848
|
-
{
|
|
849
|
-
format: null,
|
|
850
|
-
selector: "import"
|
|
851
|
-
},
|
|
852
|
-
{
|
|
853
|
-
format: ["strictCamelCase"],
|
|
854
|
-
leadingUnderscore: "allow",
|
|
855
|
-
selector: "variable"
|
|
856
|
-
},
|
|
857
|
-
{
|
|
858
|
-
custom: {
|
|
859
|
-
match: true,
|
|
860
|
-
regex: "React"
|
|
861
|
-
},
|
|
862
|
-
format: ["StrictPascalCase"],
|
|
863
|
-
leadingUnderscore: "allow",
|
|
864
|
-
selector: "variable"
|
|
865
|
-
},
|
|
866
|
-
{
|
|
867
|
-
format: null,
|
|
868
|
-
modifiers: ["destructured"],
|
|
869
|
-
selector: "parameter"
|
|
870
|
-
},
|
|
871
|
-
{
|
|
872
|
-
format: ["strictCamelCase"],
|
|
873
|
-
leadingUnderscore: "allow",
|
|
874
|
-
selector: "parameter"
|
|
875
|
-
},
|
|
876
|
-
{
|
|
877
|
-
format: ["StrictPascalCase"],
|
|
878
|
-
selector: "enumMember"
|
|
879
|
-
},
|
|
880
|
-
{
|
|
881
|
-
format: ["UPPER_CASE"],
|
|
882
|
-
leadingUnderscore: "forbid",
|
|
883
|
-
modifiers: ["global"],
|
|
884
|
-
selector: "variable",
|
|
885
|
-
trailingUnderscore: "forbid",
|
|
886
|
-
types: [
|
|
887
|
-
"boolean",
|
|
888
|
-
"number",
|
|
889
|
-
"string"
|
|
890
|
-
]
|
|
891
|
-
},
|
|
892
|
-
{
|
|
893
|
-
filter: {
|
|
894
|
-
match: false,
|
|
895
|
-
regex: "^success$"
|
|
896
|
-
},
|
|
897
|
-
format: ["PascalCase"],
|
|
898
|
-
prefix: [
|
|
899
|
-
"is",
|
|
900
|
-
"should",
|
|
901
|
-
"has",
|
|
902
|
-
"can",
|
|
903
|
-
"did",
|
|
904
|
-
"will"
|
|
905
|
-
],
|
|
906
|
-
selector: "variable",
|
|
907
|
-
types: ["boolean"]
|
|
908
|
-
},
|
|
909
|
-
{
|
|
910
|
-
filter: {
|
|
911
|
-
match: false,
|
|
912
|
-
regex: "^success$"
|
|
913
|
-
},
|
|
914
|
-
format: ["UPPER_CASE"],
|
|
915
|
-
modifiers: ["global"],
|
|
916
|
-
prefix: [
|
|
917
|
-
"IS_",
|
|
918
|
-
"SHOULD_",
|
|
919
|
-
"HAS_",
|
|
920
|
-
"CAN_",
|
|
921
|
-
"DID_",
|
|
922
|
-
"WILL_"
|
|
923
|
-
],
|
|
924
|
-
selector: "variable",
|
|
925
|
-
types: ["boolean"]
|
|
926
|
-
},
|
|
927
|
-
{
|
|
928
|
-
format: ["strictCamelCase", "StrictPascalCase"],
|
|
929
|
-
selector: "function"
|
|
930
|
-
},
|
|
931
|
-
{
|
|
932
|
-
format: ["strictCamelCase"],
|
|
933
|
-
leadingUnderscore: "forbid",
|
|
934
|
-
selector: "classProperty"
|
|
935
|
-
},
|
|
936
|
-
{
|
|
937
|
-
format: ["UPPER_CASE"],
|
|
938
|
-
modifiers: ["static", "readonly"],
|
|
939
|
-
selector: "classProperty"
|
|
940
|
-
},
|
|
941
|
-
{
|
|
942
|
-
format: null,
|
|
943
|
-
selector: "objectLiteralProperty"
|
|
944
|
-
},
|
|
945
|
-
{
|
|
946
|
-
format: ["StrictPascalCase"],
|
|
947
|
-
selector: "typeLike"
|
|
948
|
-
},
|
|
949
|
-
{
|
|
950
|
-
format: ["StrictPascalCase"],
|
|
951
|
-
selector: "objectStyleEnum"
|
|
952
|
-
},
|
|
953
|
-
{
|
|
954
|
-
format: [
|
|
955
|
-
"strictCamelCase",
|
|
956
|
-
"UPPER_CASE",
|
|
957
|
-
"StrictPascalCase"
|
|
958
|
-
],
|
|
959
|
-
modifiers: ["global"],
|
|
960
|
-
selector: "variable"
|
|
961
|
-
},
|
|
962
|
-
{
|
|
963
|
-
format: null,
|
|
964
|
-
modifiers: ["destructured", "global"],
|
|
965
|
-
selector: "variable"
|
|
966
|
-
},
|
|
967
|
-
{
|
|
968
|
-
format: null,
|
|
969
|
-
modifiers: ["destructured"],
|
|
970
|
-
selector: "variable"
|
|
971
|
-
}
|
|
972
|
-
],
|
|
973
|
-
...overridesTypeAware
|
|
974
|
-
}
|
|
975
|
-
}] : []
|
|
976
|
-
];
|
|
682
|
+
async function flawless({ stylistic = true } = {}) {
|
|
683
|
+
return [{
|
|
684
|
+
name: "isentinel/flawless/setup",
|
|
685
|
+
plugins: { flawless: await interopDefault(import("eslint-plugin-flawless")) }
|
|
686
|
+
}, {
|
|
687
|
+
name: "isentinel/flawless/rules",
|
|
688
|
+
files: [GLOB_TS],
|
|
689
|
+
rules: { ...stylistic !== false ? { "flawless/prefer-parameter-destructuring": "warn" } : {} }
|
|
690
|
+
}];
|
|
977
691
|
}
|
|
978
692
|
//#endregion
|
|
979
693
|
//#region node_modules/.pnpm/@eslint+compat@2.1.0_eslint@10.6.0_jiti@2.7.0_/node_modules/@eslint/compat/dist/esm/index.js
|
|
@@ -1119,8 +833,7 @@ var init_dist = __esmMin((() => {
|
|
|
1119
833
|
}));
|
|
1120
834
|
//#endregion
|
|
1121
835
|
//#region src/configs/gitignore.ts
|
|
1122
|
-
async function gitignore(
|
|
1123
|
-
const { config = true, explicit = false } = options;
|
|
836
|
+
async function gitignore({ config = true, explicit = false } = {}) {
|
|
1124
837
|
if (config === false) return [];
|
|
1125
838
|
if (typeof config !== "boolean") return [(await interopDefault(Promise.resolve().then(() => (init_dist(), dist_exports))))({
|
|
1126
839
|
...config,
|
|
@@ -1129,14 +842,21 @@ async function gitignore(options = {}) {
|
|
|
1129
842
|
const resolved = await interopDefault(Promise.resolve().then(() => (init_dist(), dist_exports)));
|
|
1130
843
|
const foundGitignore = findUpSync(".gitignore", { cwd: process.cwd() });
|
|
1131
844
|
const foundGitExclude = findUpSync(".git/info/exclude", { cwd: process.cwd() });
|
|
1132
|
-
const
|
|
1133
|
-
if (foundGitignore !== void 0) files.push(foundGitignore);
|
|
1134
|
-
if (foundGitExclude !== void 0) files.push(foundGitExclude);
|
|
1135
|
-
return [resolved({
|
|
845
|
+
const result = resolved({
|
|
1136
846
|
name: "isentinel/gitignore",
|
|
1137
|
-
files,
|
|
1138
|
-
strict: explicit
|
|
1139
|
-
})
|
|
847
|
+
files: foundGitignore !== void 0 ? [foundGitignore] : [],
|
|
848
|
+
strict: explicit && foundGitExclude === void 0
|
|
849
|
+
});
|
|
850
|
+
if (foundGitExclude !== void 0) {
|
|
851
|
+
const exclude = resolved({
|
|
852
|
+
cwd: path.dirname(foundGitExclude),
|
|
853
|
+
files: [foundGitExclude],
|
|
854
|
+
filesGitModules: [],
|
|
855
|
+
strict: false
|
|
856
|
+
});
|
|
857
|
+
result.ignores = [...result.ignores, ...exclude.ignores];
|
|
858
|
+
}
|
|
859
|
+
return [result];
|
|
1140
860
|
}
|
|
1141
861
|
//#endregion
|
|
1142
862
|
//#region src/configs/ignores.ts
|
|
@@ -1148,8 +868,7 @@ async function ignores(userIgnores = []) {
|
|
|
1148
868
|
}
|
|
1149
869
|
//#endregion
|
|
1150
870
|
//#region src/configs/imports.ts
|
|
1151
|
-
async function imports(
|
|
1152
|
-
const { stylistic = true, type = "game" } = options;
|
|
871
|
+
async function imports({ stylistic = true, type = "game" } = {}) {
|
|
1153
872
|
const [pluginImport, pluginAntfu] = await Promise.all([interopDefault(import("eslint-plugin-import-lite")), interopDefault(import("eslint-plugin-antfu"))]);
|
|
1154
873
|
return [{
|
|
1155
874
|
name: "isentinel/imports/rules",
|
|
@@ -1181,8 +900,7 @@ async function imports(options = {}) {
|
|
|
1181
900
|
}
|
|
1182
901
|
//#endregion
|
|
1183
902
|
//#region src/configs/javascript.ts
|
|
1184
|
-
async function javascript(
|
|
1185
|
-
const { isInEditor = false, overrides = {}, roblox = true, stylistic = true } = options;
|
|
903
|
+
async function javascript({ isInEditor = false, overrides = {}, roblox = true, stylistic = true } = {}) {
|
|
1186
904
|
const [pluginAntfu, pluginDeMorgan, pluginMaxParameters, pluginUnusedImports] = await Promise.all([
|
|
1187
905
|
interopDefault(import("eslint-plugin-antfu")),
|
|
1188
906
|
interopDefault(import("eslint-plugin-de-morgan")),
|
|
@@ -1438,236 +1156,526 @@ async function javascript(options = {}) {
|
|
|
1438
1156
|
"no-multi-str": "error",
|
|
1439
1157
|
"object-shorthand": [
|
|
1440
1158
|
"error",
|
|
1441
|
-
"always",
|
|
1159
|
+
"always",
|
|
1160
|
+
{
|
|
1161
|
+
avoidQuotes: true,
|
|
1162
|
+
ignoreConstructors: false
|
|
1163
|
+
}
|
|
1164
|
+
],
|
|
1165
|
+
"one-var": ["error", { initialized: "never" }],
|
|
1166
|
+
"yoda": ["error", "never"],
|
|
1167
|
+
...!roblox ? { "func-style": ["error", "declaration"] } : {}
|
|
1168
|
+
} : {},
|
|
1169
|
+
...overrides
|
|
1170
|
+
}
|
|
1171
|
+
}];
|
|
1172
|
+
}
|
|
1173
|
+
//#endregion
|
|
1174
|
+
//#region src/configs/jsdoc.ts
|
|
1175
|
+
async function jsdoc({ full = false, stylistic = true, type = "game" } = {}) {
|
|
1176
|
+
const isPackage = type === "package" || full;
|
|
1177
|
+
return [{
|
|
1178
|
+
name: "isentinel/jsdoc/setup",
|
|
1179
|
+
plugins: { jsdoc: await interopDefault(import("eslint-plugin-jsdoc")) }
|
|
1180
|
+
}, {
|
|
1181
|
+
name: "isentinel/jsdoc",
|
|
1182
|
+
files: [GLOB_SRC],
|
|
1183
|
+
rules: {
|
|
1184
|
+
"jsdoc/check-access": "warn",
|
|
1185
|
+
"jsdoc/check-param-names": ["warn", { checkDestructured: false }],
|
|
1186
|
+
"jsdoc/check-property-names": "warn",
|
|
1187
|
+
"jsdoc/check-types": "warn",
|
|
1188
|
+
"jsdoc/empty-tags": "warn",
|
|
1189
|
+
"jsdoc/implements-on-classes": "warn",
|
|
1190
|
+
"jsdoc/informative-docs": "warn",
|
|
1191
|
+
"jsdoc/no-defaults": "warn",
|
|
1192
|
+
"jsdoc/no-types": "warn",
|
|
1193
|
+
"jsdoc/no-undefined-types": "error",
|
|
1194
|
+
"jsdoc/require-description": ["warn", { exemptedBy: [
|
|
1195
|
+
"hidden",
|
|
1196
|
+
"ignore",
|
|
1197
|
+
"inheritdoc",
|
|
1198
|
+
"client",
|
|
1199
|
+
"server",
|
|
1200
|
+
"see",
|
|
1201
|
+
"metadata"
|
|
1202
|
+
] }],
|
|
1203
|
+
"jsdoc/require-description-complete-sentence": "warn",
|
|
1204
|
+
"jsdoc/require-param-description": "warn",
|
|
1205
|
+
"jsdoc/require-param-name": "warn",
|
|
1206
|
+
"jsdoc/require-property": "warn",
|
|
1207
|
+
"jsdoc/require-property-description": "warn",
|
|
1208
|
+
"jsdoc/require-property-name": "warn",
|
|
1209
|
+
"jsdoc/require-rejects": "error",
|
|
1210
|
+
"jsdoc/require-returns-check": "warn",
|
|
1211
|
+
"jsdoc/require-returns-description": "warn",
|
|
1212
|
+
"jsdoc/require-yields-check": "warn",
|
|
1213
|
+
"jsdoc/sort-tags": "off",
|
|
1214
|
+
...isPackage ? {
|
|
1215
|
+
"jsdoc/require-param": ["warn", {
|
|
1216
|
+
checkDestructured: false,
|
|
1217
|
+
exemptedBy: ["ignore"]
|
|
1218
|
+
}],
|
|
1219
|
+
"jsdoc/require-returns": ["warn", { exemptedBy: ["hidden"] }],
|
|
1220
|
+
"jsdoc/require-template": "warn"
|
|
1221
|
+
} : {},
|
|
1222
|
+
...stylistic !== false ? {
|
|
1223
|
+
"jsdoc/check-alignment": "warn",
|
|
1224
|
+
"jsdoc/convert-to-jsdoc-comments": "warn",
|
|
1225
|
+
"jsdoc/multiline-blocks": "warn",
|
|
1226
|
+
"jsdoc/no-blank-block-descriptions": "warn",
|
|
1227
|
+
"jsdoc/no-blank-blocks": "warn",
|
|
1228
|
+
"jsdoc/no-multi-asterisks": "warn",
|
|
1229
|
+
"jsdoc/require-asterisk-prefix": "warn",
|
|
1230
|
+
"jsdoc/require-hyphen-before-param-description": "warn"
|
|
1231
|
+
} : {}
|
|
1232
|
+
}
|
|
1233
|
+
}];
|
|
1234
|
+
}
|
|
1235
|
+
//#endregion
|
|
1236
|
+
//#region src/configs/jsonc.ts
|
|
1237
|
+
async function jsonc({ files = [
|
|
1238
|
+
GLOB_JSON,
|
|
1239
|
+
GLOB_JSON5,
|
|
1240
|
+
GLOB_JSONC
|
|
1241
|
+
], overrides = {}, stylistic = true } = {}) {
|
|
1242
|
+
const defaults = resolveWithDefaults(stylistic, {});
|
|
1243
|
+
const { indent = "tab" } = defaults === false ? {} : defaults;
|
|
1244
|
+
const indentValue = typeof indent === "number" || indent === "tab" ? indent : "tab";
|
|
1245
|
+
const [pluginJsonc, parserJsonc] = await Promise.all([interopDefault(import("eslint-plugin-jsonc")), interopDefault(import("jsonc-eslint-parser"))]);
|
|
1246
|
+
return [{
|
|
1247
|
+
name: "isentinel/jsonc/setup",
|
|
1248
|
+
plugins: { jsonc: pluginJsonc }
|
|
1249
|
+
}, {
|
|
1250
|
+
name: "isentinel/jsonc/rules",
|
|
1251
|
+
files,
|
|
1252
|
+
languageOptions: { parser: parserJsonc },
|
|
1253
|
+
rules: {
|
|
1254
|
+
"jsonc/no-bigint-literals": "error",
|
|
1255
|
+
"jsonc/no-binary-expression": "error",
|
|
1256
|
+
"jsonc/no-binary-numeric-literals": "error",
|
|
1257
|
+
"jsonc/no-dupe-keys": "error",
|
|
1258
|
+
"jsonc/no-escape-sequence-in-identifier": "error",
|
|
1259
|
+
"jsonc/no-floating-decimal": "error",
|
|
1260
|
+
"jsonc/no-hexadecimal-numeric-literals": "error",
|
|
1261
|
+
"jsonc/no-infinity": "error",
|
|
1262
|
+
"jsonc/no-multi-str": "error",
|
|
1263
|
+
"jsonc/no-nan": "error",
|
|
1264
|
+
"jsonc/no-number-props": "error",
|
|
1265
|
+
"jsonc/no-numeric-separators": "error",
|
|
1266
|
+
"jsonc/no-octal": "error",
|
|
1267
|
+
"jsonc/no-octal-escape": "error",
|
|
1268
|
+
"jsonc/no-octal-numeric-literals": "error",
|
|
1269
|
+
"jsonc/no-parenthesized": "error",
|
|
1270
|
+
"jsonc/no-plus-sign": "error",
|
|
1271
|
+
"jsonc/no-regexp-literals": "error",
|
|
1272
|
+
"jsonc/no-sparse-arrays": "error",
|
|
1273
|
+
"jsonc/no-template-literals": "error",
|
|
1274
|
+
"jsonc/no-undefined-value": "error",
|
|
1275
|
+
"jsonc/no-unicode-codepoint-escapes": "error",
|
|
1276
|
+
"jsonc/no-useless-escape": "error",
|
|
1277
|
+
"jsonc/space-unary-ops": "error",
|
|
1278
|
+
"jsonc/valid-json-number": "error",
|
|
1279
|
+
...stylistic !== false ? {
|
|
1280
|
+
"jsonc/array-bracket-spacing": ["error", "never"],
|
|
1281
|
+
"jsonc/comma-dangle": "off",
|
|
1282
|
+
"jsonc/comma-style": ["error", "last"],
|
|
1283
|
+
"jsonc/indent": ["error", indentValue],
|
|
1284
|
+
"jsonc/key-spacing": ["error", {
|
|
1285
|
+
afterColon: true,
|
|
1286
|
+
beforeColon: false
|
|
1287
|
+
}],
|
|
1288
|
+
"jsonc/object-curly-newline": ["error", {
|
|
1289
|
+
consistent: true,
|
|
1290
|
+
multiline: true
|
|
1291
|
+
}],
|
|
1292
|
+
"jsonc/object-curly-spacing": ["error", "always"],
|
|
1293
|
+
"jsonc/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
|
|
1294
|
+
"jsonc/quote-props": "error",
|
|
1295
|
+
"jsonc/quotes": "error"
|
|
1296
|
+
} : {},
|
|
1297
|
+
...overrides
|
|
1298
|
+
}
|
|
1299
|
+
}];
|
|
1300
|
+
}
|
|
1301
|
+
//#endregion
|
|
1302
|
+
//#region src/configs/markdown.ts
|
|
1303
|
+
async function markdown({ componentExts: componentExtensions = [], files = [GLOB_MARKDOWN], overrides = {}, type = "game" } = {}) {
|
|
1304
|
+
const markdownPlugin = await interopDefault(import("@eslint/markdown"));
|
|
1305
|
+
return [
|
|
1306
|
+
{
|
|
1307
|
+
name: "isentinel/markdown/setup",
|
|
1308
|
+
plugins: { markdown: markdownPlugin }
|
|
1309
|
+
},
|
|
1310
|
+
{
|
|
1311
|
+
name: "isentinel/markdown/processor",
|
|
1312
|
+
files,
|
|
1313
|
+
ignores: [GLOB_MARKDOWN_IN_MARKDOWN],
|
|
1314
|
+
processor: mergeProcessors([markdownPlugin.processors.markdown, processorPassThrough])
|
|
1315
|
+
},
|
|
1316
|
+
{
|
|
1317
|
+
name: "isentinel/markdown/parser",
|
|
1318
|
+
files,
|
|
1319
|
+
language: "markdown/gfm",
|
|
1320
|
+
languageOptions: { frontmatter: "yaml" },
|
|
1321
|
+
rules: {
|
|
1322
|
+
"markdown/fenced-code-language": "error",
|
|
1323
|
+
"markdown/no-duplicate-definitions": "error",
|
|
1324
|
+
"markdown/no-empty-definitions": "error",
|
|
1325
|
+
"markdown/no-empty-images": "error",
|
|
1326
|
+
"markdown/no-empty-links": "error",
|
|
1327
|
+
"markdown/no-html": "off",
|
|
1328
|
+
"markdown/no-invalid-label-refs": "error",
|
|
1329
|
+
"markdown/no-missing-atx-heading-space": "error",
|
|
1330
|
+
"markdown/no-missing-label-refs": "off",
|
|
1331
|
+
"markdown/no-missing-link-fragments": "error",
|
|
1332
|
+
"markdown/no-multiple-h1": "error",
|
|
1333
|
+
"markdown/no-reversed-media-syntax": "error",
|
|
1334
|
+
"markdown/no-unused-definitions": "warn",
|
|
1335
|
+
"markdown/require-alt-text": "error",
|
|
1336
|
+
"markdown/table-column-count": "error",
|
|
1337
|
+
"style/indent": "off",
|
|
1338
|
+
...type === "package" ? {
|
|
1339
|
+
"markdown/heading-increment": "error",
|
|
1340
|
+
"markdown/no-bare-urls": "error",
|
|
1341
|
+
"markdown/no-duplicate-headings": "error"
|
|
1342
|
+
} : {}
|
|
1343
|
+
}
|
|
1344
|
+
},
|
|
1345
|
+
{
|
|
1346
|
+
name: "isentinel/markdown/disables",
|
|
1347
|
+
files: [GLOB_MARKDOWN_BLOCKS, ...componentExtensions.map((extension) => `${GLOB_MARKDOWN}/**/*.${extension}`)],
|
|
1348
|
+
languageOptions: { parserOptions: { ecmaFeatures: { impliedStrict: true } } },
|
|
1349
|
+
rules: {
|
|
1350
|
+
"antfu/no-top-level-await": "off",
|
|
1351
|
+
"antfu/top-level-function": "off",
|
|
1352
|
+
"import/newline-after-import": "off",
|
|
1353
|
+
"jsdoc/convert-to-jsdoc-comments": "off",
|
|
1354
|
+
"no-alert": "off",
|
|
1355
|
+
"no-console": "off",
|
|
1356
|
+
"no-inline-comments": "off",
|
|
1357
|
+
"no-labels": "off",
|
|
1358
|
+
"no-lone-blocks": "off",
|
|
1359
|
+
"no-restricted-syntax": "off",
|
|
1360
|
+
"no-undef": "off",
|
|
1361
|
+
"no-unused-expressions": "off",
|
|
1362
|
+
"no-unused-labels": "off",
|
|
1363
|
+
"no-unused-vars": "off",
|
|
1364
|
+
"node/prefer-global/process": "off",
|
|
1365
|
+
"sonar/file-name-differ-from-class": "off",
|
|
1366
|
+
"sonar/no-dead-store": "off",
|
|
1367
|
+
"sonar/no-unused-collection": "off",
|
|
1368
|
+
"strict": "off",
|
|
1369
|
+
"style/comma-dangle": "off",
|
|
1370
|
+
"style/eol-last": "off",
|
|
1371
|
+
"style/indent": "off",
|
|
1372
|
+
"style/padded-blocks": "off",
|
|
1373
|
+
"ts/consistent-type-imports": "off",
|
|
1374
|
+
"ts/no-namespace": "off",
|
|
1375
|
+
"ts/no-redeclare": "off",
|
|
1376
|
+
"ts/no-require-imports": "off",
|
|
1377
|
+
"ts/no-unused-vars": "off",
|
|
1378
|
+
"ts/no-use-before-define": "off",
|
|
1379
|
+
"ts/no-var-requires": "off",
|
|
1380
|
+
"unicode-bom": "off",
|
|
1381
|
+
"unused-imports/no-unused-imports": "off",
|
|
1382
|
+
"unused-imports/no-unused-vars": "off",
|
|
1383
|
+
...overrides
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
];
|
|
1387
|
+
}
|
|
1388
|
+
//#endregion
|
|
1389
|
+
//#region src/configs/naming.ts
|
|
1390
|
+
async function naming(options = {}) {
|
|
1391
|
+
const { overridesTypeAware = {}, typeAware = true } = options;
|
|
1392
|
+
const eslintPluginFlawless = await interopDefault(import("eslint-plugin-flawless"));
|
|
1393
|
+
const tsFilesTypeAware = [GLOB_TS];
|
|
1394
|
+
const tsxFilesTypeAware = [GLOB_TSX];
|
|
1395
|
+
const ignoresTypeAware = options.ignoresTypeAware ?? [`**/*.md/**`, "**/*.d.?([cm])ts"];
|
|
1396
|
+
const isTypeAware = (typeAware ? getTsConfig(options.tsconfigPath) : void 0) !== void 0;
|
|
1397
|
+
return [
|
|
1398
|
+
{
|
|
1399
|
+
name: "isentinel/naming/setup",
|
|
1400
|
+
plugins: { flawless: eslintPluginFlawless }
|
|
1401
|
+
},
|
|
1402
|
+
...isTypeAware ? [{
|
|
1403
|
+
name: "isentinel/naming/ts/rules-type-aware",
|
|
1404
|
+
files: tsFilesTypeAware,
|
|
1405
|
+
ignores: ignoresTypeAware,
|
|
1406
|
+
rules: {
|
|
1407
|
+
"flawless/naming-convention": [
|
|
1408
|
+
"error",
|
|
1409
|
+
{
|
|
1410
|
+
format: ["strictCamelCase"],
|
|
1411
|
+
selector: "default"
|
|
1412
|
+
},
|
|
1413
|
+
{
|
|
1414
|
+
format: null,
|
|
1415
|
+
selector: "import"
|
|
1416
|
+
},
|
|
1417
|
+
{
|
|
1418
|
+
format: null,
|
|
1419
|
+
modifiers: ["destructured"],
|
|
1420
|
+
selector: "variable"
|
|
1421
|
+
},
|
|
1422
|
+
{
|
|
1423
|
+
format: ["strictCamelCase"],
|
|
1424
|
+
leadingUnderscore: "allow",
|
|
1425
|
+
selector: "variable"
|
|
1426
|
+
},
|
|
1427
|
+
{
|
|
1428
|
+
format: null,
|
|
1429
|
+
modifiers: ["destructured"],
|
|
1430
|
+
selector: "parameter"
|
|
1431
|
+
},
|
|
1432
|
+
{
|
|
1433
|
+
format: ["strictCamelCase"],
|
|
1434
|
+
leadingUnderscore: "allow",
|
|
1435
|
+
selector: "parameter"
|
|
1436
|
+
},
|
|
1437
|
+
{
|
|
1438
|
+
format: ["StrictPascalCase"],
|
|
1439
|
+
selector: "enumMember"
|
|
1440
|
+
},
|
|
1441
|
+
{
|
|
1442
|
+
format: ["UPPER_CASE"],
|
|
1443
|
+
leadingUnderscore: "forbid",
|
|
1444
|
+
modifiers: ["global"],
|
|
1445
|
+
selector: "variable",
|
|
1446
|
+
trailingUnderscore: "forbid",
|
|
1447
|
+
types: [
|
|
1448
|
+
"boolean",
|
|
1449
|
+
"number",
|
|
1450
|
+
"string"
|
|
1451
|
+
]
|
|
1452
|
+
},
|
|
1453
|
+
{
|
|
1454
|
+
filter: {
|
|
1455
|
+
match: false,
|
|
1456
|
+
regex: "^success$"
|
|
1457
|
+
},
|
|
1458
|
+
format: ["PascalCase"],
|
|
1459
|
+
prefix: [
|
|
1460
|
+
"is",
|
|
1461
|
+
"should",
|
|
1462
|
+
"has",
|
|
1463
|
+
"can",
|
|
1464
|
+
"did",
|
|
1465
|
+
"will"
|
|
1466
|
+
],
|
|
1467
|
+
selector: "variable",
|
|
1468
|
+
types: ["boolean"]
|
|
1469
|
+
},
|
|
1470
|
+
{
|
|
1471
|
+
filter: {
|
|
1472
|
+
match: false,
|
|
1473
|
+
regex: "^success$"
|
|
1474
|
+
},
|
|
1475
|
+
format: ["UPPER_CASE"],
|
|
1476
|
+
modifiers: ["global"],
|
|
1477
|
+
prefix: [
|
|
1478
|
+
"IS_",
|
|
1479
|
+
"SHOULD_",
|
|
1480
|
+
"HAS_",
|
|
1481
|
+
"CAN_",
|
|
1482
|
+
"DID_",
|
|
1483
|
+
"WILL_"
|
|
1484
|
+
],
|
|
1485
|
+
selector: "variable",
|
|
1486
|
+
types: ["boolean"]
|
|
1487
|
+
},
|
|
1488
|
+
{
|
|
1489
|
+
format: ["strictCamelCase"],
|
|
1490
|
+
selector: ["function", "classMethod"]
|
|
1491
|
+
},
|
|
1492
|
+
{
|
|
1493
|
+
format: ["strictCamelCase"],
|
|
1494
|
+
selector: ["method"]
|
|
1495
|
+
},
|
|
1496
|
+
{
|
|
1497
|
+
format: ["strictCamelCase"],
|
|
1498
|
+
leadingUnderscore: "forbid",
|
|
1499
|
+
selector: "classProperty"
|
|
1500
|
+
},
|
|
1501
|
+
{
|
|
1502
|
+
format: ["UPPER_CASE"],
|
|
1503
|
+
modifiers: ["static", "readonly"],
|
|
1504
|
+
selector: "classProperty"
|
|
1505
|
+
},
|
|
1506
|
+
{
|
|
1507
|
+
format: null,
|
|
1508
|
+
selector: "objectLiteralProperty"
|
|
1509
|
+
},
|
|
1510
|
+
{
|
|
1511
|
+
format: ["StrictPascalCase"],
|
|
1512
|
+
selector: "typeLike"
|
|
1513
|
+
},
|
|
1514
|
+
{
|
|
1515
|
+
format: ["StrictPascalCase"],
|
|
1516
|
+
selector: "objectStyleEnum"
|
|
1517
|
+
},
|
|
1518
|
+
{
|
|
1519
|
+
format: ["strictCamelCase", "UPPER_CASE"],
|
|
1520
|
+
modifiers: ["global"],
|
|
1521
|
+
selector: "variable"
|
|
1522
|
+
},
|
|
1523
|
+
{
|
|
1524
|
+
format: null,
|
|
1525
|
+
modifiers: ["destructured", "global"],
|
|
1526
|
+
selector: "variable"
|
|
1527
|
+
}
|
|
1528
|
+
],
|
|
1529
|
+
...overridesTypeAware
|
|
1530
|
+
}
|
|
1531
|
+
}] : [],
|
|
1532
|
+
...isTypeAware ? [{
|
|
1533
|
+
name: "isentinel/naming/tsx/rules-type-aware",
|
|
1534
|
+
files: tsxFilesTypeAware,
|
|
1535
|
+
ignores: ignoresTypeAware,
|
|
1536
|
+
rules: {
|
|
1537
|
+
"flawless/naming-convention": [
|
|
1538
|
+
"error",
|
|
1539
|
+
{
|
|
1540
|
+
format: ["strictCamelCase"],
|
|
1541
|
+
selector: "default"
|
|
1542
|
+
},
|
|
1543
|
+
{
|
|
1544
|
+
format: ["PascalCase", "strictCamelCase"],
|
|
1545
|
+
selector: ["objectLiteralMethod", "objectLiteralProperty"]
|
|
1546
|
+
},
|
|
1547
|
+
{
|
|
1548
|
+
format: ["strictCamelCase", "StrictPascalCase"],
|
|
1549
|
+
selector: "typeProperty"
|
|
1550
|
+
},
|
|
1551
|
+
{
|
|
1552
|
+
format: null,
|
|
1553
|
+
selector: "import"
|
|
1554
|
+
},
|
|
1555
|
+
{
|
|
1556
|
+
format: ["strictCamelCase"],
|
|
1557
|
+
leadingUnderscore: "allow",
|
|
1558
|
+
selector: "variable"
|
|
1559
|
+
},
|
|
1560
|
+
{
|
|
1561
|
+
custom: {
|
|
1562
|
+
match: true,
|
|
1563
|
+
regex: "React"
|
|
1564
|
+
},
|
|
1565
|
+
format: ["StrictPascalCase"],
|
|
1566
|
+
leadingUnderscore: "allow",
|
|
1567
|
+
selector: "variable"
|
|
1568
|
+
},
|
|
1569
|
+
{
|
|
1570
|
+
format: null,
|
|
1571
|
+
modifiers: ["destructured"],
|
|
1572
|
+
selector: "parameter"
|
|
1573
|
+
},
|
|
1574
|
+
{
|
|
1575
|
+
format: ["strictCamelCase"],
|
|
1576
|
+
leadingUnderscore: "allow",
|
|
1577
|
+
selector: "parameter"
|
|
1578
|
+
},
|
|
1579
|
+
{
|
|
1580
|
+
format: ["StrictPascalCase"],
|
|
1581
|
+
selector: "enumMember"
|
|
1582
|
+
},
|
|
1583
|
+
{
|
|
1584
|
+
format: ["UPPER_CASE"],
|
|
1585
|
+
leadingUnderscore: "forbid",
|
|
1586
|
+
modifiers: ["global"],
|
|
1587
|
+
selector: "variable",
|
|
1588
|
+
trailingUnderscore: "forbid",
|
|
1589
|
+
types: [
|
|
1590
|
+
"boolean",
|
|
1591
|
+
"number",
|
|
1592
|
+
"string"
|
|
1593
|
+
]
|
|
1594
|
+
},
|
|
1595
|
+
{
|
|
1596
|
+
filter: {
|
|
1597
|
+
match: false,
|
|
1598
|
+
regex: "^success$"
|
|
1599
|
+
},
|
|
1600
|
+
format: ["PascalCase"],
|
|
1601
|
+
prefix: [
|
|
1602
|
+
"is",
|
|
1603
|
+
"should",
|
|
1604
|
+
"has",
|
|
1605
|
+
"can",
|
|
1606
|
+
"did",
|
|
1607
|
+
"will"
|
|
1608
|
+
],
|
|
1609
|
+
selector: "variable",
|
|
1610
|
+
types: ["boolean"]
|
|
1611
|
+
},
|
|
1612
|
+
{
|
|
1613
|
+
filter: {
|
|
1614
|
+
match: false,
|
|
1615
|
+
regex: "^success$"
|
|
1616
|
+
},
|
|
1617
|
+
format: ["UPPER_CASE"],
|
|
1618
|
+
modifiers: ["global"],
|
|
1619
|
+
prefix: [
|
|
1620
|
+
"IS_",
|
|
1621
|
+
"SHOULD_",
|
|
1622
|
+
"HAS_",
|
|
1623
|
+
"CAN_",
|
|
1624
|
+
"DID_",
|
|
1625
|
+
"WILL_"
|
|
1626
|
+
],
|
|
1627
|
+
selector: "variable",
|
|
1628
|
+
types: ["boolean"]
|
|
1629
|
+
},
|
|
1630
|
+
{
|
|
1631
|
+
format: ["strictCamelCase", "StrictPascalCase"],
|
|
1632
|
+
selector: "function"
|
|
1633
|
+
},
|
|
1442
1634
|
{
|
|
1443
|
-
|
|
1444
|
-
|
|
1635
|
+
format: ["strictCamelCase"],
|
|
1636
|
+
leadingUnderscore: "forbid",
|
|
1637
|
+
selector: "classProperty"
|
|
1638
|
+
},
|
|
1639
|
+
{
|
|
1640
|
+
format: ["UPPER_CASE"],
|
|
1641
|
+
modifiers: ["static", "readonly"],
|
|
1642
|
+
selector: "classProperty"
|
|
1643
|
+
},
|
|
1644
|
+
{
|
|
1645
|
+
format: null,
|
|
1646
|
+
selector: "objectLiteralProperty"
|
|
1647
|
+
},
|
|
1648
|
+
{
|
|
1649
|
+
format: ["StrictPascalCase"],
|
|
1650
|
+
selector: "typeLike"
|
|
1651
|
+
},
|
|
1652
|
+
{
|
|
1653
|
+
format: ["StrictPascalCase"],
|
|
1654
|
+
selector: "objectStyleEnum"
|
|
1655
|
+
},
|
|
1656
|
+
{
|
|
1657
|
+
format: [
|
|
1658
|
+
"strictCamelCase",
|
|
1659
|
+
"UPPER_CASE",
|
|
1660
|
+
"StrictPascalCase"
|
|
1661
|
+
],
|
|
1662
|
+
modifiers: ["global"],
|
|
1663
|
+
selector: "variable"
|
|
1664
|
+
},
|
|
1665
|
+
{
|
|
1666
|
+
format: null,
|
|
1667
|
+
modifiers: ["destructured", "global"],
|
|
1668
|
+
selector: "variable"
|
|
1669
|
+
},
|
|
1670
|
+
{
|
|
1671
|
+
format: null,
|
|
1672
|
+
modifiers: ["destructured"],
|
|
1673
|
+
selector: "variable"
|
|
1445
1674
|
}
|
|
1446
1675
|
],
|
|
1447
|
-
|
|
1448
|
-
"yoda": ["error", "never"],
|
|
1449
|
-
...!roblox ? { "func-style": ["error", "declaration"] } : {}
|
|
1450
|
-
} : {},
|
|
1451
|
-
...overrides
|
|
1452
|
-
}
|
|
1453
|
-
}];
|
|
1454
|
-
}
|
|
1455
|
-
//#endregion
|
|
1456
|
-
//#region src/configs/jsdoc.ts
|
|
1457
|
-
async function jsdoc(options = {}) {
|
|
1458
|
-
const { full = false, stylistic = true, type = "game" } = options;
|
|
1459
|
-
const isPackage = type === "package" || full;
|
|
1460
|
-
return [{
|
|
1461
|
-
name: "isentinel/jsdoc/setup",
|
|
1462
|
-
plugins: { jsdoc: await interopDefault(import("eslint-plugin-jsdoc")) }
|
|
1463
|
-
}, {
|
|
1464
|
-
name: "isentinel/jsdoc",
|
|
1465
|
-
files: [GLOB_SRC],
|
|
1466
|
-
rules: {
|
|
1467
|
-
"jsdoc/check-access": "warn",
|
|
1468
|
-
"jsdoc/check-param-names": ["warn", { checkDestructured: false }],
|
|
1469
|
-
"jsdoc/check-property-names": "warn",
|
|
1470
|
-
"jsdoc/check-types": "warn",
|
|
1471
|
-
"jsdoc/empty-tags": "warn",
|
|
1472
|
-
"jsdoc/implements-on-classes": "warn",
|
|
1473
|
-
"jsdoc/informative-docs": "warn",
|
|
1474
|
-
"jsdoc/no-defaults": "warn",
|
|
1475
|
-
"jsdoc/no-types": "warn",
|
|
1476
|
-
"jsdoc/no-undefined-types": "error",
|
|
1477
|
-
"jsdoc/require-description": ["warn", { exemptedBy: [
|
|
1478
|
-
"hidden",
|
|
1479
|
-
"ignore",
|
|
1480
|
-
"inheritdoc",
|
|
1481
|
-
"client",
|
|
1482
|
-
"server",
|
|
1483
|
-
"see",
|
|
1484
|
-
"metadata"
|
|
1485
|
-
] }],
|
|
1486
|
-
"jsdoc/require-description-complete-sentence": "warn",
|
|
1487
|
-
"jsdoc/require-param-description": "warn",
|
|
1488
|
-
"jsdoc/require-param-name": "warn",
|
|
1489
|
-
"jsdoc/require-property": "warn",
|
|
1490
|
-
"jsdoc/require-property-description": "warn",
|
|
1491
|
-
"jsdoc/require-property-name": "warn",
|
|
1492
|
-
"jsdoc/require-rejects": "error",
|
|
1493
|
-
"jsdoc/require-returns-check": "warn",
|
|
1494
|
-
"jsdoc/require-returns-description": "warn",
|
|
1495
|
-
"jsdoc/require-yields-check": "warn",
|
|
1496
|
-
"jsdoc/sort-tags": "off",
|
|
1497
|
-
...isPackage ? {
|
|
1498
|
-
"jsdoc/require-param": ["warn", {
|
|
1499
|
-
checkDestructured: false,
|
|
1500
|
-
exemptedBy: ["ignore"]
|
|
1501
|
-
}],
|
|
1502
|
-
"jsdoc/require-returns": ["warn", { exemptedBy: ["hidden"] }],
|
|
1503
|
-
"jsdoc/require-template": "warn"
|
|
1504
|
-
} : {},
|
|
1505
|
-
...stylistic !== false ? {
|
|
1506
|
-
"jsdoc/check-alignment": "warn",
|
|
1507
|
-
"jsdoc/convert-to-jsdoc-comments": "warn",
|
|
1508
|
-
"jsdoc/multiline-blocks": "warn",
|
|
1509
|
-
"jsdoc/no-blank-block-descriptions": "warn",
|
|
1510
|
-
"jsdoc/no-blank-blocks": "warn",
|
|
1511
|
-
"jsdoc/no-multi-asterisks": "warn",
|
|
1512
|
-
"jsdoc/require-asterisk-prefix": "warn",
|
|
1513
|
-
"jsdoc/require-hyphen-before-param-description": "warn"
|
|
1514
|
-
} : {}
|
|
1515
|
-
}
|
|
1516
|
-
}];
|
|
1517
|
-
}
|
|
1518
|
-
//#endregion
|
|
1519
|
-
//#region src/configs/jsonc.ts
|
|
1520
|
-
async function jsonc(options = {}) {
|
|
1521
|
-
const { files = [
|
|
1522
|
-
GLOB_JSON,
|
|
1523
|
-
GLOB_JSON5,
|
|
1524
|
-
GLOB_JSONC
|
|
1525
|
-
], overrides = {}, stylistic = true } = options;
|
|
1526
|
-
const defaults = resolveWithDefaults(stylistic, {});
|
|
1527
|
-
const { indent = "tab" } = defaults === false ? {} : defaults;
|
|
1528
|
-
const indentValue = typeof indent === "number" || indent === "tab" ? indent : "tab";
|
|
1529
|
-
const [pluginJsonc, parserJsonc] = await Promise.all([interopDefault(import("eslint-plugin-jsonc")), interopDefault(import("jsonc-eslint-parser"))]);
|
|
1530
|
-
return [{
|
|
1531
|
-
name: "isentinel/jsonc/setup",
|
|
1532
|
-
plugins: { jsonc: pluginJsonc }
|
|
1533
|
-
}, {
|
|
1534
|
-
name: "isentinel/jsonc/rules",
|
|
1535
|
-
files,
|
|
1536
|
-
languageOptions: { parser: parserJsonc },
|
|
1537
|
-
rules: {
|
|
1538
|
-
"jsonc/no-bigint-literals": "error",
|
|
1539
|
-
"jsonc/no-binary-expression": "error",
|
|
1540
|
-
"jsonc/no-binary-numeric-literals": "error",
|
|
1541
|
-
"jsonc/no-dupe-keys": "error",
|
|
1542
|
-
"jsonc/no-escape-sequence-in-identifier": "error",
|
|
1543
|
-
"jsonc/no-floating-decimal": "error",
|
|
1544
|
-
"jsonc/no-hexadecimal-numeric-literals": "error",
|
|
1545
|
-
"jsonc/no-infinity": "error",
|
|
1546
|
-
"jsonc/no-multi-str": "error",
|
|
1547
|
-
"jsonc/no-nan": "error",
|
|
1548
|
-
"jsonc/no-number-props": "error",
|
|
1549
|
-
"jsonc/no-numeric-separators": "error",
|
|
1550
|
-
"jsonc/no-octal": "error",
|
|
1551
|
-
"jsonc/no-octal-escape": "error",
|
|
1552
|
-
"jsonc/no-octal-numeric-literals": "error",
|
|
1553
|
-
"jsonc/no-parenthesized": "error",
|
|
1554
|
-
"jsonc/no-plus-sign": "error",
|
|
1555
|
-
"jsonc/no-regexp-literals": "error",
|
|
1556
|
-
"jsonc/no-sparse-arrays": "error",
|
|
1557
|
-
"jsonc/no-template-literals": "error",
|
|
1558
|
-
"jsonc/no-undefined-value": "error",
|
|
1559
|
-
"jsonc/no-unicode-codepoint-escapes": "error",
|
|
1560
|
-
"jsonc/no-useless-escape": "error",
|
|
1561
|
-
"jsonc/space-unary-ops": "error",
|
|
1562
|
-
"jsonc/valid-json-number": "error",
|
|
1563
|
-
...stylistic !== false ? {
|
|
1564
|
-
"jsonc/array-bracket-spacing": ["error", "never"],
|
|
1565
|
-
"jsonc/comma-dangle": "off",
|
|
1566
|
-
"jsonc/comma-style": ["error", "last"],
|
|
1567
|
-
"jsonc/indent": ["error", indentValue],
|
|
1568
|
-
"jsonc/key-spacing": ["error", {
|
|
1569
|
-
afterColon: true,
|
|
1570
|
-
beforeColon: false
|
|
1571
|
-
}],
|
|
1572
|
-
"jsonc/object-curly-newline": ["error", {
|
|
1573
|
-
consistent: true,
|
|
1574
|
-
multiline: true
|
|
1575
|
-
}],
|
|
1576
|
-
"jsonc/object-curly-spacing": ["error", "always"],
|
|
1577
|
-
"jsonc/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
|
|
1578
|
-
"jsonc/quote-props": "error",
|
|
1579
|
-
"jsonc/quotes": "error"
|
|
1580
|
-
} : {},
|
|
1581
|
-
...overrides
|
|
1582
|
-
}
|
|
1583
|
-
}];
|
|
1584
|
-
}
|
|
1585
|
-
//#endregion
|
|
1586
|
-
//#region src/configs/markdown.ts
|
|
1587
|
-
async function markdown(options = {}) {
|
|
1588
|
-
const { componentExts: componentExtensions = [], files = [GLOB_MARKDOWN], overrides = {}, type = "game" } = options;
|
|
1589
|
-
const markdownPlugin = await interopDefault(import("@eslint/markdown"));
|
|
1590
|
-
return [
|
|
1591
|
-
{
|
|
1592
|
-
name: "isentinel/markdown/setup",
|
|
1593
|
-
plugins: { markdown: markdownPlugin }
|
|
1594
|
-
},
|
|
1595
|
-
{
|
|
1596
|
-
name: "isentinel/markdown/processor",
|
|
1597
|
-
files,
|
|
1598
|
-
ignores: [GLOB_MARKDOWN_IN_MARKDOWN],
|
|
1599
|
-
processor: mergeProcessors([markdownPlugin.processors.markdown, processorPassThrough])
|
|
1600
|
-
},
|
|
1601
|
-
{
|
|
1602
|
-
name: "isentinel/markdown/parser",
|
|
1603
|
-
files,
|
|
1604
|
-
language: "markdown/gfm",
|
|
1605
|
-
languageOptions: { frontmatter: "yaml" },
|
|
1606
|
-
rules: {
|
|
1607
|
-
"markdown/fenced-code-language": "error",
|
|
1608
|
-
"markdown/no-duplicate-definitions": "error",
|
|
1609
|
-
"markdown/no-empty-definitions": "error",
|
|
1610
|
-
"markdown/no-empty-images": "error",
|
|
1611
|
-
"markdown/no-empty-links": "error",
|
|
1612
|
-
"markdown/no-html": "off",
|
|
1613
|
-
"markdown/no-invalid-label-refs": "error",
|
|
1614
|
-
"markdown/no-missing-atx-heading-space": "error",
|
|
1615
|
-
"markdown/no-missing-label-refs": "off",
|
|
1616
|
-
"markdown/no-missing-link-fragments": "error",
|
|
1617
|
-
"markdown/no-multiple-h1": "error",
|
|
1618
|
-
"markdown/no-reversed-media-syntax": "error",
|
|
1619
|
-
"markdown/no-unused-definitions": "warn",
|
|
1620
|
-
"markdown/require-alt-text": "error",
|
|
1621
|
-
"markdown/table-column-count": "error",
|
|
1622
|
-
"style/indent": "off",
|
|
1623
|
-
...type === "package" ? {
|
|
1624
|
-
"markdown/heading-increment": "error",
|
|
1625
|
-
"markdown/no-bare-urls": "error",
|
|
1626
|
-
"markdown/no-duplicate-headings": "error"
|
|
1627
|
-
} : {}
|
|
1628
|
-
}
|
|
1629
|
-
},
|
|
1630
|
-
{
|
|
1631
|
-
name: "isentinel/markdown/disables",
|
|
1632
|
-
files: [GLOB_MARKDOWN_BLOCKS, ...componentExtensions.map((extension) => `${GLOB_MARKDOWN}/**/*.${extension}`)],
|
|
1633
|
-
languageOptions: { parserOptions: { ecmaFeatures: { impliedStrict: true } } },
|
|
1634
|
-
rules: {
|
|
1635
|
-
"antfu/no-top-level-await": "off",
|
|
1636
|
-
"antfu/top-level-function": "off",
|
|
1637
|
-
"import/newline-after-import": "off",
|
|
1638
|
-
"jsdoc/convert-to-jsdoc-comments": "off",
|
|
1639
|
-
"no-alert": "off",
|
|
1640
|
-
"no-console": "off",
|
|
1641
|
-
"no-inline-comments": "off",
|
|
1642
|
-
"no-labels": "off",
|
|
1643
|
-
"no-lone-blocks": "off",
|
|
1644
|
-
"no-restricted-syntax": "off",
|
|
1645
|
-
"no-undef": "off",
|
|
1646
|
-
"no-unused-expressions": "off",
|
|
1647
|
-
"no-unused-labels": "off",
|
|
1648
|
-
"no-unused-vars": "off",
|
|
1649
|
-
"node/prefer-global/process": "off",
|
|
1650
|
-
"sonar/file-name-differ-from-class": "off",
|
|
1651
|
-
"sonar/no-dead-store": "off",
|
|
1652
|
-
"sonar/no-unused-collection": "off",
|
|
1653
|
-
"strict": "off",
|
|
1654
|
-
"style/comma-dangle": "off",
|
|
1655
|
-
"style/eol-last": "off",
|
|
1656
|
-
"style/indent": "off",
|
|
1657
|
-
"style/padded-blocks": "off",
|
|
1658
|
-
"ts/consistent-type-imports": "off",
|
|
1659
|
-
"ts/no-namespace": "off",
|
|
1660
|
-
"ts/no-redeclare": "off",
|
|
1661
|
-
"ts/no-require-imports": "off",
|
|
1662
|
-
"ts/no-unused-vars": "off",
|
|
1663
|
-
"ts/no-use-before-define": "off",
|
|
1664
|
-
"ts/no-var-requires": "off",
|
|
1665
|
-
"unicode-bom": "off",
|
|
1666
|
-
"unused-imports/no-unused-imports": "off",
|
|
1667
|
-
"unused-imports/no-unused-vars": "off",
|
|
1668
|
-
...overrides
|
|
1676
|
+
...overridesTypeAware
|
|
1669
1677
|
}
|
|
1670
|
-
}
|
|
1678
|
+
}] : []
|
|
1671
1679
|
];
|
|
1672
1680
|
}
|
|
1673
1681
|
//#endregion
|
|
@@ -1701,8 +1709,7 @@ async function jsx() {
|
|
|
1701
1709
|
}
|
|
1702
1710
|
//#endregion
|
|
1703
1711
|
//#region src/configs/package-json.ts
|
|
1704
|
-
async function packageJson(
|
|
1705
|
-
const { roblox = true, stylistic = true, type = "game" } = options;
|
|
1712
|
+
async function packageJson({ roblox = true, stylistic = true, type = "game" } = {}) {
|
|
1706
1713
|
const [jsoncEslintParser, pluginPackageJson, rootDirectory] = await Promise.all([
|
|
1707
1714
|
interopDefault(import("jsonc-eslint-parser")),
|
|
1708
1715
|
interopDefault(import("eslint-plugin-package-json")),
|
|
@@ -1979,7 +1986,7 @@ async function isentinel(options, ...userConfigs) {
|
|
|
1979
1986
|
}), comments({
|
|
1980
1987
|
prettierOptions: prettierSettings,
|
|
1981
1988
|
stylistic: stylisticOptions
|
|
1982
|
-
}), ignores(options.ignores), imports({
|
|
1989
|
+
}), flawless({ stylistic: stylisticOptions }), ignores(options.ignores), imports({
|
|
1983
1990
|
stylistic: stylisticOptions,
|
|
1984
1991
|
type: projectType
|
|
1985
1992
|
}), packageJson({
|
|
@@ -2001,7 +2008,7 @@ async function isentinel(options, ...userConfigs) {
|
|
|
2001
2008
|
root: rootGlobs,
|
|
2002
2009
|
stylistic: stylisticOptions
|
|
2003
2010
|
}));
|
|
2004
|
-
if (options.
|
|
2011
|
+
if (options.naming === true) configs.push(naming({ ...getOverrides(options, "naming") }));
|
|
2005
2012
|
if (enableJsdoc !== false) configs.push(jsdoc({
|
|
2006
2013
|
stylistic: stylisticOptions,
|
|
2007
2014
|
type: projectType
|
|
@@ -2852,8 +2859,7 @@ async function roblox(options = {}, formatLua = true) {
|
|
|
2852
2859
|
}
|
|
2853
2860
|
//#endregion
|
|
2854
2861
|
//#region src/configs/sonarjs.ts
|
|
2855
|
-
async function sonarjs(
|
|
2856
|
-
const { isInEditor } = options;
|
|
2862
|
+
async function sonarjs({ isInEditor }) {
|
|
2857
2863
|
return [{
|
|
2858
2864
|
name: "isentinel/sonarjs",
|
|
2859
2865
|
plugins: { sonar: await interopDefault(import("eslint-plugin-sonarjs")) },
|
|
@@ -3791,8 +3797,7 @@ async function stylistic(options = {}, prettierOptions = {}) {
|
|
|
3791
3797
|
let pluginTest;
|
|
3792
3798
|
let pluginJestExtended;
|
|
3793
3799
|
let pluginVitest;
|
|
3794
|
-
async function test(
|
|
3795
|
-
const { files = GLOB_TESTS, isInEditor = false, jest = false, overrides = {}, roblox: isRoblox = true, stylistic = true, type = "game", vitest = false } = options;
|
|
3800
|
+
async function test({ files = GLOB_TESTS, isInEditor = false, jest = false, overrides = {}, roblox: isRoblox = true, stylistic = true, type = "game", vitest = false } = {}) {
|
|
3796
3801
|
const vitestOptions = typeof vitest === "object" ? vitest : {};
|
|
3797
3802
|
const vitestEnabled = vitest === true || typeof vitest === "object";
|
|
3798
3803
|
const jestOptions = typeof jest === "object" ? jest : {};
|
|
@@ -4008,8 +4013,7 @@ async function test(options = {}) {
|
|
|
4008
4013
|
}
|
|
4009
4014
|
//#endregion
|
|
4010
4015
|
//#region src/configs/toml.ts
|
|
4011
|
-
async function toml(
|
|
4012
|
-
const { files = [GLOB_TOML], overrides = {}, stylistic = true } = options;
|
|
4016
|
+
async function toml({ files = [GLOB_TOML], overrides = {}, stylistic = true } = {}) {
|
|
4013
4017
|
const defaults = resolveWithDefaults(stylistic, {});
|
|
4014
4018
|
const { indent = 2 } = defaults === false ? {} : defaults;
|
|
4015
4019
|
const indentValue = typeof indent === "number" ? indent : 2;
|
|
@@ -4274,8 +4278,7 @@ const abbreviations = {
|
|
|
4274
4278
|
util: false,
|
|
4275
4279
|
utils: false
|
|
4276
4280
|
};
|
|
4277
|
-
async function unicorn(
|
|
4278
|
-
const { nameReplacements, roblox = true, root: customRootGlobs, stylistic = true } = options;
|
|
4281
|
+
async function unicorn({ nameReplacements, roblox = true, root: customRootGlobs, stylistic = true } = {}) {
|
|
4279
4282
|
const replacements = {
|
|
4280
4283
|
...abbreviations,
|
|
4281
4284
|
...roblox ? { buf: false } : {},
|
|
@@ -13380,8 +13383,7 @@ var init_lib = __esmMin((() => {
|
|
|
13380
13383
|
}));
|
|
13381
13384
|
//#endregion
|
|
13382
13385
|
//#region src/configs/yaml.ts
|
|
13383
|
-
async function yaml(
|
|
13384
|
-
const { files = [GLOB_YAML, "**/github-actions-workflow"], overrides = {}, stylistic = true } = options;
|
|
13386
|
+
async function yaml({ files = [GLOB_YAML, "**/github-actions-workflow"], overrides = {}, stylistic = true } = {}) {
|
|
13385
13387
|
const [pluginYaml, parserYaml, eslintPluginFlawless] = await Promise.all([
|
|
13386
13388
|
interopDefault(Promise.resolve().then(() => (init_lib(), lib_exports))),
|
|
13387
13389
|
interopDefault(import("yaml-eslint-parser")),
|
|
@@ -13450,4 +13452,4 @@ async function yaml(options = {}) {
|
|
|
13450
13452
|
}];
|
|
13451
13453
|
}
|
|
13452
13454
|
//#endregion
|
|
13453
|
-
export { GLOB_ALL_JSON, GLOB_ALL_SRC, GLOB_BUILD_TOOLS, GLOB_CSS, GLOB_DTS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LUA, GLOB_MARKDOWN, GLOB_MARKDOWN_BLOCKS, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_MISE, GLOB_POSTCSS, GLOB_ROOT, GLOB_ROOT_SRC, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_XML, GLOB_YAML, StylisticConfigDefaults, ceaseNonsense, comments, isentinel as default, isentinel, defaultPluginRenaming, disables, e18e, eslintPlugin, flawless, gitignore, ignores, imports, isInAgentSession, isInEditorEnvironment, isInGitHooksOrLintStaged, javascript, jsdoc, jsonc, markdown, node, oxfmt, packageJson, perfectionist, pnpm, promise, react, roblox, sonarjs, sortCspell, sortGithubAction, sortMiseToml, sortPnpmWorkspace, sortRojoProject, sortTsconfig, spelling, stylistic, test, toml, typescript, unicorn, yaml };
|
|
13455
|
+
export { GLOB_ALL_JSON, GLOB_ALL_SRC, GLOB_BUILD_TOOLS, GLOB_CSS, GLOB_DTS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LUA, GLOB_MARKDOWN, GLOB_MARKDOWN_BLOCKS, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_MISE, GLOB_POSTCSS, GLOB_ROOT, GLOB_ROOT_SRC, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_XML, GLOB_YAML, StylisticConfigDefaults, ceaseNonsense, comments, isentinel as default, isentinel, defaultPluginRenaming, disables, e18e, eslintPlugin, flawless, gitignore, ignores, imports, isInAgentSession, isInEditorEnvironment, isInGitHooksOrLintStaged, javascript, jsdoc, jsonc, markdown, naming, node, oxfmt, packageJson, perfectionist, pnpm, promise, react, roblox, sonarjs, sortCspell, sortGithubAction, sortMiseToml, sortPnpmWorkspace, sortRojoProject, sortTsconfig, spelling, stylistic, test, toml, typescript, unicorn, yaml };
|