@frabbit/eslint-config 1.3.0 → 1.4.0

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.cjs CHANGED
@@ -76,6 +76,8 @@ __export(src_exports, {
76
76
  pluginJsonc: () => pluginJsonc,
77
77
  pluginMarkdown: () => pluginMarkdown,
78
78
  pluginPrettier: () => pluginPrettier,
79
+ pluginSecurity: () => pluginSecurity,
80
+ pluginSonar: () => pluginSonar,
79
81
  pluginTypeScript: () => pluginTypeScript,
80
82
  pluginUnicorn: () => pluginUnicorn,
81
83
  pluginUnocss: () => pluginUnocss,
@@ -87,6 +89,8 @@ __export(src_exports, {
87
89
  presetLangsExtensions: () => presetLangsExtensions,
88
90
  prettier: () => prettier,
89
91
  reactivityTransform: () => reactivityTransform,
92
+ security: () => security,
93
+ sonar: () => sonar,
90
94
  sortPackageJson: () => sortPackageJson,
91
95
  sortTsconfig: () => sortTsconfig,
92
96
  typescript: () => typescript,
@@ -107,6 +111,8 @@ var _pluginVue = __toESM(require("eslint-plugin-vue"), 1);
107
111
  var _pluginUnocss = __toESM(require("@unocss/eslint-plugin"), 1);
108
112
  var _pluginPrettier = __toESM(require("eslint-plugin-prettier"), 1);
109
113
  var _configPrettier = __toESM(require("eslint-config-prettier"), 1);
114
+ var pluginSonar = __toESM(require("eslint-plugin-sonarjs"), 1);
115
+ var pluginSecurity = __toESM(require("eslint-plugin-security"), 1);
110
116
  var pluginImport = __toESM(require("eslint-plugin-i"), 1);
111
117
  var pluginJsonc = __toESM(require("eslint-plugin-jsonc"), 1);
112
118
  var pluginUnusedImports = __toESM(require("eslint-plugin-unused-imports"), 1);
@@ -525,6 +531,74 @@ var prettier = [
525
531
  }
526
532
  ];
527
533
 
534
+ // src/configs/security.ts
535
+ var security = [
536
+ {
537
+ plugins: {
538
+ unicorn: pluginSecurity
539
+ },
540
+ rules: {
541
+ "security/detect-bidi-characters": "warn",
542
+ "security/detect-buffer-noassert": "warn",
543
+ "security/detect-child-process": "warn",
544
+ "security/detect-disable-mustache-escape": "warn",
545
+ "security/detect-eval-with-expression": "warn",
546
+ "security/detect-new-buffer": "warn",
547
+ "security/detect-no-csrf-before-method-override": "warn",
548
+ "security/detect-non-literal-fs-filename": "warn",
549
+ "security/detect-non-literal-regexp": "warn",
550
+ "security/detect-non-literal-require": "warn",
551
+ "security/detect-object-injection": "warn",
552
+ "security/detect-possible-timing-attacks": "warn",
553
+ "security/detect-pseudoRandomBytes": "warn",
554
+ "security/detect-unsafe-regex": "warn"
555
+ }
556
+ }
557
+ ];
558
+
559
+ // src/configs/sonar.ts
560
+ var sonar = [
561
+ {
562
+ plugins: {
563
+ unicorn: pluginSonar
564
+ },
565
+ rules: {
566
+ "sonarjs/cognitive-complexity": "error",
567
+ "sonarjs/elseif-without-else": "off",
568
+ "sonarjs/max-switch-cases": "error",
569
+ "sonarjs/no-all-duplicated-branches": "error",
570
+ "sonarjs/no-collapsible-if": "error",
571
+ "sonarjs/no-collection-size-mischeck": "error",
572
+ "sonarjs/no-duplicate-string": "error",
573
+ "sonarjs/no-duplicated-branches": "error",
574
+ "sonarjs/no-element-overwrite": "error",
575
+ "sonarjs/no-empty-collection": "error",
576
+ "sonarjs/no-extra-arguments": "error",
577
+ "sonarjs/no-gratuitous-expressions": "error",
578
+ "sonarjs/no-identical-conditions": "error",
579
+ "sonarjs/no-identical-expressions": "error",
580
+ "sonarjs/no-identical-functions": "error",
581
+ "sonarjs/no-ignored-return": "error",
582
+ "sonarjs/no-inverted-boolean-check": "off",
583
+ "sonarjs/no-nested-switch": "error",
584
+ "sonarjs/no-nested-template-literals": "error",
585
+ "sonarjs/no-one-iteration-loop": "error",
586
+ "sonarjs/no-redundant-boolean": "error",
587
+ "sonarjs/no-redundant-jump": "error",
588
+ "sonarjs/no-same-line-conditional": "error",
589
+ "sonarjs/no-small-switch": "error",
590
+ "sonarjs/no-unused-collection": "error",
591
+ "sonarjs/no-use-of-empty-return-value": "error",
592
+ "sonarjs/no-useless-catch": "error",
593
+ "sonarjs/non-existent-operator": "error",
594
+ "sonarjs/prefer-immediate-return": "error",
595
+ "sonarjs/prefer-object-literal": "error",
596
+ "sonarjs/prefer-single-boolean-return": "error",
597
+ "sonarjs/prefer-while": "error"
598
+ }
599
+ }
600
+ ];
601
+
528
602
  // src/configs/sort.ts
529
603
  var sortPackageJson = [
530
604
  {
@@ -1185,7 +1259,9 @@ var presetJavaScript = [
1185
1259
  ...javascript,
1186
1260
  ...comments,
1187
1261
  ...imports,
1188
- ...unicorn
1262
+ ...unicorn,
1263
+ ...security,
1264
+ ...sonar
1189
1265
  ];
1190
1266
  var presetLangsExtensions = [
1191
1267
  ...markdown,
@@ -1273,6 +1349,8 @@ function frabbit(config = [], {
1273
1349
  pluginJsonc,
1274
1350
  pluginMarkdown,
1275
1351
  pluginPrettier,
1352
+ pluginSecurity,
1353
+ pluginSonar,
1276
1354
  pluginTypeScript,
1277
1355
  pluginUnicorn,
1278
1356
  pluginUnocss,
@@ -1284,6 +1362,8 @@ function frabbit(config = [], {
1284
1362
  presetLangsExtensions,
1285
1363
  prettier,
1286
1364
  reactivityTransform,
1365
+ security,
1366
+ sonar,
1287
1367
  sortPackageJson,
1288
1368
  sortTsconfig,
1289
1369
  typescript,
package/dist/index.d.cts CHANGED
@@ -1,4 +1,8 @@
1
1
  import { FlatESLintConfigItem } from 'eslint-define-config';
2
+ import * as eslintPluginSonarjs from 'eslint-plugin-sonarjs';
3
+ export { eslintPluginSonarjs as pluginSonar };
4
+ import * as eslintPluginSecurity from 'eslint-plugin-security';
5
+ export { eslintPluginSecurity as pluginSecurity };
2
6
  import * as eslintPluginI from 'eslint-plugin-i';
3
7
  export { eslintPluginI as pluginImport };
4
8
  import * as eslintPluginJsonc from 'eslint-plugin-jsonc';
@@ -30,6 +34,10 @@ declare const markdown: FlatESLintConfigItem[];
30
34
 
31
35
  declare const prettier: FlatESLintConfigItem[];
32
36
 
37
+ declare const security: FlatESLintConfigItem[];
38
+
39
+ declare const sonar: FlatESLintConfigItem[];
40
+
33
41
  declare const sortPackageJson: FlatESLintConfigItem[];
34
42
  declare const sortTsconfig: FlatESLintConfigItem[];
35
43
 
@@ -94,4 +102,4 @@ declare function frabbit(config?: FlatESLintConfigItem | FlatESLintConfigItem[],
94
102
  unocss: boolean;
95
103
  }>): FlatESLintConfigItem[];
96
104
 
97
- export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, all, basic, comments, configPrettier, frabbit, getVueVersion, hasTypeScript, hasVue, ignores, imports, isInEditor, javascript, jsonc, markdown, pluginAntfu, pluginComments, pluginMarkdown, pluginPrettier, pluginTypeScript, pluginUnicorn, pluginUnocss, pluginVue, basic as presetBasic, presetJavaScript, presetLangsExtensions, prettier, reactivityTransform, sortPackageJson, sortTsconfig, typescript, unicorn, unocss, vue, yml };
105
+ export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, all, basic, comments, configPrettier, frabbit, getVueVersion, hasTypeScript, hasVue, ignores, imports, isInEditor, javascript, jsonc, markdown, pluginAntfu, pluginComments, pluginMarkdown, pluginPrettier, pluginTypeScript, pluginUnicorn, pluginUnocss, pluginVue, basic as presetBasic, presetJavaScript, presetLangsExtensions, prettier, reactivityTransform, security, sonar, sortPackageJson, sortTsconfig, typescript, unicorn, unocss, vue, yml };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  import { FlatESLintConfigItem } from 'eslint-define-config';
2
+ import * as eslintPluginSonarjs from 'eslint-plugin-sonarjs';
3
+ export { eslintPluginSonarjs as pluginSonar };
4
+ import * as eslintPluginSecurity from 'eslint-plugin-security';
5
+ export { eslintPluginSecurity as pluginSecurity };
2
6
  import * as eslintPluginI from 'eslint-plugin-i';
3
7
  export { eslintPluginI as pluginImport };
4
8
  import * as eslintPluginJsonc from 'eslint-plugin-jsonc';
@@ -30,6 +34,10 @@ declare const markdown: FlatESLintConfigItem[];
30
34
 
31
35
  declare const prettier: FlatESLintConfigItem[];
32
36
 
37
+ declare const security: FlatESLintConfigItem[];
38
+
39
+ declare const sonar: FlatESLintConfigItem[];
40
+
33
41
  declare const sortPackageJson: FlatESLintConfigItem[];
34
42
  declare const sortTsconfig: FlatESLintConfigItem[];
35
43
 
@@ -94,4 +102,4 @@ declare function frabbit(config?: FlatESLintConfigItem | FlatESLintConfigItem[],
94
102
  unocss: boolean;
95
103
  }>): FlatESLintConfigItem[];
96
104
 
97
- export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, all, basic, comments, configPrettier, frabbit, getVueVersion, hasTypeScript, hasVue, ignores, imports, isInEditor, javascript, jsonc, markdown, pluginAntfu, pluginComments, pluginMarkdown, pluginPrettier, pluginTypeScript, pluginUnicorn, pluginUnocss, pluginVue, basic as presetBasic, presetJavaScript, presetLangsExtensions, prettier, reactivityTransform, sortPackageJson, sortTsconfig, typescript, unicorn, unocss, vue, yml };
105
+ export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, all, basic, comments, configPrettier, frabbit, getVueVersion, hasTypeScript, hasVue, ignores, imports, isInEditor, javascript, jsonc, markdown, pluginAntfu, pluginComments, pluginMarkdown, pluginPrettier, pluginTypeScript, pluginUnicorn, pluginUnocss, pluginVue, basic as presetBasic, presetJavaScript, presetLangsExtensions, prettier, reactivityTransform, security, sonar, sortPackageJson, sortTsconfig, typescript, unicorn, unocss, vue, yml };
package/dist/index.js CHANGED
@@ -8,6 +8,8 @@ import * as _pluginVue from "eslint-plugin-vue";
8
8
  import * as _pluginUnocss from "@unocss/eslint-plugin";
9
9
  import * as _pluginPrettier from "eslint-plugin-prettier";
10
10
  import * as _configPrettier from "eslint-config-prettier";
11
+ import * as pluginSonar from "eslint-plugin-sonarjs";
12
+ import * as pluginSecurity from "eslint-plugin-security";
11
13
  import * as pluginImport from "eslint-plugin-i";
12
14
  import * as pluginJsonc from "eslint-plugin-jsonc";
13
15
  import * as pluginUnusedImports from "eslint-plugin-unused-imports";
@@ -426,6 +428,74 @@ var prettier = [
426
428
  }
427
429
  ];
428
430
 
431
+ // src/configs/security.ts
432
+ var security = [
433
+ {
434
+ plugins: {
435
+ unicorn: pluginSecurity
436
+ },
437
+ rules: {
438
+ "security/detect-bidi-characters": "warn",
439
+ "security/detect-buffer-noassert": "warn",
440
+ "security/detect-child-process": "warn",
441
+ "security/detect-disable-mustache-escape": "warn",
442
+ "security/detect-eval-with-expression": "warn",
443
+ "security/detect-new-buffer": "warn",
444
+ "security/detect-no-csrf-before-method-override": "warn",
445
+ "security/detect-non-literal-fs-filename": "warn",
446
+ "security/detect-non-literal-regexp": "warn",
447
+ "security/detect-non-literal-require": "warn",
448
+ "security/detect-object-injection": "warn",
449
+ "security/detect-possible-timing-attacks": "warn",
450
+ "security/detect-pseudoRandomBytes": "warn",
451
+ "security/detect-unsafe-regex": "warn"
452
+ }
453
+ }
454
+ ];
455
+
456
+ // src/configs/sonar.ts
457
+ var sonar = [
458
+ {
459
+ plugins: {
460
+ unicorn: pluginSonar
461
+ },
462
+ rules: {
463
+ "sonarjs/cognitive-complexity": "error",
464
+ "sonarjs/elseif-without-else": "off",
465
+ "sonarjs/max-switch-cases": "error",
466
+ "sonarjs/no-all-duplicated-branches": "error",
467
+ "sonarjs/no-collapsible-if": "error",
468
+ "sonarjs/no-collection-size-mischeck": "error",
469
+ "sonarjs/no-duplicate-string": "error",
470
+ "sonarjs/no-duplicated-branches": "error",
471
+ "sonarjs/no-element-overwrite": "error",
472
+ "sonarjs/no-empty-collection": "error",
473
+ "sonarjs/no-extra-arguments": "error",
474
+ "sonarjs/no-gratuitous-expressions": "error",
475
+ "sonarjs/no-identical-conditions": "error",
476
+ "sonarjs/no-identical-expressions": "error",
477
+ "sonarjs/no-identical-functions": "error",
478
+ "sonarjs/no-ignored-return": "error",
479
+ "sonarjs/no-inverted-boolean-check": "off",
480
+ "sonarjs/no-nested-switch": "error",
481
+ "sonarjs/no-nested-template-literals": "error",
482
+ "sonarjs/no-one-iteration-loop": "error",
483
+ "sonarjs/no-redundant-boolean": "error",
484
+ "sonarjs/no-redundant-jump": "error",
485
+ "sonarjs/no-same-line-conditional": "error",
486
+ "sonarjs/no-small-switch": "error",
487
+ "sonarjs/no-unused-collection": "error",
488
+ "sonarjs/no-use-of-empty-return-value": "error",
489
+ "sonarjs/no-useless-catch": "error",
490
+ "sonarjs/non-existent-operator": "error",
491
+ "sonarjs/prefer-immediate-return": "error",
492
+ "sonarjs/prefer-object-literal": "error",
493
+ "sonarjs/prefer-single-boolean-return": "error",
494
+ "sonarjs/prefer-while": "error"
495
+ }
496
+ }
497
+ ];
498
+
429
499
  // src/configs/sort.ts
430
500
  var sortPackageJson = [
431
501
  {
@@ -1086,7 +1156,9 @@ var presetJavaScript = [
1086
1156
  ...javascript,
1087
1157
  ...comments,
1088
1158
  ...imports,
1089
- ...unicorn
1159
+ ...unicorn,
1160
+ ...security,
1161
+ ...sonar
1090
1162
  ];
1091
1163
  var presetLangsExtensions = [
1092
1164
  ...markdown,
@@ -1173,6 +1245,8 @@ export {
1173
1245
  pluginJsonc,
1174
1246
  pluginMarkdown,
1175
1247
  pluginPrettier,
1248
+ pluginSecurity,
1249
+ pluginSonar,
1176
1250
  pluginTypeScript,
1177
1251
  pluginUnicorn,
1178
1252
  pluginUnocss,
@@ -1184,6 +1258,8 @@ export {
1184
1258
  presetLangsExtensions,
1185
1259
  prettier,
1186
1260
  reactivityTransform,
1261
+ security,
1262
+ sonar,
1187
1263
  sortPackageJson,
1188
1264
  sortTsconfig,
1189
1265
  typescript,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frabbit/eslint-config",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "packageManager": "pnpm@8.7.6",
5
5
  "description": "ESLint config for @frabbit.",
6
6
  "type": "module",
@@ -48,6 +48,8 @@
48
48
  "eslint-plugin-jsonc": "^2.9.0",
49
49
  "eslint-plugin-markdown": "^3.0.1",
50
50
  "eslint-plugin-prettier": "^5.0.0",
51
+ "eslint-plugin-security": "^1.7.1",
52
+ "eslint-plugin-sonarjs": "^0.21.0",
51
53
  "eslint-plugin-unicorn": "^48.0.1",
52
54
  "eslint-plugin-unused-imports": "^3.0.0",
53
55
  "eslint-plugin-vue": "^9.17.0",