@svifty7/eslint-config 0.0.1 → 0.0.2
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 +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +52 -34
- package/package.json +8 -2
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -15380,7 +15380,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
15380
15380
|
onlyEquality?: boolean;
|
|
15381
15381
|
}];
|
|
15382
15382
|
// Names of all the configs
|
|
15383
|
-
type ConfigNames = 'eslint-comments/rules' | 'svifty7/formatter/setup' | 'svifty7/formatter/prettier' | 'svifty7/formatter/css' | 'svifty7/formatter/scss' | 'svifty7/formatter/less' | 'svifty7/formatter/html' | 'svifty7/formatter/
|
|
15383
|
+
type ConfigNames = 'eslint-comments/rules' | 'svifty7/formatter/setup' | 'svifty7/formatter/prettier' | 'svifty7/formatter/css' | 'svifty7/formatter/scss' | 'svifty7/formatter/less' | 'svifty7/formatter/html' | 'svifty7/formatter/markdown' | 'svifty7/formatter/graphql' | 'svifty7/formatter/xml' | 'svifty7/formatter/svg' | 'svifty7/imports/rules' | 'svifty7/javascript/setup' | 'svifty7/javascript/rules' | 'svifty7/jsx/setup' | 'svifty7/jsdoc/rules' | 'svifty7/jsonc/setup' | 'svifty7/jsonc/rules' | 'svifty7/markdown/setup' | 'svifty7/markdown/processor' | 'svifty7/markdown/parser' | 'svifty7/markdown/disables' | 'svifty7/node/rules' | 'svifty7/perfectionist/setup' | 'svifty7/sort/package-json' | 'svifty7/stylistic/rules' | 'svifty7/test/setup' | 'svifty7/test/rules' | 'svifty7/toml/setup' | 'svifty7/toml/rules' | 'svifty7/regexp/rules' | 'svifty7/typescript/setup' | 'svifty7/typescript/parser' | 'svifty7/typescript/rules' | 'svifty7/unicorn/rules' | 'svifty7/vue/setup' | 'svifty7/vue/rules' | 'svifty7/yaml/setup' | 'svifty7/yaml/rules' | 'svifty7/yaml/pnpm-workspace'; //#endregion
|
|
15384
15384
|
//#region src/types.d.ts
|
|
15385
15385
|
type Awaitable<T> = T | Promise<T>;
|
|
15386
15386
|
interface Rules extends RuleOptions {}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
2
|
-
import { isPackageExists } from "local-pkg";
|
|
2
|
+
import { isPackageExists, resolveModule } from "local-pkg";
|
|
3
3
|
import createCommand from "eslint-plugin-command/config";
|
|
4
4
|
import pluginComments from "@eslint-community/eslint-plugin-eslint-comments";
|
|
5
5
|
import pluginAntfu from "eslint-plugin-antfu";
|
|
@@ -8,6 +8,7 @@ import pluginNode from "eslint-plugin-n";
|
|
|
8
8
|
import pluginPerfectionist from "eslint-plugin-perfectionist";
|
|
9
9
|
import pluginUnicorn from "eslint-plugin-unicorn";
|
|
10
10
|
import pluginUnusedImports from "eslint-plugin-unused-imports";
|
|
11
|
+
import { fileURLToPath } from "node:url";
|
|
11
12
|
import globals from "globals";
|
|
12
13
|
import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
|
|
13
14
|
import { configs } from "eslint-plugin-regexp";
|
|
@@ -534,11 +535,24 @@ async function stylistic(options = {}) {
|
|
|
534
535
|
//#endregion
|
|
535
536
|
//#region src/configs/formatters.ts
|
|
536
537
|
function mergePrettierOptions(options, overrides = {}) {
|
|
537
|
-
|
|
538
|
+
const config = {
|
|
538
539
|
...options,
|
|
539
540
|
...overrides,
|
|
540
541
|
plugins: [...overrides.plugins || [], ...options.plugins || []]
|
|
541
542
|
};
|
|
543
|
+
if (config.parser === "xml") return {
|
|
544
|
+
parser: config.parser,
|
|
545
|
+
plugins: config.plugins,
|
|
546
|
+
bracketSameLine: config.bracketSameLine,
|
|
547
|
+
printWidth: config.printWidth,
|
|
548
|
+
singleAttributePerLine: config.singleAttributePerLine,
|
|
549
|
+
tabWidth: config.tabWidth,
|
|
550
|
+
xmlQuoteAttributes: config.xmlQuoteAttributes,
|
|
551
|
+
xmlSelfClosingSpace: config.xmlSelfClosingSpace,
|
|
552
|
+
xmlSortAttributesByKey: config.xmlSortAttributesByKey,
|
|
553
|
+
xmlWhitespaceSensitivity: config.xmlWhitespaceSensitivity
|
|
554
|
+
};
|
|
555
|
+
return config;
|
|
542
556
|
}
|
|
543
557
|
async function formatters(stylistic$1 = {}) {
|
|
544
558
|
const { indent, quotes, semi } = {
|
|
@@ -565,15 +579,9 @@ async function formatters(stylistic$1 = {}) {
|
|
|
565
579
|
endOfLine: "lf",
|
|
566
580
|
singleAttributePerLine: true,
|
|
567
581
|
objectWrap: "preserve",
|
|
568
|
-
experimentalTernaries:
|
|
582
|
+
experimentalTernaries: false,
|
|
569
583
|
experimentalOperatorPosition: "start"
|
|
570
584
|
};
|
|
571
|
-
const prettierXmlOptions = {
|
|
572
|
-
xmlQuoteAttributes: "double",
|
|
573
|
-
xmlSelfClosingSpace: true,
|
|
574
|
-
xmlSortAttributesByKey: false,
|
|
575
|
-
xmlWhitespaceSensitivity: "ignore"
|
|
576
|
-
};
|
|
577
585
|
const pluginFormat = await interopDefault(import("eslint-plugin-format"));
|
|
578
586
|
const configs$1 = [{
|
|
579
587
|
name: "svifty7/formatter/setup",
|
|
@@ -606,30 +614,6 @@ async function formatters(stylistic$1 = {}) {
|
|
|
606
614
|
name: "svifty7/formatter/html",
|
|
607
615
|
rules: { "format/prettier": ["error", mergePrettierOptions(prettierOptions, { parser: "html" })] }
|
|
608
616
|
});
|
|
609
|
-
configs$1.push({
|
|
610
|
-
files: [GLOB_XML],
|
|
611
|
-
languageOptions: { parser: parserPlain },
|
|
612
|
-
name: "svifty7/formatter/xml",
|
|
613
|
-
rules: { "format/prettier": ["error", mergePrettierOptions({
|
|
614
|
-
...prettierXmlOptions,
|
|
615
|
-
...prettierOptions
|
|
616
|
-
}, {
|
|
617
|
-
parser: "xml",
|
|
618
|
-
plugins: ["@prettier/plugin-xml"]
|
|
619
|
-
})] }
|
|
620
|
-
});
|
|
621
|
-
configs$1.push({
|
|
622
|
-
files: [GLOB_SVG],
|
|
623
|
-
languageOptions: { parser: parserPlain },
|
|
624
|
-
name: "svifty7/formatter/svg",
|
|
625
|
-
rules: { "format/prettier": ["error", mergePrettierOptions({
|
|
626
|
-
...prettierXmlOptions,
|
|
627
|
-
...prettierOptions
|
|
628
|
-
}, {
|
|
629
|
-
parser: "xml",
|
|
630
|
-
plugins: ["@prettier/plugin-xml"]
|
|
631
|
-
})] }
|
|
632
|
-
});
|
|
633
617
|
configs$1.push({
|
|
634
618
|
files: [GLOB_MARKDOWN],
|
|
635
619
|
languageOptions: { parser: parserPlain },
|
|
@@ -645,6 +629,40 @@ async function formatters(stylistic$1 = {}) {
|
|
|
645
629
|
name: "svifty7/formatter/graphql",
|
|
646
630
|
rules: { "format/prettier": ["error", mergePrettierOptions(prettierOptions, { parser: "graphql" })] }
|
|
647
631
|
});
|
|
632
|
+
const prettierXmlOptions = {
|
|
633
|
+
xmlQuoteAttributes: "double",
|
|
634
|
+
xmlSelfClosingSpace: true,
|
|
635
|
+
xmlSortAttributesByKey: false,
|
|
636
|
+
xmlWhitespaceSensitivity: "ignore"
|
|
637
|
+
};
|
|
638
|
+
const xmlPluginPath = resolveModule("@prettier/plugin-xml", { paths: [fileURLToPath(import.meta.url)] });
|
|
639
|
+
if (!xmlPluginPath) console.warn("[@svifty7/eslint-config] Failed to resolve @prettier/plugin-xml");
|
|
640
|
+
else {
|
|
641
|
+
configs$1.push({
|
|
642
|
+
files: [GLOB_XML],
|
|
643
|
+
languageOptions: { parser: parserPlain },
|
|
644
|
+
name: "svifty7/formatter/xml",
|
|
645
|
+
rules: { "format/prettier": ["error", mergePrettierOptions({
|
|
646
|
+
...prettierXmlOptions,
|
|
647
|
+
...prettierOptions
|
|
648
|
+
}, {
|
|
649
|
+
parser: "xml",
|
|
650
|
+
plugins: [xmlPluginPath]
|
|
651
|
+
})] }
|
|
652
|
+
});
|
|
653
|
+
configs$1.push({
|
|
654
|
+
files: [GLOB_SVG],
|
|
655
|
+
languageOptions: { parser: parserPlain },
|
|
656
|
+
name: "svifty7/formatter/svg",
|
|
657
|
+
rules: { "format/prettier": ["error", mergePrettierOptions({
|
|
658
|
+
...prettierXmlOptions,
|
|
659
|
+
...prettierOptions
|
|
660
|
+
}, {
|
|
661
|
+
parser: "xml",
|
|
662
|
+
plugins: [xmlPluginPath]
|
|
663
|
+
})] }
|
|
664
|
+
});
|
|
665
|
+
}
|
|
648
666
|
return configs$1;
|
|
649
667
|
}
|
|
650
668
|
|
|
@@ -1869,6 +1887,7 @@ async function vue(options = {}) {
|
|
|
1869
1887
|
"vue-a11y/label-has-for": "off",
|
|
1870
1888
|
"vue-a11y/no-autofocus": "off",
|
|
1871
1889
|
"vue-a11y/form-control-has-label": "off",
|
|
1890
|
+
"vue-a11y/no-static-element-interactions": "off",
|
|
1872
1891
|
"vue-a11y/alt-text": "error",
|
|
1873
1892
|
"vue-a11y/aria-props": "error",
|
|
1874
1893
|
"vue-a11y/aria-role": "error",
|
|
@@ -1882,7 +1901,6 @@ async function vue(options = {}) {
|
|
|
1882
1901
|
"vue-a11y/no-distracting-elements": "error",
|
|
1883
1902
|
"vue-a11y/no-redundant-roles": "error",
|
|
1884
1903
|
"vue-a11y/no-role-presentation-on-focusable": "error",
|
|
1885
|
-
"vue-a11y/no-static-element-interactions": "error",
|
|
1886
1904
|
"vue-a11y/role-has-required-aria-props": "error",
|
|
1887
1905
|
"vue-a11y/tabindex-no-positive": "warn"
|
|
1888
1906
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@svifty7/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.2",
|
|
5
5
|
"description": "ESLint config by svifty7 based on @antfu/eslint-config",
|
|
6
6
|
"author": "svifty7 (https://github.com/svifty7)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -34,7 +34,13 @@
|
|
|
34
34
|
"registry": "https://registry.npmjs.org/"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"eslint": "^9.26.0"
|
|
37
|
+
"eslint": "^9.26.0",
|
|
38
|
+
"vue": "^3.5.14"
|
|
39
|
+
},
|
|
40
|
+
"peerDependenciesMeta": {
|
|
41
|
+
"vue": {
|
|
42
|
+
"optional": true
|
|
43
|
+
}
|
|
38
44
|
},
|
|
39
45
|
"dependencies": {
|
|
40
46
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|