@moso/eslint-config 1.0.1 → 1.0.3
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.ts +841 -278
- package/dist/index.js +171 -69
- package/package.json +15 -14
package/dist/index.js
CHANGED
|
@@ -145,8 +145,8 @@ var disables = () => {
|
|
|
145
145
|
files: [`**/scripts/${GLOB_SRC}`],
|
|
146
146
|
name: "moso/disables/scripts",
|
|
147
147
|
rules: {
|
|
148
|
-
"
|
|
149
|
-
"
|
|
148
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
149
|
+
"no-console": "off"
|
|
150
150
|
}
|
|
151
151
|
},
|
|
152
152
|
{
|
|
@@ -168,8 +168,8 @@ var disables = () => {
|
|
|
168
168
|
files: ["**/*.d.?([cm])ts"],
|
|
169
169
|
name: "moso/disables/dts",
|
|
170
170
|
rules: {
|
|
171
|
-
"eslint-comments/no-unlimited-disable": "off",
|
|
172
|
-
"import/no-duplicates": "off",
|
|
171
|
+
"@eslint-community/eslint-comments/no-unlimited-disable": "off",
|
|
172
|
+
"import-x/no-duplicates": "off",
|
|
173
173
|
"no-restricted-syntax": "off",
|
|
174
174
|
"unused-imports/no-unused-vars": "off"
|
|
175
175
|
}
|
|
@@ -185,8 +185,8 @@ var disables = () => {
|
|
|
185
185
|
files: [`**/*.config.${GLOB_SRC_EXT}`, `**/*.config.*.${GLOB_SRC_EXT}`],
|
|
186
186
|
name: "moso/disables/config-files",
|
|
187
187
|
rules: {
|
|
188
|
-
"
|
|
189
|
-
"
|
|
188
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
189
|
+
"no-console": "off"
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
];
|
|
@@ -230,7 +230,7 @@ var imports = async (options = {}) => {
|
|
|
230
230
|
"antfu/no-import-node-modules-by-path": "error",
|
|
231
231
|
"import-x/consistent-type-specifier-style": ["error", "prefer-top-level"],
|
|
232
232
|
"import-x/first": "error",
|
|
233
|
-
"import-x/no-duplicates": "error",
|
|
233
|
+
"import-x/no-duplicates": ["error", { "prefer-inline": true }],
|
|
234
234
|
"import-x/no-mutable-exports": "error",
|
|
235
235
|
"import-x/no-named-default": "off",
|
|
236
236
|
"import-x/no-self-import": "error",
|
|
@@ -339,6 +339,7 @@ var javascript = async (options = {}) => {
|
|
|
339
339
|
"no-nonoctal-decimal-escape": "error",
|
|
340
340
|
"no-obj-calls": "error",
|
|
341
341
|
"no-octal": "error",
|
|
342
|
+
"no-param-reassign": "error",
|
|
342
343
|
"no-prototype-builtins": "error",
|
|
343
344
|
"no-redeclare": ["error", { builtinGlobals: true }],
|
|
344
345
|
"no-regex-spaces": "error",
|
|
@@ -736,22 +737,82 @@ var react = async (options = {}) => {
|
|
|
736
737
|
},
|
|
737
738
|
name: "moso/react/rules",
|
|
738
739
|
rules: {
|
|
740
|
+
// Recommended rules from @eslint-react/react-x
|
|
741
|
+
// @see https://eslint-react.xyz/docs/rules/overview#core-rules
|
|
742
|
+
"@eslint-react/jsx-no-duplicate-props": "error",
|
|
743
|
+
"@eslint-react/jsx-no-undef": "error",
|
|
744
|
+
"@eslint-react/no-access-state-in-setstate": "error",
|
|
745
|
+
"@eslint-react/no-array-index-key": "warn",
|
|
746
|
+
"@eslint-react/no-children-count": "warn",
|
|
747
|
+
"@eslint-react/no-children-for-each": "warn",
|
|
748
|
+
"@eslint-react/no-children-map": "warn",
|
|
749
|
+
"@eslint-react/no-children-only": "warn",
|
|
750
|
+
"@eslint-react/no-children-to-array": "warn",
|
|
751
|
+
"@eslint-react/no-clone-element": "warn",
|
|
752
|
+
"@eslint-react/no-comment-textnodes": "warn",
|
|
753
|
+
"@eslint-react/no-component-will-mount": "error",
|
|
754
|
+
"@eslint-react/no-component-will-receive-props": "error",
|
|
755
|
+
"@eslint-react/no-component-will-update": "error",
|
|
756
|
+
"@eslint-react/no-context-provider": "warn",
|
|
757
|
+
"@eslint-react/no-create-ref": "error",
|
|
758
|
+
"@eslint-react/no-default-props": "error",
|
|
759
|
+
"@eslint-react/no-direct-mutation-state": "error",
|
|
760
|
+
"@eslint-react/no-duplicate-jsx-props": "warn",
|
|
761
|
+
"@eslint-react/no-duplicate-key": "warn",
|
|
762
|
+
"@eslint-react/no-forward-ref": "warn",
|
|
763
|
+
"@eslint-react/no-implicit-key": "warn",
|
|
764
|
+
"@eslint-react/no-missing-key": "error",
|
|
765
|
+
"@eslint-react/no-nested-component-definitions": "error",
|
|
766
|
+
"@eslint-react/no-prop-types": "error",
|
|
767
|
+
"@eslint-react/no-redundant-should-component-update": "error",
|
|
768
|
+
"@eslint-react/no-set-state-in-component-did-mount": "warn",
|
|
769
|
+
"@eslint-react/no-set-state-in-component-did-update": "warn",
|
|
770
|
+
"@eslint-react/no-set-state-in-component-will-update": "warn",
|
|
771
|
+
"@eslint-react/no-string-refs": "error",
|
|
772
|
+
"@eslint-react/no-unsafe-component-will-mount": "warn",
|
|
773
|
+
"@eslint-react/no-unsafe-component-will-receive-props": "warn",
|
|
774
|
+
"@eslint-react/no-unsafe-component-will-update": "warn",
|
|
775
|
+
"@eslint-react/no-unstable-context-value": "warn",
|
|
776
|
+
"@eslint-react/no-unstable-default-props": "warn",
|
|
777
|
+
"@eslint-react/no-unused-class-component-members": "warn",
|
|
778
|
+
"@eslint-react/no-unused-state": "warn",
|
|
779
|
+
"@eslint-react/no-use-context": "warn",
|
|
780
|
+
"@eslint-react/no-useless-forward-ref": "warn",
|
|
781
|
+
"@eslint-react/use-jsx-vars": "warn",
|
|
739
782
|
// Recommended rules from @eslint-react/dom
|
|
783
|
+
// @see https://eslint-react.xyz/docs/rules/overview#dom-rules
|
|
740
784
|
"@eslint-react/dom/no-dangerously-set-innerhtml": "warn",
|
|
741
785
|
"@eslint-react/dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
742
786
|
"@eslint-react/dom/no-find-dom-node": "error",
|
|
787
|
+
"@eslint-react/dom/no-flush-sync": "error",
|
|
788
|
+
"@eslint-react/dom/no-hydrate": "error",
|
|
743
789
|
"@eslint-react/dom/no-missing-button-type": "warn",
|
|
744
790
|
"@eslint-react/dom/no-missing-iframe-sandbox": "warn",
|
|
745
791
|
"@eslint-react/dom/no-namespace": "error",
|
|
792
|
+
"@eslint-react/dom/no-render": "error",
|
|
746
793
|
"@eslint-react/dom/no-render-return-value": "error",
|
|
747
794
|
"@eslint-react/dom/no-script-url": "warn",
|
|
748
795
|
"@eslint-react/dom/no-unsafe-iframe-sandbox": "warn",
|
|
749
796
|
"@eslint-react/dom/no-unsafe-target-blank": "warn",
|
|
750
|
-
"@eslint-react/dom/no-
|
|
797
|
+
"@eslint-react/dom/no-use-form-state": "error",
|
|
798
|
+
"@eslint-react/dom/no-void-elements-with-children": "error",
|
|
751
799
|
// Recommended rules for eslint-plugin-react-hooks
|
|
800
|
+
// @see https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks/src/rules
|
|
752
801
|
"react-hooks/exhaustive-deps": "warn",
|
|
753
802
|
"react-hooks/rules-of-hooks": "error",
|
|
754
|
-
// react-
|
|
803
|
+
// Recommended rules for eslint-plugin-react-hooks-extra
|
|
804
|
+
// @see https://eslint-react.xyz/docs/rules/overview#hooks-extra-rules
|
|
805
|
+
"@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": "warn",
|
|
806
|
+
"@eslint-react/hooks-extra/no-useless-custom-hooks": "warn",
|
|
807
|
+
"@eslint-react/hooks-extra/prefer-use-state-lazy-initialization": "warn",
|
|
808
|
+
// Recommended rules from @eslint-react/web-api
|
|
809
|
+
// @see https://eslint-react.xyz/docs/rules/overview#web-api-rules
|
|
810
|
+
"@eslint-react/web-api/no-leaked-event-listener": "warn",
|
|
811
|
+
"@eslint-react/web-api/no-leaked-interval": "warn",
|
|
812
|
+
"@eslint-react/web-api/no-leaked-resize-observer": "warn",
|
|
813
|
+
"@eslint-react/web-api/no-leaked-timeout": "warn",
|
|
814
|
+
// Preconfigured rules from eslint-plugin-react-refresh
|
|
815
|
+
// @see https://github.com/ArnaudBarre/eslint-plugin-react-refresh/tree/main/src
|
|
755
816
|
"react-refresh/only-export-components": [
|
|
756
817
|
"warn",
|
|
757
818
|
{
|
|
@@ -782,55 +843,11 @@ var react = async (options = {}) => {
|
|
|
782
843
|
]
|
|
783
844
|
}
|
|
784
845
|
],
|
|
785
|
-
//
|
|
786
|
-
// @see https://github.com/Rel1cx/eslint-react/blob/main/packages/plugins/eslint-plugin/src/configs/web-api.ts
|
|
787
|
-
"@eslint-react/web-api/no-leaked-event-listener": "warn",
|
|
788
|
-
"@eslint-react/web-api/no-leaked-interval": "warn",
|
|
789
|
-
"@eslint-react/web-api/no-leaked-resize-observer": "warn",
|
|
790
|
-
"@eslint-react/web-api/no-leaked-timeout": "warn",
|
|
791
|
-
// Recommended rules from @eslint-react
|
|
792
|
-
// @see https://github.com/Rel1cx/eslint-react/blob/main/packages/plugins/eslint-plugin/src/configs/core.ts
|
|
793
|
-
"@eslint-react/ensure-forward-ref-using-ref": "warn",
|
|
794
|
-
"@eslint-react/no-access-state-in-setstate": "error",
|
|
795
|
-
"@eslint-react/no-array-index-key": "warn",
|
|
796
|
-
"@eslint-react/no-children-count": "warn",
|
|
797
|
-
"@eslint-react/no-children-for-each": "warn",
|
|
798
|
-
"@eslint-react/no-children-map": "warn",
|
|
799
|
-
"@eslint-react/no-children-only": "warn",
|
|
800
|
-
"@eslint-react/no-children-to-array": "warn",
|
|
801
|
-
"@eslint-react/no-clone-element": "warn",
|
|
802
|
-
"@eslint-react/no-comment-textnodes": "warn",
|
|
803
|
-
"@eslint-react/no-component-will-mount": "error",
|
|
804
|
-
"@eslint-react/no-component-will-receive-props": "error",
|
|
805
|
-
"@eslint-react/no-component-will-update": "error",
|
|
806
|
-
"@eslint-react/no-context-provider": "warn",
|
|
807
|
-
"@eslint-react/no-create-ref": "error",
|
|
808
|
-
"@eslint-react/no-default-props": "error",
|
|
809
|
-
"@eslint-react/no-direct-mutation-state": "error",
|
|
810
|
-
"@eslint-react/no-duplicate-key": "error",
|
|
811
|
-
"@eslint-react/no-forward-ref": "warn",
|
|
812
|
-
"@eslint-react/no-implicit-key": "warn",
|
|
813
|
-
"@eslint-react/no-missing-key": "error",
|
|
814
|
-
"@eslint-react/no-nested-components": "error",
|
|
815
|
-
"@eslint-react/no-prop-types": "error",
|
|
816
|
-
"@eslint-react/no-redundant-should-component-update": "error",
|
|
817
|
-
"@eslint-react/no-set-state-in-component-did-mount": "warn",
|
|
818
|
-
"@eslint-react/no-set-state-in-component-did-update": "warn",
|
|
819
|
-
"@eslint-react/no-set-state-in-component-will-update": "warn",
|
|
820
|
-
"@eslint-react/no-string-refs": "error",
|
|
821
|
-
"@eslint-react/no-unsafe-component-will-mount": "warn",
|
|
822
|
-
"@eslint-react/no-unsafe-component-will-receive-props": "warn",
|
|
823
|
-
"@eslint-react/no-unsafe-component-will-update": "warn",
|
|
824
|
-
"@eslint-react/no-unstable-context-value": "warn",
|
|
825
|
-
"@eslint-react/no-unstable-default-props": "warn",
|
|
826
|
-
"@eslint-react/no-unused-class-component-members": "warn",
|
|
827
|
-
"@eslint-react/no-unused-state": "warn",
|
|
828
|
-
"@eslint-react/use-jsx-vars": "warn",
|
|
829
|
-
"@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": "warn",
|
|
830
|
-
"@eslint-react/hooks-extra/no-useless-custom-hooks": "warn",
|
|
831
|
-
"@eslint-react/hooks-extra/prefer-use-state-lazy-initialization": "warn",
|
|
846
|
+
// @moso's rules
|
|
832
847
|
"@eslint-react/naming-convention/context-name": "warn",
|
|
833
848
|
"@eslint-react/naming-convention/use-state": "warn",
|
|
849
|
+
"@eslint-react/ensure-forward-ref-using-ref": "warn",
|
|
850
|
+
"@eslint-react/no-nested-components": "error",
|
|
834
851
|
"@eslint-react/prefer-destructuring-assignment": "warn",
|
|
835
852
|
"@eslint-react/prefer-shorthand-boolean": "warn",
|
|
836
853
|
"@eslint-react/prefer-shorthand-fragment": "warn",
|
|
@@ -877,6 +894,7 @@ var sortPackageJson = () => {
|
|
|
877
894
|
"packageManager",
|
|
878
895
|
"description",
|
|
879
896
|
"author",
|
|
897
|
+
"contributors",
|
|
880
898
|
"license",
|
|
881
899
|
"funding",
|
|
882
900
|
"homepage",
|
|
@@ -990,6 +1008,7 @@ var sortTsconfig = () => {
|
|
|
990
1008
|
"useDefineForClassFields",
|
|
991
1009
|
"emitDecoratorMetadata",
|
|
992
1010
|
"experimentalDecorators",
|
|
1011
|
+
"libReplacement",
|
|
993
1012
|
"baseUrl",
|
|
994
1013
|
"rootDir",
|
|
995
1014
|
"rootDirs",
|
|
@@ -1058,6 +1077,7 @@ var sortTsconfig = () => {
|
|
|
1058
1077
|
"isolatedModules",
|
|
1059
1078
|
"preserveSymlinks",
|
|
1060
1079
|
"verbatimModuleSyntax",
|
|
1080
|
+
"erasableSyntaxOnly",
|
|
1061
1081
|
"skipDefaultLibCheck",
|
|
1062
1082
|
"skipLibCheck"
|
|
1063
1083
|
],
|
|
@@ -1130,7 +1150,8 @@ var stylistic = async (options = {}) => {
|
|
|
1130
1150
|
{
|
|
1131
1151
|
SwitchCase: 1,
|
|
1132
1152
|
VariableDeclarator: 1,
|
|
1133
|
-
outerIIFEBody: 1
|
|
1153
|
+
outerIIFEBody: 1,
|
|
1154
|
+
MemberExpression: "off"
|
|
1134
1155
|
}
|
|
1135
1156
|
],
|
|
1136
1157
|
"@stylistic/key-spacing": [
|
|
@@ -1237,7 +1258,7 @@ var test = async (options = {}) => {
|
|
|
1237
1258
|
...{
|
|
1238
1259
|
"no-unused-expressions": "off",
|
|
1239
1260
|
"node/prefer-global/process": "off",
|
|
1240
|
-
"typescript/explicit-function-return-type": "off"
|
|
1261
|
+
"@typescript-eslint/explicit-function-return-type": "off"
|
|
1241
1262
|
},
|
|
1242
1263
|
...overrides
|
|
1243
1264
|
}
|
|
@@ -1250,6 +1271,7 @@ import process2 from "node:process";
|
|
|
1250
1271
|
var typescript = async (options = {}) => {
|
|
1251
1272
|
const {
|
|
1252
1273
|
componentExts = [],
|
|
1274
|
+
lessOpinionated = false,
|
|
1253
1275
|
overrides = {},
|
|
1254
1276
|
overridesTypeAware = {},
|
|
1255
1277
|
parserOptions = {}
|
|
@@ -1281,25 +1303,88 @@ var typescript = async (options = {}) => {
|
|
|
1281
1303
|
"@typescript-eslint/no-implied-eval": "error",
|
|
1282
1304
|
"@typescript-eslint/no-misused-promises": "error",
|
|
1283
1305
|
"@typescript-eslint/no-non-null-assertion": "off",
|
|
1284
|
-
"@typescript-eslint/no-parameter-properties": "off",
|
|
1285
1306
|
"@typescript-eslint/no-var-requires": "off",
|
|
1286
1307
|
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
|
1287
1308
|
"@typescript-eslint/no-unsafe-argument": "error",
|
|
1288
1309
|
"@typescript-eslint/no-unsafe-assignment": "error",
|
|
1289
1310
|
"@typescript-eslint/no-unsafe-call": "error",
|
|
1290
1311
|
"@typescript-eslint/no-unsafe-member-access": "error",
|
|
1291
|
-
"@typescript-eslint/
|
|
1292
|
-
"@typescript-eslint/
|
|
1312
|
+
"@typescript-eslint/only-throw-error": "error",
|
|
1313
|
+
"@typescript-eslint/parameter-properties": "off",
|
|
1293
1314
|
"@typescript-eslint/restrict-plus-operands": "error",
|
|
1294
1315
|
"@typescript-eslint/restrict-template-expressions": "error",
|
|
1295
|
-
"@typescript-eslint/unbound-method": "error"
|
|
1316
|
+
"@typescript-eslint/unbound-method": "error",
|
|
1317
|
+
...lessOpinionated ? {} : {
|
|
1318
|
+
// Opinionated TypeScript
|
|
1319
|
+
"@typescript-eslint/no-unsafe-return": "error",
|
|
1320
|
+
"@typescript-eslint/switch-exhaustiveness-check": [
|
|
1321
|
+
"error",
|
|
1322
|
+
{
|
|
1323
|
+
considerDefaultExhaustiveForUnions: true
|
|
1324
|
+
}
|
|
1325
|
+
],
|
|
1326
|
+
// Opinionated Functional
|
|
1327
|
+
// @see https://github.com/eslint-functional/eslint-plugin-functional
|
|
1328
|
+
"functional/no-mixed-types": "error",
|
|
1329
|
+
"functional/prefer-property-signatures": "error",
|
|
1330
|
+
"functional/readonly-type": "error",
|
|
1331
|
+
"functional/type-declaration-immutability": [
|
|
1332
|
+
"error",
|
|
1333
|
+
{
|
|
1334
|
+
rules: [
|
|
1335
|
+
{
|
|
1336
|
+
identifiers: "I?Immutable.+",
|
|
1337
|
+
immutability: "Immutable",
|
|
1338
|
+
comparator: "AtLeast"
|
|
1339
|
+
},
|
|
1340
|
+
{
|
|
1341
|
+
identifiers: "I?ReadonlyDeep.+",
|
|
1342
|
+
immutability: "ReadonlyDeep",
|
|
1343
|
+
comparator: "AtLeast"
|
|
1344
|
+
},
|
|
1345
|
+
{
|
|
1346
|
+
identifiers: "I?Readonly.+",
|
|
1347
|
+
immutability: "ReadonlyShallow",
|
|
1348
|
+
comparator: "AtLeast",
|
|
1349
|
+
fixer: [
|
|
1350
|
+
{
|
|
1351
|
+
pattern: "^(Array|Map|Set)<(.+)>$",
|
|
1352
|
+
replace: "Readonly$1<$2>"
|
|
1353
|
+
},
|
|
1354
|
+
{
|
|
1355
|
+
pattern: "^(.+)$",
|
|
1356
|
+
replace: "Readonly<$1>"
|
|
1357
|
+
}
|
|
1358
|
+
]
|
|
1359
|
+
},
|
|
1360
|
+
{
|
|
1361
|
+
identifiers: "I?Mutable.+",
|
|
1362
|
+
immutability: "Mutable",
|
|
1363
|
+
comparator: "AtMost",
|
|
1364
|
+
fixer: [
|
|
1365
|
+
{
|
|
1366
|
+
pattern: "^Readonly(Array|Map|Set)<(.+)>$",
|
|
1367
|
+
replace: "$1<$2>"
|
|
1368
|
+
},
|
|
1369
|
+
{
|
|
1370
|
+
pattern: "^Readonly<(.+)>$",
|
|
1371
|
+
replace: "$1"
|
|
1372
|
+
}
|
|
1373
|
+
]
|
|
1374
|
+
}
|
|
1375
|
+
]
|
|
1376
|
+
}
|
|
1377
|
+
]
|
|
1378
|
+
}
|
|
1296
1379
|
};
|
|
1297
1380
|
const [
|
|
1298
1381
|
antfuPlugin,
|
|
1382
|
+
functionalPlugin,
|
|
1299
1383
|
typeScriptParser,
|
|
1300
1384
|
typeScriptPlugin
|
|
1301
1385
|
] = await Promise.all([
|
|
1302
1386
|
interopDefault(import("eslint-plugin-antfu")),
|
|
1387
|
+
interopDefault(import("eslint-plugin-functional")),
|
|
1303
1388
|
interopDefault(import("@typescript-eslint/parser")),
|
|
1304
1389
|
interopDefault(import("@typescript-eslint/eslint-plugin"))
|
|
1305
1390
|
]);
|
|
@@ -1314,7 +1399,7 @@ var typescript = async (options = {}) => {
|
|
|
1314
1399
|
sourceType: "module",
|
|
1315
1400
|
...typeAware ? {
|
|
1316
1401
|
projectService: {
|
|
1317
|
-
allowDefaultProject: ["./*.js"],
|
|
1402
|
+
allowDefaultProject: ["./*.js", "./*.ts"],
|
|
1318
1403
|
defaultProject: tsconfigPath
|
|
1319
1404
|
},
|
|
1320
1405
|
tsconfigRootDir: process2.cwd()
|
|
@@ -1330,6 +1415,7 @@ var typescript = async (options = {}) => {
|
|
|
1330
1415
|
name: "moso/typescript/setup",
|
|
1331
1416
|
plugins: {
|
|
1332
1417
|
"antfu": antfuPlugin,
|
|
1418
|
+
"functional": functionalPlugin,
|
|
1333
1419
|
"@typescript-eslint": typeScriptPlugin
|
|
1334
1420
|
}
|
|
1335
1421
|
},
|
|
@@ -1346,9 +1432,12 @@ var typescript = async (options = {}) => {
|
|
|
1346
1432
|
...typeScriptPlugin.configs["eslint-recommended"].overrides[0].rules,
|
|
1347
1433
|
...typeScriptPlugin.configs.strict.rules,
|
|
1348
1434
|
// JS off
|
|
1435
|
+
"no-dupe-class-members": "off",
|
|
1436
|
+
"no-redeclare": "off",
|
|
1349
1437
|
"no-loss-of-precision": "off",
|
|
1350
1438
|
"no-unused-vars": "off",
|
|
1351
1439
|
"no-use-before-define": "off",
|
|
1440
|
+
"no-useless-constructor": "off",
|
|
1352
1441
|
// Stylistic
|
|
1353
1442
|
"@stylistic/type-annotation-spacing": "error",
|
|
1354
1443
|
// Typescript
|
|
@@ -1358,7 +1447,6 @@ var typescript = async (options = {}) => {
|
|
|
1358
1447
|
"ts-ignore": "allow-with-description"
|
|
1359
1448
|
}
|
|
1360
1449
|
],
|
|
1361
|
-
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
|
|
1362
1450
|
"@typescript-eslint/consistent-type-imports": [
|
|
1363
1451
|
"error",
|
|
1364
1452
|
{
|
|
@@ -1368,12 +1456,21 @@ var typescript = async (options = {}) => {
|
|
|
1368
1456
|
],
|
|
1369
1457
|
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
1370
1458
|
"@typescript-eslint/no-dynamic-delete": "off",
|
|
1459
|
+
"@typescript-eslint/no-empty-object-type": ["error", { allowInterfaces: "always" }],
|
|
1371
1460
|
"@typescript-eslint/no-explicit-any": "off",
|
|
1372
1461
|
"@typescript-eslint/no-extraneous-class": "off",
|
|
1373
1462
|
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
1374
1463
|
"@typescript-eslint/no-invalid-void-type": "off",
|
|
1375
1464
|
"@typescript-eslint/no-non-null-assertion": "off",
|
|
1376
1465
|
"@typescript-eslint/no-require-imports": "error",
|
|
1466
|
+
"@typescript-eslint/no-unused-expressions": [
|
|
1467
|
+
"error",
|
|
1468
|
+
{
|
|
1469
|
+
allowShortCircuit: true,
|
|
1470
|
+
allowTaggedTemplates: true,
|
|
1471
|
+
allowTernary: true
|
|
1472
|
+
}
|
|
1473
|
+
],
|
|
1377
1474
|
"@typescript-eslint/no-unused-vars": [
|
|
1378
1475
|
"error",
|
|
1379
1476
|
{
|
|
@@ -1426,8 +1523,7 @@ var typescript = async (options = {}) => {
|
|
|
1426
1523
|
files: ["**/*.js", "**/*.cjs"],
|
|
1427
1524
|
name: "moso/typescript/disables/cjs",
|
|
1428
1525
|
rules: {
|
|
1429
|
-
"@
|
|
1430
|
-
"@stylistic/no-var-requires": "off"
|
|
1526
|
+
"@typescript-eslint/no-require-imports": "off"
|
|
1431
1527
|
}
|
|
1432
1528
|
}
|
|
1433
1529
|
];
|
|
@@ -1447,6 +1543,7 @@ var unicorn = async (options = {}) => {
|
|
|
1447
1543
|
"unicorn/consistent-empty-array-spread": "error",
|
|
1448
1544
|
"unicorn/error-message": "error",
|
|
1449
1545
|
"unicorn/escape-case": "error",
|
|
1546
|
+
"unicorn/no-instanceof-builtins": "error",
|
|
1450
1547
|
"unicorn/no-new-array": "error",
|
|
1451
1548
|
"unicorn/no-new-buffer": "error",
|
|
1452
1549
|
"unicorn/number-literal-case": "error",
|
|
@@ -1543,7 +1640,6 @@ var vue = async (options = {}) => {
|
|
|
1543
1640
|
}],
|
|
1544
1641
|
"vue/component-name-in-template-casing": ["error", "PascalCase"],
|
|
1545
1642
|
"vue/component-options-name-casing": ["error", "PascalCase"],
|
|
1546
|
-
"vue/component-tags-order": "off",
|
|
1547
1643
|
"vue/custom-event-name-casing": ["error", "camelCase"],
|
|
1548
1644
|
"vue/define-macros-order": ["error", {
|
|
1549
1645
|
order: ["defineOptions", "defineProps", "defineEmits", "defineSlots"]
|
|
@@ -1552,7 +1648,13 @@ var vue = async (options = {}) => {
|
|
|
1552
1648
|
"vue/dot-notation": ["error", { allowKeywords: true }],
|
|
1553
1649
|
"vue/eqeqeq": ["error", "smart"],
|
|
1554
1650
|
"vue/html-indent": ["error", indent],
|
|
1555
|
-
"vue/html-quotes": [
|
|
1651
|
+
"vue/html-quotes": [
|
|
1652
|
+
"error",
|
|
1653
|
+
"double",
|
|
1654
|
+
{
|
|
1655
|
+
avoidEscape: true
|
|
1656
|
+
}
|
|
1657
|
+
],
|
|
1556
1658
|
"vue/html-self-closing": "off",
|
|
1557
1659
|
"vue/max-attributes-per-line": ["warn", { singleline: 5 }],
|
|
1558
1660
|
"vue/multi-word-component-names": "off",
|
|
@@ -1810,7 +1912,7 @@ var moso = (options = {}, ...userConfigs) => {
|
|
|
1810
1912
|
if (isInEditor) {
|
|
1811
1913
|
composer = composer.disableRulesFix([
|
|
1812
1914
|
"unused-imports/no-unused-imports",
|
|
1813
|
-
"
|
|
1915
|
+
"no-only-tests/no-only-tests",
|
|
1814
1916
|
"prefer-const"
|
|
1815
1917
|
], {
|
|
1816
1918
|
builtinRules: () => import(["eslint", "use-at-your-own-risk"].join("/")).then((x) => x.builtinRules)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moso/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"packageManager": "bun@1.2.5",
|
|
6
6
|
"description": "moso's shared ESLint config",
|
|
7
7
|
"author": {
|
|
@@ -52,24 +52,25 @@
|
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
|
55
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
55
|
+
"@eslint-react/eslint-plugin": "^1.38.0",
|
|
56
56
|
"@stylistic/eslint-plugin": "^4.2.0",
|
|
57
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
58
|
-
"@typescript-eslint/parser": "^8.
|
|
59
|
-
"@vitest/eslint-plugin": "^1.1.
|
|
57
|
+
"@typescript-eslint/eslint-plugin": "^8.28.0",
|
|
58
|
+
"@typescript-eslint/parser": "^8.28.0",
|
|
59
|
+
"@vitest/eslint-plugin": "^1.1.38",
|
|
60
60
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
61
61
|
"eslint-flat-config-utils": "^2.0.1",
|
|
62
62
|
"eslint-merge-processors": "^2.0.0",
|
|
63
63
|
"eslint-plugin-antfu": "^3.1.1",
|
|
64
|
-
"eslint-plugin-
|
|
65
|
-
"eslint-plugin-
|
|
64
|
+
"eslint-plugin-functional": "^9.0.1",
|
|
65
|
+
"eslint-plugin-import-x": "^4.9.1",
|
|
66
|
+
"eslint-plugin-jsdoc": "^50.6.9",
|
|
66
67
|
"eslint-plugin-jsonc": "^2.19.1",
|
|
67
68
|
"eslint-plugin-n": "^17.16.2",
|
|
68
69
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
69
70
|
"eslint-plugin-perfectionist": "^4.10.1",
|
|
70
71
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
71
72
|
"eslint-plugin-react-refresh": "^0.4.19",
|
|
72
|
-
"eslint-plugin-unicorn": "^
|
|
73
|
+
"eslint-plugin-unicorn": "^58.0.0",
|
|
73
74
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
74
75
|
"eslint-plugin-vue": "^10.0.0",
|
|
75
76
|
"eslint-plugin-yml": "^1.17.0",
|
|
@@ -86,23 +87,23 @@
|
|
|
86
87
|
"@eslint-types/unicorn": "^52.0.0",
|
|
87
88
|
"@eslint/config-inspector": "^1.0.2",
|
|
88
89
|
"@types/eslint": "^9.6.1",
|
|
89
|
-
"@types/node": "^22.13.
|
|
90
|
+
"@types/node": "^22.13.13",
|
|
90
91
|
"bumpp": "^10.1.0",
|
|
91
|
-
"eslint": "^9.
|
|
92
|
+
"eslint": "^9.23.0",
|
|
92
93
|
"eslint-typegen": "^2.1.0",
|
|
93
94
|
"jiti": "^2.4.2",
|
|
94
95
|
"lint-staged": "^15.5.0",
|
|
95
|
-
"simple-git-hooks": "^2.
|
|
96
|
+
"simple-git-hooks": "^2.12.1",
|
|
96
97
|
"tsup": "^8.4.0",
|
|
97
98
|
"tsx": "^4.19.3",
|
|
98
99
|
"typescript": "^5.8.2",
|
|
99
|
-
"vitest": "^3.0.
|
|
100
|
+
"vitest": "^3.0.9",
|
|
100
101
|
"vue": "^3.5.13"
|
|
101
102
|
},
|
|
102
103
|
"resolutions": {
|
|
103
104
|
"@eslint-community/eslint-utils": "^4.4.1",
|
|
104
|
-
"@typescript-eslint/utils": "^8.
|
|
105
|
-
"eslint": "^9.
|
|
105
|
+
"@typescript-eslint/utils": "^8.28.0",
|
|
106
|
+
"eslint": "^9.23.0",
|
|
106
107
|
"tsx": "^4.19.3"
|
|
107
108
|
},
|
|
108
109
|
"simple-git-hooks": {
|