@zjutjh/eslint-config 2.0.0-beta.2 → 2.0.0-beta.4
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 +2 -1
- package/dist/index.mjs +16 -3
- package/package.json +2 -1
package/dist/index.d.mts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import { isPackageExists } from "local-pkg";
|
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { isAbsolute, resolve } from "node:path";
|
|
4
4
|
import { includeIgnoreFile } from "@eslint/compat";
|
|
5
|
+
import { createNextImportResolver } from "eslint-import-resolver-next";
|
|
5
6
|
import importXPlugin, { flatConfigs } from "eslint-plugin-import-x";
|
|
6
7
|
import simpleImportSortPlugin from "eslint-plugin-simple-import-sort";
|
|
7
8
|
import eslintJS from "@eslint/js";
|
|
@@ -21,6 +22,7 @@ const GLOB_HTML = "**/*.html";
|
|
|
21
22
|
const GLOB_JSON = "**/*.json";
|
|
22
23
|
const GLOB_JSON5 = "**/*.json5";
|
|
23
24
|
const GLOB_JSONC = "**/*.jsonc";
|
|
25
|
+
const GLOB_YAML = "**/*.y?(a)ml";
|
|
24
26
|
/**
|
|
25
27
|
* @see https://github.com/antfu/eslint-config/blob/04ae86dd43e86d8b925555d85adf080494efeab3/src/globs.ts#L56
|
|
26
28
|
*/
|
|
@@ -81,7 +83,8 @@ function imports() {
|
|
|
81
83
|
plugins: {
|
|
82
84
|
"simple-import-sort": simpleImportSortPlugin,
|
|
83
85
|
"import-x": importXPlugin
|
|
84
|
-
}
|
|
86
|
+
},
|
|
87
|
+
settings: { "import-x/resolver-next": [createNextImportResolver()] }
|
|
85
88
|
}, {
|
|
86
89
|
name: "zjutjh/imports/rules",
|
|
87
90
|
rules: {
|
|
@@ -183,7 +186,7 @@ const oxfmtOptions = {
|
|
|
183
186
|
singleAttributePerLine: false
|
|
184
187
|
};
|
|
185
188
|
function oxfmt(options) {
|
|
186
|
-
const { es: enableESFormat = true, html: enableHTMLFormat = true, css: enableCSSFormat = true, json: enableJSONFormat = true } = options?.lang ?? {};
|
|
189
|
+
const { es: enableESFormat = true, html: enableHTMLFormat = true, css: enableCSSFormat = true, json: enableJSONFormat = true, yaml: enableYAMLFormat = true } = options?.lang ?? {};
|
|
187
190
|
const mergedOptions = {
|
|
188
191
|
...oxfmtOptions,
|
|
189
192
|
...options?.oxfmtSelfOptions
|
|
@@ -229,6 +232,13 @@ function oxfmt(options) {
|
|
|
229
232
|
languageOptions: { parser: pluginFormat.parserPlain },
|
|
230
233
|
plugins: { format: pluginFormat },
|
|
231
234
|
rules: { "format/oxfmt": ["error", mergedOptions] }
|
|
235
|
+
} : {},
|
|
236
|
+
enableYAMLFormat ? {
|
|
237
|
+
name: "zjutjh/oxfmt/yaml",
|
|
238
|
+
files: [GLOB_YAML],
|
|
239
|
+
languageOptions: { parser: pluginFormat.parserPlain },
|
|
240
|
+
plugins: { format: pluginFormat },
|
|
241
|
+
rules: { "format/oxfmt": ["error", mergedOptions] }
|
|
232
242
|
} : {}
|
|
233
243
|
];
|
|
234
244
|
}
|
|
@@ -390,14 +400,17 @@ async function vue(options) {
|
|
|
390
400
|
...prev,
|
|
391
401
|
...curr
|
|
392
402
|
}), {}),
|
|
403
|
+
"no-useless-assignment": "off",
|
|
393
404
|
"vue/multi-word-component-names": ["warn", { ignores: ["index"] }],
|
|
394
405
|
"vue/component-name-in-template-casing": [
|
|
395
406
|
"error",
|
|
396
407
|
"kebab-case",
|
|
397
408
|
{ registeredComponentsOnly: true }
|
|
398
409
|
],
|
|
399
|
-
"vue/max-attributes-per-line": ["error", { singleline: { max: 3 } }],
|
|
400
410
|
"vue/prefer-true-attribute-shorthand": ["warn", options?.taro ? "never" : "always"],
|
|
411
|
+
"vue/singleline-html-element-content-newline": "off",
|
|
412
|
+
"vue/html-self-closing": "off",
|
|
413
|
+
"vue/max-attributes-per-line": "off",
|
|
401
414
|
...options?.overrides
|
|
402
415
|
}
|
|
403
416
|
}];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zjutjh/eslint-config",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.4",
|
|
4
4
|
"description": "ESLint config used by zjutjh",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "zjutjh",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"@clack/prompts": "^1.2.0",
|
|
27
27
|
"@eslint/compat": "^2.0.5",
|
|
28
28
|
"@eslint/js": "^10.0.1",
|
|
29
|
+
"eslint-import-resolver-next": "^0.6.0",
|
|
29
30
|
"eslint-plugin-format": "^2.0.1",
|
|
30
31
|
"eslint-plugin-import-x": "^4.16.2",
|
|
31
32
|
"eslint-plugin-simple-import-sort": "^13.0.0",
|