@ghettoddos/eslint-config 1.6.1 → 1.7.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/README.md +3 -3
- package/dist/index.d.ts +3849 -1726
- package/dist/index.js +253 -132
- package/package.json +37 -33
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
|
2
2
|
import { isPackageExists } from "local-pkg";
|
|
3
3
|
import pluginComments from "@eslint-community/eslint-plugin-eslint-comments";
|
|
4
4
|
import pluginAntfu from "eslint-plugin-antfu";
|
|
5
|
-
import
|
|
5
|
+
import pluginImportLite from "eslint-plugin-import-lite";
|
|
6
6
|
import pluginNode from "eslint-plugin-n";
|
|
7
7
|
import pluginPerfectionist from "eslint-plugin-perfectionist";
|
|
8
8
|
import pluginUnicorn from "eslint-plugin-unicorn";
|
|
@@ -45,6 +45,7 @@ const GLOB_JSON5 = "**/*.json5";
|
|
|
45
45
|
const GLOB_JSONC = "**/*.jsonc";
|
|
46
46
|
const GLOB_MARKDOWN = "**/*.md";
|
|
47
47
|
const GLOB_MARKDOWN_IN_MARKDOWN = "**/*.md/*.md";
|
|
48
|
+
const GLOB_VUE = "**/*.vue";
|
|
48
49
|
const GLOB_YAML = "**/*.y?(a)ml";
|
|
49
50
|
const GLOB_TOML = "**/*.toml";
|
|
50
51
|
const GLOB_XML = "**/*.xml";
|
|
@@ -113,7 +114,6 @@ async function disables() {
|
|
|
113
114
|
name: "disables/dts",
|
|
114
115
|
rules: {
|
|
115
116
|
"eslint-comments/no-unlimited-disable": "off",
|
|
116
|
-
"import/no-duplicates": "off",
|
|
117
117
|
"no-restricted-syntax": "off",
|
|
118
118
|
"unused-imports/no-unused-vars": "off"
|
|
119
119
|
}
|
|
@@ -137,6 +137,12 @@ const ReactRouterPackages = [
|
|
|
137
137
|
"@react-router/dev"
|
|
138
138
|
];
|
|
139
139
|
const NextJsPackages = ["next"];
|
|
140
|
+
const VuePackages = [
|
|
141
|
+
"vue",
|
|
142
|
+
"nuxt",
|
|
143
|
+
"vitepress",
|
|
144
|
+
"@slidev/cli"
|
|
145
|
+
];
|
|
140
146
|
|
|
141
147
|
//#endregion
|
|
142
148
|
//#region src/utils.ts
|
|
@@ -414,118 +420,6 @@ async function formatters(options = {}, stylistic$1 = {}) {
|
|
|
414
420
|
return configs$1;
|
|
415
421
|
}
|
|
416
422
|
|
|
417
|
-
//#endregion
|
|
418
|
-
//#region src/configs/fsd.ts
|
|
419
|
-
const FS_LAYERS = [
|
|
420
|
-
"app",
|
|
421
|
-
"processes",
|
|
422
|
-
"pages",
|
|
423
|
-
"widgets",
|
|
424
|
-
"features",
|
|
425
|
-
"entities",
|
|
426
|
-
"shared"
|
|
427
|
-
];
|
|
428
|
-
const FS_SEGMENTS = [
|
|
429
|
-
"ui",
|
|
430
|
-
"model",
|
|
431
|
-
"lib",
|
|
432
|
-
"api",
|
|
433
|
-
"config",
|
|
434
|
-
"assets"
|
|
435
|
-
];
|
|
436
|
-
function getLowerLayers(layer) {
|
|
437
|
-
return FS_LAYERS.slice(FS_LAYERS.indexOf(layer) + 1);
|
|
438
|
-
}
|
|
439
|
-
function getUpperLayers(layer) {
|
|
440
|
-
return FS_LAYERS.slice(0, FS_LAYERS.indexOf(layer));
|
|
441
|
-
}
|
|
442
|
-
const FS_SLICED_LAYERS_REG = getUpperLayers("shared").join("|");
|
|
443
|
-
const FS_SEGMENTS_REG = [...FS_SEGMENTS, ...FS_SEGMENTS.map((seg) => `${seg}.*`)].join("|");
|
|
444
|
-
function getNotSharedLayersRules() {
|
|
445
|
-
return getUpperLayers("shared").map((layer) => ({
|
|
446
|
-
allow: getLowerLayers(layer),
|
|
447
|
-
from: layer
|
|
448
|
-
}));
|
|
449
|
-
}
|
|
450
|
-
const slicelessLayerRules = [{
|
|
451
|
-
allow: "shared",
|
|
452
|
-
from: "shared"
|
|
453
|
-
}, {
|
|
454
|
-
allow: "app",
|
|
455
|
-
from: "app"
|
|
456
|
-
}];
|
|
457
|
-
function getLayersBoundariesElements() {
|
|
458
|
-
return FS_LAYERS.map((layer) => ({
|
|
459
|
-
capture: ["slices"],
|
|
460
|
-
mode: "folder",
|
|
461
|
-
pattern: `${layer}/!(_*){,/*}`,
|
|
462
|
-
type: layer
|
|
463
|
-
}));
|
|
464
|
-
}
|
|
465
|
-
function getGodModeRules() {
|
|
466
|
-
return FS_LAYERS.map((layer) => ({
|
|
467
|
-
allow: [layer, ...getLowerLayers(layer)],
|
|
468
|
-
from: `gm_${layer}`
|
|
469
|
-
}));
|
|
470
|
-
}
|
|
471
|
-
function getGodModeElements() {
|
|
472
|
-
return FS_LAYERS.map((layer) => ({
|
|
473
|
-
capture: ["slices"],
|
|
474
|
-
mode: "folder",
|
|
475
|
-
pattern: `${layer}/_*`,
|
|
476
|
-
type: `gm_${layer}`
|
|
477
|
-
}));
|
|
478
|
-
}
|
|
479
|
-
async function fsd(options = {}) {
|
|
480
|
-
const { layersSlices: enableLayersSlices = true, publicApi: enablePublicApi = true } = options;
|
|
481
|
-
const configs$1 = [{
|
|
482
|
-
name: "fsd/setup",
|
|
483
|
-
plugins: { "eslint-comments": pluginComments }
|
|
484
|
-
}];
|
|
485
|
-
if (enablePublicApi) {
|
|
486
|
-
const { lite = true } = resolveSubOptions(options, "publicApi");
|
|
487
|
-
configs$1.push({
|
|
488
|
-
name: "fsd/public-api",
|
|
489
|
-
rules: {
|
|
490
|
-
"import/no-internal-modules": ["error", { allow: [
|
|
491
|
-
`**/*(${FS_SLICED_LAYERS_REG})/!(${FS_SEGMENTS_REG})`,
|
|
492
|
-
`**/*(${FS_SLICED_LAYERS_REG})/!(${FS_SEGMENTS_REG})/!(${FS_SEGMENTS_REG})`,
|
|
493
|
-
`**/*shared/*(${FS_SEGMENTS_REG})/!(${FS_SEGMENTS_REG})`,
|
|
494
|
-
`**/*shared/*(${FS_SEGMENTS_REG})`,
|
|
495
|
-
`**/node_modules/**`,
|
|
496
|
-
`**/*shared/_*`,
|
|
497
|
-
`**/*shared/_*/*`,
|
|
498
|
-
...lite ? [`./**`] : []
|
|
499
|
-
] }],
|
|
500
|
-
...getOverrides(options, "publicApi")
|
|
501
|
-
}
|
|
502
|
-
});
|
|
503
|
-
}
|
|
504
|
-
if (enableLayersSlices) {
|
|
505
|
-
await ensurePackages(["eslint-plugin-boundaries"]);
|
|
506
|
-
const [pluginBoundaries] = await Promise.all([interopDefault(import("eslint-plugin-boundaries"))]);
|
|
507
|
-
configs$1.push({
|
|
508
|
-
name: "fsd/layers-slices",
|
|
509
|
-
plugins: { boundaries: pluginBoundaries },
|
|
510
|
-
rules: {
|
|
511
|
-
...pluginBoundaries.configs.recommended.rules,
|
|
512
|
-
"boundaries/element-types": [2, {
|
|
513
|
-
default: "disallow",
|
|
514
|
-
message: "\"${file.type}\" is not allowed to import \"${dependency.type}\" | See rules: https://feature-sliced.design/docs/reference/layers/overview ",
|
|
515
|
-
rules: [
|
|
516
|
-
...getNotSharedLayersRules(),
|
|
517
|
-
...slicelessLayerRules,
|
|
518
|
-
...getGodModeRules()
|
|
519
|
-
]
|
|
520
|
-
}],
|
|
521
|
-
...getOverrides(options, "layersSlices")
|
|
522
|
-
},
|
|
523
|
-
settings: { "boundaries/elements": [...getLayersBoundariesElements(), ...getGodModeElements()] }
|
|
524
|
-
});
|
|
525
|
-
}
|
|
526
|
-
return configs$1;
|
|
527
|
-
}
|
|
528
|
-
|
|
529
423
|
//#endregion
|
|
530
424
|
//#region src/configs/ignores.ts
|
|
531
425
|
async function ignores(userIgnores = []) {
|
|
@@ -538,25 +432,24 @@ async function ignores(userIgnores = []) {
|
|
|
538
432
|
//#endregion
|
|
539
433
|
//#region src/configs/imports.ts
|
|
540
434
|
async function imports(options = {}) {
|
|
541
|
-
const { stylistic: stylistic$1 = true } = options;
|
|
435
|
+
const { overrides = {}, stylistic: stylistic$1 = true } = options;
|
|
542
436
|
return [{
|
|
543
437
|
name: "imports/rules",
|
|
544
438
|
plugins: {
|
|
545
439
|
antfu: pluginAntfu,
|
|
546
|
-
import:
|
|
440
|
+
import: pluginImportLite
|
|
547
441
|
},
|
|
548
442
|
rules: {
|
|
549
443
|
"antfu/import-dedupe": "error",
|
|
550
444
|
"antfu/no-import-dist": "error",
|
|
551
445
|
"antfu/no-import-node-modules-by-path": "error",
|
|
552
|
-
"import/consistent-type-specifier-style": ["error", "
|
|
446
|
+
"import/consistent-type-specifier-style": ["error", "top-level"],
|
|
553
447
|
"import/first": "error",
|
|
554
448
|
"import/no-duplicates": "error",
|
|
555
449
|
"import/no-mutable-exports": "error",
|
|
556
450
|
"import/no-named-default": "error",
|
|
557
|
-
"import/
|
|
558
|
-
|
|
559
|
-
...stylistic$1 ? { "import/newline-after-import": ["error", { count: 1 }] } : {}
|
|
451
|
+
...stylistic$1 ? { "import/newline-after-import": ["error", { count: 1 }] } : {},
|
|
452
|
+
...overrides
|
|
560
453
|
}
|
|
561
454
|
}];
|
|
562
455
|
}
|
|
@@ -844,7 +737,7 @@ async function jsonc(options = {}) {
|
|
|
844
737
|
multiline: true
|
|
845
738
|
}],
|
|
846
739
|
"jsonc/object-curly-spacing": ["error", "always"],
|
|
847
|
-
"jsonc/object-property-newline": ["error", {
|
|
740
|
+
"jsonc/object-property-newline": ["error", { allowAllPropertiesOnSameLine: true }],
|
|
848
741
|
"jsonc/quote-props": "error",
|
|
849
742
|
"jsonc/quotes": "error"
|
|
850
743
|
} : {},
|
|
@@ -915,7 +808,6 @@ async function markdown(options = {}) {
|
|
|
915
808
|
name: "markdown/disables",
|
|
916
809
|
rules: {
|
|
917
810
|
"antfu/no-top-level-await": "off",
|
|
918
|
-
"import/newline-after-import": "off",
|
|
919
811
|
"no-alert": "off",
|
|
920
812
|
"no-console": "off",
|
|
921
813
|
"no-labels": "off",
|
|
@@ -928,6 +820,7 @@ async function markdown(options = {}) {
|
|
|
928
820
|
"node/prefer-global/process": "off",
|
|
929
821
|
"style/comma-dangle": "off",
|
|
930
822
|
"style/eol-last": "off",
|
|
823
|
+
"style/padding-line-between-statements": "off",
|
|
931
824
|
"ts/consistent-type-imports": "off",
|
|
932
825
|
"ts/explicit-function-return-type": "off",
|
|
933
826
|
"ts/no-namespace": "off",
|
|
@@ -948,12 +841,19 @@ async function markdown(options = {}) {
|
|
|
948
841
|
//#endregion
|
|
949
842
|
//#region src/configs/next.ts
|
|
950
843
|
async function next(options = {}) {
|
|
951
|
-
const { overrides = {} } = options;
|
|
844
|
+
const { files = [GLOB_SRC], overrides = {} } = options;
|
|
952
845
|
await ensurePackages(["@next/eslint-plugin-next"]);
|
|
953
|
-
const
|
|
846
|
+
const pluginNextJS = await interopDefault(import("@next/eslint-plugin-next"));
|
|
954
847
|
return [{
|
|
848
|
+
name: "next/setup",
|
|
849
|
+
plugins: { next: pluginNextJS }
|
|
850
|
+
}, {
|
|
851
|
+
files,
|
|
852
|
+
languageOptions: {
|
|
853
|
+
parserOptions: { ecmaFeatures: { jsx: true } },
|
|
854
|
+
sourceType: "module"
|
|
855
|
+
},
|
|
955
856
|
name: "next/rules",
|
|
956
|
-
plugins: { next: pluginNext },
|
|
957
857
|
rules: {
|
|
958
858
|
"next/google-font-display": "warn",
|
|
959
859
|
"next/google-font-preconnect": "warn",
|
|
@@ -977,7 +877,8 @@ async function next(options = {}) {
|
|
|
977
877
|
"next/no-typos": "warn",
|
|
978
878
|
"next/no-unwanted-polyfillio": "warn",
|
|
979
879
|
...overrides
|
|
980
|
-
}
|
|
880
|
+
},
|
|
881
|
+
settings: { react: { version: "detect" } }
|
|
981
882
|
}];
|
|
982
883
|
}
|
|
983
884
|
|
|
@@ -1202,7 +1103,11 @@ async function react(options = {}) {
|
|
|
1202
1103
|
"links",
|
|
1203
1104
|
"headers",
|
|
1204
1105
|
"loader",
|
|
1205
|
-
"action"
|
|
1106
|
+
"action",
|
|
1107
|
+
"clientLoader",
|
|
1108
|
+
"clientAction",
|
|
1109
|
+
"handle",
|
|
1110
|
+
"shouldRevalidate"
|
|
1206
1111
|
] : []]
|
|
1207
1112
|
}],
|
|
1208
1113
|
...overrides
|
|
@@ -1346,7 +1251,7 @@ async function sortPackageJson() {
|
|
|
1346
1251
|
*/
|
|
1347
1252
|
function sortTsconfig() {
|
|
1348
1253
|
return [{
|
|
1349
|
-
files: ["**/
|
|
1254
|
+
files: ["**/[jt]sconfig.json", "**/[jt]sconfig.*.json"],
|
|
1350
1255
|
name: "sort/tsconfig-json",
|
|
1351
1256
|
rules: { "jsonc/sort-keys": [
|
|
1352
1257
|
"error",
|
|
@@ -1683,6 +1588,212 @@ async function unocss(options = {}) {
|
|
|
1683
1588
|
}];
|
|
1684
1589
|
}
|
|
1685
1590
|
|
|
1591
|
+
//#endregion
|
|
1592
|
+
//#region src/configs/vue.ts
|
|
1593
|
+
async function vue(options = {}) {
|
|
1594
|
+
const { a11y = false, files = [GLOB_VUE], overrides = {}, stylistic: stylistic$1 = true, vueVersion = 3 } = options;
|
|
1595
|
+
const sfcBlocks = options.sfcBlocks === true ? {} : options.sfcBlocks ?? {};
|
|
1596
|
+
const { indent = 2 } = typeof stylistic$1 === "boolean" ? {} : stylistic$1;
|
|
1597
|
+
if (a11y) await ensurePackages(["eslint-plugin-vuejs-accessibility"]);
|
|
1598
|
+
const [pluginVue, parserVue, processorVueBlocks, pluginVueA11y] = await Promise.all([
|
|
1599
|
+
interopDefault(import("eslint-plugin-vue")),
|
|
1600
|
+
interopDefault(import("vue-eslint-parser")),
|
|
1601
|
+
interopDefault(import("eslint-processor-vue-blocks")),
|
|
1602
|
+
...a11y ? [interopDefault(import("eslint-plugin-vuejs-accessibility"))] : []
|
|
1603
|
+
]);
|
|
1604
|
+
return [{
|
|
1605
|
+
languageOptions: { globals: {
|
|
1606
|
+
computed: "readonly",
|
|
1607
|
+
defineEmits: "readonly",
|
|
1608
|
+
defineExpose: "readonly",
|
|
1609
|
+
defineProps: "readonly",
|
|
1610
|
+
onMounted: "readonly",
|
|
1611
|
+
onUnmounted: "readonly",
|
|
1612
|
+
reactive: "readonly",
|
|
1613
|
+
ref: "readonly",
|
|
1614
|
+
shallowReactive: "readonly",
|
|
1615
|
+
shallowRef: "readonly",
|
|
1616
|
+
toRef: "readonly",
|
|
1617
|
+
toRefs: "readonly",
|
|
1618
|
+
watch: "readonly",
|
|
1619
|
+
watchEffect: "readonly"
|
|
1620
|
+
} },
|
|
1621
|
+
name: "antfu/vue/setup",
|
|
1622
|
+
plugins: {
|
|
1623
|
+
vue: pluginVue,
|
|
1624
|
+
...a11y ? { "vue-a11y": pluginVueA11y } : {}
|
|
1625
|
+
}
|
|
1626
|
+
}, {
|
|
1627
|
+
files,
|
|
1628
|
+
languageOptions: {
|
|
1629
|
+
parser: parserVue,
|
|
1630
|
+
parserOptions: {
|
|
1631
|
+
ecmaFeatures: { jsx: true },
|
|
1632
|
+
extraFileExtensions: [".vue"],
|
|
1633
|
+
parser: options.typescript ? await interopDefault(import("@typescript-eslint/parser")) : null,
|
|
1634
|
+
sourceType: "module"
|
|
1635
|
+
}
|
|
1636
|
+
},
|
|
1637
|
+
name: "antfu/vue/rules",
|
|
1638
|
+
processor: sfcBlocks === false ? pluginVue.processors[".vue"] : mergeProcessors([pluginVue.processors[".vue"], processorVueBlocks({
|
|
1639
|
+
...sfcBlocks,
|
|
1640
|
+
blocks: {
|
|
1641
|
+
styles: true,
|
|
1642
|
+
...sfcBlocks.blocks
|
|
1643
|
+
}
|
|
1644
|
+
})]),
|
|
1645
|
+
rules: {
|
|
1646
|
+
...pluginVue.configs.base.rules,
|
|
1647
|
+
...vueVersion === 2 ? {
|
|
1648
|
+
...pluginVue.configs["vue2-essential"].rules,
|
|
1649
|
+
...pluginVue.configs["vue2-strongly-recommended"].rules,
|
|
1650
|
+
...pluginVue.configs["vue2-recommended"].rules
|
|
1651
|
+
} : {
|
|
1652
|
+
...pluginVue.configs["flat/essential"].map((c) => c.rules).reduce((acc, c) => ({
|
|
1653
|
+
...acc,
|
|
1654
|
+
...c
|
|
1655
|
+
}), {}),
|
|
1656
|
+
...pluginVue.configs["flat/strongly-recommended"].map((c) => c.rules).reduce((acc, c) => ({
|
|
1657
|
+
...acc,
|
|
1658
|
+
...c
|
|
1659
|
+
}), {}),
|
|
1660
|
+
...pluginVue.configs["flat/recommended"].map((c) => c.rules).reduce((acc, c) => ({
|
|
1661
|
+
...acc,
|
|
1662
|
+
...c
|
|
1663
|
+
}), {})
|
|
1664
|
+
},
|
|
1665
|
+
"antfu/no-top-level-await": "off",
|
|
1666
|
+
"node/prefer-global/process": "off",
|
|
1667
|
+
"ts/explicit-function-return-type": "off",
|
|
1668
|
+
"vue/block-order": ["error", { order: [
|
|
1669
|
+
"script",
|
|
1670
|
+
"template",
|
|
1671
|
+
"style"
|
|
1672
|
+
] }],
|
|
1673
|
+
"vue/component-name-in-template-casing": ["error", "PascalCase"],
|
|
1674
|
+
"vue/component-options-name-casing": ["error", "PascalCase"],
|
|
1675
|
+
"vue/component-tags-order": "off",
|
|
1676
|
+
"vue/custom-event-name-casing": ["error", "camelCase"],
|
|
1677
|
+
"vue/define-macros-order": ["error", { order: [
|
|
1678
|
+
"defineOptions",
|
|
1679
|
+
"defineProps",
|
|
1680
|
+
"defineEmits",
|
|
1681
|
+
"defineSlots"
|
|
1682
|
+
] }],
|
|
1683
|
+
"vue/dot-location": ["error", "property"],
|
|
1684
|
+
"vue/dot-notation": ["error", { allowKeywords: true }],
|
|
1685
|
+
"vue/eqeqeq": ["error", "smart"],
|
|
1686
|
+
"vue/html-indent": ["error", indent],
|
|
1687
|
+
"vue/html-quotes": ["error", "double"],
|
|
1688
|
+
"vue/max-attributes-per-line": "off",
|
|
1689
|
+
"vue/multi-word-component-names": "off",
|
|
1690
|
+
"vue/no-dupe-keys": "off",
|
|
1691
|
+
"vue/no-empty-pattern": "error",
|
|
1692
|
+
"vue/no-irregular-whitespace": "error",
|
|
1693
|
+
"vue/no-loss-of-precision": "error",
|
|
1694
|
+
"vue/no-restricted-syntax": [
|
|
1695
|
+
"error",
|
|
1696
|
+
"DebuggerStatement",
|
|
1697
|
+
"LabeledStatement",
|
|
1698
|
+
"WithStatement"
|
|
1699
|
+
],
|
|
1700
|
+
"vue/no-restricted-v-bind": ["error", "/^v-/"],
|
|
1701
|
+
"vue/no-setup-props-reactivity-loss": "off",
|
|
1702
|
+
"vue/no-sparse-arrays": "error",
|
|
1703
|
+
"vue/no-unused-refs": "error",
|
|
1704
|
+
"vue/no-useless-v-bind": "error",
|
|
1705
|
+
"vue/no-v-html": "off",
|
|
1706
|
+
"vue/object-shorthand": [
|
|
1707
|
+
"error",
|
|
1708
|
+
"always",
|
|
1709
|
+
{
|
|
1710
|
+
avoidQuotes: true,
|
|
1711
|
+
ignoreConstructors: false
|
|
1712
|
+
}
|
|
1713
|
+
],
|
|
1714
|
+
"vue/prefer-separate-static-class": "error",
|
|
1715
|
+
"vue/prefer-template": "error",
|
|
1716
|
+
"vue/prop-name-casing": ["error", "camelCase"],
|
|
1717
|
+
"vue/require-default-prop": "off",
|
|
1718
|
+
"vue/require-prop-types": "off",
|
|
1719
|
+
"vue/space-infix-ops": "error",
|
|
1720
|
+
"vue/space-unary-ops": ["error", {
|
|
1721
|
+
nonwords: false,
|
|
1722
|
+
words: true
|
|
1723
|
+
}],
|
|
1724
|
+
...stylistic$1 ? {
|
|
1725
|
+
"vue/array-bracket-spacing": ["error", "never"],
|
|
1726
|
+
"vue/arrow-spacing": ["error", {
|
|
1727
|
+
after: true,
|
|
1728
|
+
before: true
|
|
1729
|
+
}],
|
|
1730
|
+
"vue/block-spacing": ["error", "always"],
|
|
1731
|
+
"vue/block-tag-newline": ["error", {
|
|
1732
|
+
multiline: "always",
|
|
1733
|
+
singleline: "always"
|
|
1734
|
+
}],
|
|
1735
|
+
"vue/brace-style": [
|
|
1736
|
+
"error",
|
|
1737
|
+
"stroustrup",
|
|
1738
|
+
{ allowSingleLine: true }
|
|
1739
|
+
],
|
|
1740
|
+
"vue/comma-dangle": ["error", "always-multiline"],
|
|
1741
|
+
"vue/comma-spacing": ["error", {
|
|
1742
|
+
after: true,
|
|
1743
|
+
before: false
|
|
1744
|
+
}],
|
|
1745
|
+
"vue/comma-style": ["error", "last"],
|
|
1746
|
+
"vue/html-comment-content-spacing": [
|
|
1747
|
+
"error",
|
|
1748
|
+
"always",
|
|
1749
|
+
{ exceptions: ["-"] }
|
|
1750
|
+
],
|
|
1751
|
+
"vue/key-spacing": ["error", {
|
|
1752
|
+
afterColon: true,
|
|
1753
|
+
beforeColon: false
|
|
1754
|
+
}],
|
|
1755
|
+
"vue/keyword-spacing": ["error", {
|
|
1756
|
+
after: true,
|
|
1757
|
+
before: true
|
|
1758
|
+
}],
|
|
1759
|
+
"vue/object-curly-newline": "off",
|
|
1760
|
+
"vue/object-curly-spacing": ["error", "always"],
|
|
1761
|
+
"vue/object-property-newline": ["error", { allowAllPropertiesOnSameLine: true }],
|
|
1762
|
+
"vue/operator-linebreak": ["error", "before"],
|
|
1763
|
+
"vue/padding-line-between-blocks": ["error", "always"],
|
|
1764
|
+
"vue/quote-props": ["error", "consistent-as-needed"],
|
|
1765
|
+
"vue/space-in-parens": ["error", "never"],
|
|
1766
|
+
"vue/template-curly-spacing": "error"
|
|
1767
|
+
} : {},
|
|
1768
|
+
...a11y ? {
|
|
1769
|
+
"vue-a11y/alt-text": "error",
|
|
1770
|
+
"vue-a11y/anchor-has-content": "error",
|
|
1771
|
+
"vue-a11y/aria-props": "error",
|
|
1772
|
+
"vue-a11y/aria-role": "error",
|
|
1773
|
+
"vue-a11y/aria-unsupported-elements": "error",
|
|
1774
|
+
"vue-a11y/click-events-have-key-events": "error",
|
|
1775
|
+
"vue-a11y/form-control-has-label": "error",
|
|
1776
|
+
"vue-a11y/heading-has-content": "error",
|
|
1777
|
+
"vue-a11y/iframe-has-title": "error",
|
|
1778
|
+
"vue-a11y/interactive-supports-focus": "error",
|
|
1779
|
+
"vue-a11y/label-has-for": "error",
|
|
1780
|
+
"vue-a11y/media-has-caption": "warn",
|
|
1781
|
+
"vue-a11y/mouse-events-have-key-events": "error",
|
|
1782
|
+
"vue-a11y/no-access-key": "error",
|
|
1783
|
+
"vue-a11y/no-aria-hidden-on-focusable": "error",
|
|
1784
|
+
"vue-a11y/no-autofocus": "warn",
|
|
1785
|
+
"vue-a11y/no-distracting-elements": "error",
|
|
1786
|
+
"vue-a11y/no-redundant-roles": "error",
|
|
1787
|
+
"vue-a11y/no-role-presentation-on-focusable": "error",
|
|
1788
|
+
"vue-a11y/no-static-element-interactions": "error",
|
|
1789
|
+
"vue-a11y/role-has-required-aria-props": "error",
|
|
1790
|
+
"vue-a11y/tabindex-no-positive": "warn"
|
|
1791
|
+
} : {},
|
|
1792
|
+
...overrides
|
|
1793
|
+
}
|
|
1794
|
+
}];
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1686
1797
|
//#endregion
|
|
1687
1798
|
//#region src/configs/yaml.ts
|
|
1688
1799
|
async function yaml(options = {}) {
|
|
@@ -1780,7 +1891,7 @@ const defaultPluginRenaming = {
|
|
|
1780
1891
|
"@eslint-react/naming-convention": "react-naming-convention",
|
|
1781
1892
|
"@stylistic": "style",
|
|
1782
1893
|
"@typescript-eslint": "ts",
|
|
1783
|
-
"import-
|
|
1894
|
+
"import-lite": "import",
|
|
1784
1895
|
"n": "node",
|
|
1785
1896
|
"yml": "yaml"
|
|
1786
1897
|
};
|
|
@@ -1796,7 +1907,7 @@ const defaultPluginRenaming = {
|
|
|
1796
1907
|
*/
|
|
1797
1908
|
function config(options = {}, ...userConfigs) {
|
|
1798
1909
|
const isUsingReact = ReactPackages.some((i) => isPackageExists(i));
|
|
1799
|
-
const { autoRenamePlugins = true, componentExts = [], effector: enableEffector = isPackageExists("effector"),
|
|
1910
|
+
const { autoRenamePlugins = true, componentExts = [], effector: enableEffector = isPackageExists("effector"), gitignore: enableGitignore = true, imports: enableImports = true, jsx: enableJsx = true, jsxA11y: enableJsxA11y = isUsingReact, next: enableNext = NextJsPackages.some((i) => isPackageExists(i)), pnpm: enableCatalogs = false, react: enableReact = isUsingReact, regexp: enableRegexp = true, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false, vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
|
|
1800
1911
|
let isInEditor = options.isInEditor;
|
|
1801
1912
|
if (isInEditor == null) {
|
|
1802
1913
|
isInEditor = isInEditorEnv();
|
|
@@ -1819,7 +1930,12 @@ function config(options = {}, ...userConfigs) {
|
|
|
1819
1930
|
isInEditor,
|
|
1820
1931
|
overrides: getOverrides(options, "javascript")
|
|
1821
1932
|
}), comments(), node(), imports({ stylistic: stylisticOptions }), perfectionist());
|
|
1933
|
+
if (enableImports) configs$1.push(imports(enableImports === true ? { stylistic: stylisticOptions } : {
|
|
1934
|
+
stylistic: stylisticOptions,
|
|
1935
|
+
...enableImports
|
|
1936
|
+
}));
|
|
1822
1937
|
if (enableUnicorn) configs$1.push(unicorn(enableUnicorn === true ? {} : enableUnicorn));
|
|
1938
|
+
if (enableVue) componentExts.push("vue");
|
|
1823
1939
|
if (enableJsx) configs$1.push(jsx());
|
|
1824
1940
|
if (enableTypeScript) configs$1.push(typescript({
|
|
1825
1941
|
...typescriptOptions,
|
|
@@ -1832,6 +1948,12 @@ function config(options = {}, ...userConfigs) {
|
|
|
1832
1948
|
overrides: getOverrides(options, "stylistic")
|
|
1833
1949
|
}));
|
|
1834
1950
|
if (enableRegexp) configs$1.push(regexp(typeof enableRegexp === "boolean" ? {} : enableRegexp));
|
|
1951
|
+
if (enableVue) configs$1.push(vue({
|
|
1952
|
+
...resolveSubOptions(options, "vue"),
|
|
1953
|
+
overrides: getOverrides(options, "vue"),
|
|
1954
|
+
stylistic: stylisticOptions,
|
|
1955
|
+
typescript: !!enableTypeScript
|
|
1956
|
+
}));
|
|
1835
1957
|
if (enableReact) configs$1.push(react({
|
|
1836
1958
|
...typescriptOptions,
|
|
1837
1959
|
overrides: getOverrides(options, "react"),
|
|
@@ -1839,7 +1961,6 @@ function config(options = {}, ...userConfigs) {
|
|
|
1839
1961
|
}));
|
|
1840
1962
|
if (enableJsxA11y) configs$1.push(jsxA11y({ overrides: getOverrides(options, "jsxA11y") }));
|
|
1841
1963
|
if (enableNext) configs$1.push(next({ overrides: getOverrides(options, "next") }));
|
|
1842
|
-
if (enableFsd) configs$1.push(fsd({ ...resolveSubOptions(options, "fsd") }));
|
|
1843
1964
|
if (enableEffector) configs$1.push(effector({
|
|
1844
1965
|
...resolveSubOptions(options, "effector"),
|
|
1845
1966
|
overrides: getOverrides(options, "effector")
|
|
@@ -1885,4 +2006,4 @@ function config(options = {}, ...userConfigs) {
|
|
|
1885
2006
|
var src_default = config;
|
|
1886
2007
|
|
|
1887
2008
|
//#endregion
|
|
1888
|
-
export { GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVG, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_XML, GLOB_YAML, StylisticConfigDefaults, combine, comments, config, src_default as default, defaultPluginRenaming, disables, effector, ensurePackages, formatters,
|
|
2009
|
+
export { GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVG, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, StylisticConfigDefaults, combine, comments, config, src_default as default, defaultPluginRenaming, disables, effector, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsonc, jsx, jsxA11y, markdown, next, node, parserPlain, perfectionist, pnpm, react, regexp, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, toml, typescript, unicorn, unocss, vue, yaml };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ghettoddos/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.7.0",
|
|
5
5
|
"description": "ghettoDdOS ESLint config",
|
|
6
6
|
"author": "ghettoDdOS <pen.egor2002@gamil.com> (https://github.com/ghettoDdOS/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@next/eslint-plugin-next": "^15.3
|
|
29
|
-
"@prettier/plugin-xml": "^3.4.
|
|
28
|
+
"@next/eslint-plugin-next": "^15.4.3",
|
|
29
|
+
"@prettier/plugin-xml": "^3.4.2",
|
|
30
30
|
"@unocss/eslint-plugin": ">=0.50.0",
|
|
31
31
|
"eslint": "^9.10.0",
|
|
32
|
-
"eslint-plugin-boundaries": "^5.0.1",
|
|
33
32
|
"eslint-plugin-effector": "^0.15.0",
|
|
34
33
|
"eslint-plugin-format": ">=0.1.0",
|
|
35
|
-
"eslint-plugin-jsx-a11y": "^6.10.2"
|
|
34
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
35
|
+
"eslint-plugin-vuejs-accessibility": "^2.4.1"
|
|
36
36
|
},
|
|
37
37
|
"peerDependenciesMeta": {
|
|
38
38
|
"@next/eslint-plugin-next": {
|
|
@@ -44,9 +44,6 @@
|
|
|
44
44
|
"@unocss/eslint-plugin": {
|
|
45
45
|
"optional": true
|
|
46
46
|
},
|
|
47
|
-
"eslint-plugin-boundaries": {
|
|
48
|
-
"optional": true
|
|
49
|
-
},
|
|
50
47
|
"eslint-plugin-effector": {
|
|
51
48
|
"optional": true
|
|
52
49
|
},
|
|
@@ -55,58 +52,65 @@
|
|
|
55
52
|
},
|
|
56
53
|
"eslint-plugin-jsx-a11y": {
|
|
57
54
|
"optional": true
|
|
55
|
+
},
|
|
56
|
+
"eslint-plugin-vuejs-accessibility": {
|
|
57
|
+
"optional": true
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@antfu/install-pkg": "^1.1.0",
|
|
62
62
|
"@clack/prompts": "^0.11.0",
|
|
63
63
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
64
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
65
|
-
"@eslint/compat": "^1.
|
|
66
|
-
"@eslint/markdown": "^
|
|
67
|
-
"@stylistic/eslint-plugin": "^
|
|
68
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
69
|
-
"@typescript-eslint/parser": "^8.
|
|
64
|
+
"@eslint-react/eslint-plugin": "^1.52.3",
|
|
65
|
+
"@eslint/compat": "^1.3.1",
|
|
66
|
+
"@eslint/markdown": "^7.1.0",
|
|
67
|
+
"@stylistic/eslint-plugin": "^5.2.2",
|
|
68
|
+
"@typescript-eslint/eslint-plugin": "^8.38.0",
|
|
69
|
+
"@typescript-eslint/parser": "^8.38.0",
|
|
70
70
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
71
71
|
"eslint-flat-config-utils": "^2.1.0",
|
|
72
72
|
"eslint-merge-processors": "^2.0.0",
|
|
73
73
|
"eslint-plugin-antfu": "^3.1.1",
|
|
74
|
-
"eslint-plugin-import-
|
|
74
|
+
"eslint-plugin-import-lite": "^0.3.0",
|
|
75
|
+
"eslint-plugin-import-x": "^4.16.1",
|
|
75
76
|
"eslint-plugin-jsonc": "^2.20.1",
|
|
76
|
-
"eslint-plugin-n": "^17.
|
|
77
|
-
"eslint-plugin-perfectionist": "^4.
|
|
78
|
-
"eslint-plugin-pnpm": "^
|
|
77
|
+
"eslint-plugin-n": "^17.21.0",
|
|
78
|
+
"eslint-plugin-perfectionist": "^4.15.0",
|
|
79
|
+
"eslint-plugin-pnpm": "^1.1.0",
|
|
79
80
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
80
81
|
"eslint-plugin-react-refresh": "^0.4.20",
|
|
81
|
-
"eslint-plugin-regexp": "^2.
|
|
82
|
+
"eslint-plugin-regexp": "^2.9.0",
|
|
82
83
|
"eslint-plugin-toml": "^0.12.0",
|
|
83
|
-
"eslint-plugin-unicorn": "^
|
|
84
|
+
"eslint-plugin-unicorn": "^60.0.0",
|
|
84
85
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
86
|
+
"eslint-plugin-vue": "^10.3.0",
|
|
85
87
|
"eslint-plugin-yml": "^1.18.0",
|
|
86
|
-
"
|
|
88
|
+
"eslint-processor-vue-blocks": "^2.0.0",
|
|
89
|
+
"globals": "^16.3.0",
|
|
87
90
|
"jsonc-eslint-parser": "^2.4.0",
|
|
88
91
|
"local-pkg": "^1.1.1",
|
|
89
92
|
"parse-gitignore": "^2.0.0",
|
|
90
93
|
"toml-eslint-parser": "^0.10.0",
|
|
94
|
+
"vue-eslint-parser": "^10.2.0",
|
|
91
95
|
"yaml-eslint-parser": "^1.3.0"
|
|
92
96
|
},
|
|
93
97
|
"devDependencies": {
|
|
94
|
-
"@eslint/config-inspector": "^1.0
|
|
95
|
-
"@next/eslint-plugin-next": "^15.3
|
|
96
|
-
"@prettier/plugin-xml": "^3.4.
|
|
97
|
-
"@types/node": "^
|
|
98
|
-
"@unocss/eslint-plugin": "66.
|
|
99
|
-
"bumpp": "^10.
|
|
100
|
-
"eslint": "^9.
|
|
101
|
-
"eslint-plugin-boundaries": "^5.0.1",
|
|
98
|
+
"@eslint/config-inspector": "^1.1.0",
|
|
99
|
+
"@next/eslint-plugin-next": "^15.4.3",
|
|
100
|
+
"@prettier/plugin-xml": "^3.4.2",
|
|
101
|
+
"@types/node": "^24.1.0",
|
|
102
|
+
"@unocss/eslint-plugin": "^66.3.3",
|
|
103
|
+
"bumpp": "^10.2.0",
|
|
104
|
+
"eslint": "^9.31.0",
|
|
102
105
|
"eslint-plugin-effector": "^0.15.0",
|
|
103
106
|
"eslint-plugin-format": "^1.0.1",
|
|
104
107
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
105
|
-
"eslint-
|
|
106
|
-
"
|
|
108
|
+
"eslint-plugin-vuejs-accessibility": "^2.4.1",
|
|
109
|
+
"eslint-typegen": "^2.2.1",
|
|
110
|
+
"lint-staged": "^16.1.2",
|
|
107
111
|
"simple-git-hooks": "^2.13.0",
|
|
108
|
-
"tsdown": "^0.
|
|
109
|
-
"tsx": "^4.
|
|
112
|
+
"tsdown": "^0.13.0",
|
|
113
|
+
"tsx": "^4.20.3",
|
|
110
114
|
"typescript": "^5.8.3"
|
|
111
115
|
},
|
|
112
116
|
"simple-git-hooks": {
|