@favorodera/eslint-config 0.0.6 → 0.0.7
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 +94 -46
- package/dist/index.d.cts +38 -1
- package/dist/index.d.mts +38 -1
- package/dist/index.mjs +79 -47
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -41,6 +41,8 @@ const mdGlob = "**/*.md";
|
|
|
41
41
|
const mdInMdGlob = "**/*.md/*.md";
|
|
42
42
|
/** Glob pattern for matching code blocks embedded in Markdown files */
|
|
43
43
|
const codeInMdGlob = "**/*.md/**/*.{js,cjs,mjs,ts,cts,mts,vue}";
|
|
44
|
+
/** Glob pattern for matching scripts files */
|
|
45
|
+
const scriptsGlob = "**/*.{js,cjs,mjs,ts,cts,mts}";
|
|
44
46
|
/** Glob pattern for matching test files */
|
|
45
47
|
const testsGlob = ["**/*.{tests,specs,benchmark,bench}.{js,cjs,mjs,ts,cts,mts}", "**/__tests__/**/*.{js,cjs,mjs,ts,cts,mts}"];
|
|
46
48
|
/** Glob pattern for matching JSON files */
|
|
@@ -57,9 +59,11 @@ const yamlGlob = "**/*.{yml,yaml}";
|
|
|
57
59
|
const pnpmWorkspaceGlob = "pnpm-workspace.yaml";
|
|
58
60
|
/** Glob pattern for matching package.json files */
|
|
59
61
|
const packageJsonGlob = "**/package.json";
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Common glob patterns for files and directories that should be ignored by ESLint.
|
|
64
|
+
* Includes node_modules, build outputs, lock files, temporary files, and tool-specific caches.
|
|
65
|
+
*/
|
|
66
|
+
const ignoresGlob = [
|
|
63
67
|
"**/node_modules/**",
|
|
64
68
|
"**/dist/**",
|
|
65
69
|
"**/package-lock.json",
|
|
@@ -96,6 +100,9 @@ const defaultPatterns = [
|
|
|
96
100
|
"**/.agents",
|
|
97
101
|
"**/.*/skills"
|
|
98
102
|
];
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region src/configs/ignores.ts
|
|
105
|
+
const defaultPatterns = ignoresGlob;
|
|
99
106
|
/**
|
|
100
107
|
* Globs for ignoring files and directories from ESLint scanning.
|
|
101
108
|
* @param patterns Additional ignore patterns or a function to modify the defaults.
|
|
@@ -1152,7 +1159,7 @@ const unicornDefaults = { files: [
|
|
|
1152
1159
|
async function unicorn(options) {
|
|
1153
1160
|
const resolved = (0, defu.defu)(options, unicornDefaults);
|
|
1154
1161
|
const unicornPlugin = await importModule(import("eslint-plugin-unicorn"));
|
|
1155
|
-
const baseRules = unicornPlugin.configs.
|
|
1162
|
+
const baseRules = unicornPlugin.configs.recommended?.rules || {};
|
|
1156
1163
|
return [{
|
|
1157
1164
|
name: "favorodera/unicorn/setup",
|
|
1158
1165
|
plugins: { unicorn: unicornPlugin }
|
|
@@ -1162,21 +1169,7 @@ async function unicorn(options) {
|
|
|
1162
1169
|
name: "favorodera/unicorn/rules",
|
|
1163
1170
|
rules: {
|
|
1164
1171
|
...baseRules,
|
|
1165
|
-
"unicorn/
|
|
1166
|
-
"unicorn/error-message": "error",
|
|
1167
|
-
"unicorn/escape-case": "error",
|
|
1168
|
-
"unicorn/new-for-builtins": "error",
|
|
1169
|
-
"unicorn/no-instanceof-builtins": "error",
|
|
1170
|
-
"unicorn/no-new-array": "error",
|
|
1171
|
-
"unicorn/no-new-buffer": "error",
|
|
1172
|
-
"unicorn/number-literal-case": "error",
|
|
1173
|
-
"unicorn/prefer-dom-node-text-content": "error",
|
|
1174
|
-
"unicorn/prefer-includes": "error",
|
|
1175
|
-
"unicorn/prefer-node-protocol": "error",
|
|
1176
|
-
"unicorn/prefer-number-properties": "error",
|
|
1177
|
-
"unicorn/prefer-string-starts-ends-with": "error",
|
|
1178
|
-
"unicorn/prefer-type-error": "error",
|
|
1179
|
-
"unicorn/throw-new-error": "error",
|
|
1172
|
+
"unicorn/filename-case": "off",
|
|
1180
1173
|
...resolved.overrides
|
|
1181
1174
|
}
|
|
1182
1175
|
}];
|
|
@@ -1206,7 +1199,7 @@ async function vue(options) {
|
|
|
1206
1199
|
importModule(import("vue-eslint-parser")),
|
|
1207
1200
|
importModule(import("typescript-eslint"))
|
|
1208
1201
|
]);
|
|
1209
|
-
const baseRules = extractRules(vuePlugin.configs["flat/
|
|
1202
|
+
const baseRules = extractRules(vuePlugin.configs["flat/recommended-error"]);
|
|
1210
1203
|
const processor = sfcBlocks === false ? vuePlugin.processors[".vue"] : (0, eslint_merge_processors.mergeProcessors)([vuePlugin.processors[".vue"], (0, eslint_processor_vue_blocks.default)(sfcBlocks)]);
|
|
1211
1204
|
return [{
|
|
1212
1205
|
languageOptions: { globals: {
|
|
@@ -1241,22 +1234,78 @@ async function vue(options) {
|
|
|
1241
1234
|
processor,
|
|
1242
1235
|
rules: {
|
|
1243
1236
|
...baseRules,
|
|
1237
|
+
"vue/block-lang": ["error", { script: { lang: "ts" } }],
|
|
1244
1238
|
"vue/block-order": ["error", { order: [
|
|
1245
1239
|
"script",
|
|
1246
1240
|
"template",
|
|
1247
1241
|
"style"
|
|
1248
1242
|
] }],
|
|
1249
1243
|
"vue/block-tag-newline": ["error", {
|
|
1250
|
-
multiline: "
|
|
1251
|
-
singleline: "
|
|
1244
|
+
multiline: "always",
|
|
1245
|
+
singleline: "always"
|
|
1246
|
+
}],
|
|
1247
|
+
"vue/comment-directive": ["error", { reportUnusedDisableDirectives: true }],
|
|
1248
|
+
"vue/define-macros-order": ["error", {
|
|
1249
|
+
defineExposeLast: true,
|
|
1250
|
+
order: [
|
|
1251
|
+
"defineOptions",
|
|
1252
|
+
"definePage",
|
|
1253
|
+
"defineSlots",
|
|
1254
|
+
"defineEmits",
|
|
1255
|
+
"defineProps",
|
|
1256
|
+
"defineModel"
|
|
1257
|
+
]
|
|
1252
1258
|
}],
|
|
1253
|
-
"vue/
|
|
1254
|
-
"vue/
|
|
1259
|
+
"vue/define-props-declaration": ["error", "type-based"],
|
|
1260
|
+
"vue/define-props-destructuring": ["error", { destructure: "never" }],
|
|
1255
1261
|
"vue/multi-word-component-names": "off",
|
|
1256
|
-
"vue/
|
|
1257
|
-
|
|
1258
|
-
|
|
1262
|
+
"vue/next-tick-style": ["error", "promise"],
|
|
1263
|
+
"vue/no-import-compiler-macros": "error",
|
|
1264
|
+
"vue/no-negated-v-if-condition": "error",
|
|
1265
|
+
"vue/no-reserved-component-names": ["error", {
|
|
1266
|
+
disallowVue3BuiltInComponents: true,
|
|
1267
|
+
disallowVueBuiltInComponents: true,
|
|
1268
|
+
htmlElementCaseSensitive: false
|
|
1259
1269
|
}],
|
|
1270
|
+
"vue/no-root-v-if": "error",
|
|
1271
|
+
"vue/no-template-target-blank": "error",
|
|
1272
|
+
"vue/no-unused-emit-declarations": "error",
|
|
1273
|
+
"vue/no-unused-properties": "error",
|
|
1274
|
+
"vue/no-unused-refs": "error",
|
|
1275
|
+
"vue/no-use-v-else-with-v-for": "error",
|
|
1276
|
+
"vue/no-useless-mustaches": "error",
|
|
1277
|
+
"vue/no-useless-v-bind": "error",
|
|
1278
|
+
"vue/padding-line-between-blocks": "error",
|
|
1279
|
+
"vue/padding-line-between-tags": ["error", [
|
|
1280
|
+
{
|
|
1281
|
+
blankLine: "always",
|
|
1282
|
+
next: "*:multi-line",
|
|
1283
|
+
prev: "*:single-line"
|
|
1284
|
+
},
|
|
1285
|
+
{
|
|
1286
|
+
blankLine: "always",
|
|
1287
|
+
next: "*:single-line",
|
|
1288
|
+
prev: "*:multi-line"
|
|
1289
|
+
},
|
|
1290
|
+
{
|
|
1291
|
+
blankLine: "always",
|
|
1292
|
+
next: "*:multi-line",
|
|
1293
|
+
prev: "*:multi-line"
|
|
1294
|
+
},
|
|
1295
|
+
{
|
|
1296
|
+
blankLine: "never",
|
|
1297
|
+
next: "*:single-line",
|
|
1298
|
+
prev: "*:single-line"
|
|
1299
|
+
}
|
|
1300
|
+
]],
|
|
1301
|
+
"vue/prefer-prop-type-boolean-first": "error",
|
|
1302
|
+
"vue/prefer-separate-static-class": "error",
|
|
1303
|
+
"vue/prefer-single-event-payload": "error",
|
|
1304
|
+
"vue/prefer-use-template-ref": "error",
|
|
1305
|
+
"vue/require-explicit-slots": "error",
|
|
1306
|
+
"vue/require-macro-variable-name": "error",
|
|
1307
|
+
"vue/slot-name-casing": ["error", "kebab-case"],
|
|
1308
|
+
"vue/v-for-delimiter-style": ["error", "in"],
|
|
1260
1309
|
...resolved.overrides
|
|
1261
1310
|
}
|
|
1262
1311
|
}];
|
|
@@ -1273,7 +1322,7 @@ const yamlDefaults = { files: [yamlGlob] };
|
|
|
1273
1322
|
async function yaml(options) {
|
|
1274
1323
|
const resolved = (0, defu.defu)(options, yamlDefaults);
|
|
1275
1324
|
const [yamlPlugin, yamlParser] = await Promise.all([importModule(import("eslint-plugin-yml")), importModule(import("yaml-eslint-parser"))]);
|
|
1276
|
-
const baseRules = extractRules(yamlPlugin.configs.
|
|
1325
|
+
const baseRules = extractRules(yamlPlugin.configs.standard);
|
|
1277
1326
|
return [
|
|
1278
1327
|
{
|
|
1279
1328
|
name: "favorodera/yaml/setup",
|
|
@@ -1285,28 +1334,11 @@ async function yaml(options) {
|
|
|
1285
1334
|
name: "favorodera/yaml/rules",
|
|
1286
1335
|
rules: {
|
|
1287
1336
|
...(0, eslint_flat_config_utils.renamePluginsInRules)(baseRules, { yml: "yaml" }),
|
|
1288
|
-
"style/spaced-comment": "off",
|
|
1289
|
-
"yaml/block-mapping": "error",
|
|
1290
|
-
"yaml/block-mapping-question-indicator-newline": "error",
|
|
1291
|
-
"yaml/block-sequence": "error",
|
|
1292
|
-
"yaml/block-sequence-hyphen-indicator-newline": "error",
|
|
1293
|
-
"yaml/flow-mapping-curly-newline": "error",
|
|
1294
|
-
"yaml/flow-mapping-curly-spacing": "error",
|
|
1295
|
-
"yaml/flow-sequence-bracket-newline": "error",
|
|
1296
|
-
"yaml/flow-sequence-bracket-spacing": "error",
|
|
1297
|
-
"yaml/indent": ["error", 2],
|
|
1298
|
-
"yaml/key-spacing": "error",
|
|
1299
|
-
"yaml/no-empty-key": "error",
|
|
1300
|
-
"yaml/no-empty-sequence-entry": "error",
|
|
1301
|
-
"yaml/no-irregular-whitespace": "error",
|
|
1302
|
-
"yaml/no-tab-indent": "error",
|
|
1303
|
-
"yaml/plain-scalar": "error",
|
|
1304
1337
|
"yaml/quotes": ["error", {
|
|
1305
1338
|
avoidEscape: true,
|
|
1306
1339
|
prefer: "single"
|
|
1307
1340
|
}],
|
|
1308
|
-
"yaml/
|
|
1309
|
-
"yaml/vue-custom-block/no-parsing-error": "error",
|
|
1341
|
+
"yaml/require-string-key": "error",
|
|
1310
1342
|
...resolved.overrides
|
|
1311
1343
|
}
|
|
1312
1344
|
},
|
|
@@ -1430,6 +1462,22 @@ function factory(options = {}) {
|
|
|
1430
1462
|
return composer;
|
|
1431
1463
|
}
|
|
1432
1464
|
//#endregion
|
|
1465
|
+
exports.codeInMdGlob = codeInMdGlob;
|
|
1433
1466
|
exports.extractRules = extractRules;
|
|
1434
1467
|
exports.factory = factory;
|
|
1468
|
+
exports.ignoresGlob = ignoresGlob;
|
|
1435
1469
|
exports.importModule = importModule;
|
|
1470
|
+
exports.jsGlob = jsGlob;
|
|
1471
|
+
exports.json5Glob = json5Glob;
|
|
1472
|
+
exports.jsonGlob = jsonGlob;
|
|
1473
|
+
exports.jsoncGlob = jsoncGlob;
|
|
1474
|
+
exports.mdGlob = mdGlob;
|
|
1475
|
+
exports.mdInMdGlob = mdInMdGlob;
|
|
1476
|
+
exports.packageJsonGlob = packageJsonGlob;
|
|
1477
|
+
exports.pnpmWorkspaceGlob = pnpmWorkspaceGlob;
|
|
1478
|
+
exports.scriptsGlob = scriptsGlob;
|
|
1479
|
+
exports.testsGlob = testsGlob;
|
|
1480
|
+
exports.tsConfigGlob = tsConfigGlob;
|
|
1481
|
+
exports.tsGlob = tsGlob;
|
|
1482
|
+
exports.vueGlob = vueGlob;
|
|
1483
|
+
exports.yamlGlob = yamlGlob;
|
package/dist/index.d.cts
CHANGED
|
@@ -18329,6 +18329,43 @@ interface ConfigOptions {
|
|
|
18329
18329
|
*/
|
|
18330
18330
|
declare function factory(options?: ConfigOptions): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
18331
18331
|
//#endregion
|
|
18332
|
+
//#region src/globs.d.ts
|
|
18333
|
+
/** Glob pattern for matching JavaScript files */
|
|
18334
|
+
declare const jsGlob = "**/*.{js,cjs,mjs}";
|
|
18335
|
+
/** Glob pattern for matching TypeScript files */
|
|
18336
|
+
declare const tsGlob = "**/*.{ts,cts,mts}";
|
|
18337
|
+
/** Glob pattern for matching Vue single-file components */
|
|
18338
|
+
declare const vueGlob = "**/*.vue";
|
|
18339
|
+
/** Glob pattern for matching Markdown files */
|
|
18340
|
+
declare const mdGlob = "**/*.md";
|
|
18341
|
+
/** Glob pattern for matching virtual files extracted from Markdown */
|
|
18342
|
+
declare const mdInMdGlob = "**/*.md/*.md";
|
|
18343
|
+
/** Glob pattern for matching code blocks embedded in Markdown files */
|
|
18344
|
+
declare const codeInMdGlob = "**/*.md/**/*.{js,cjs,mjs,ts,cts,mts,vue}";
|
|
18345
|
+
/** Glob pattern for matching scripts files */
|
|
18346
|
+
declare const scriptsGlob = "**/*.{js,cjs,mjs,ts,cts,mts}";
|
|
18347
|
+
/** Glob pattern for matching test files */
|
|
18348
|
+
declare const testsGlob: string[];
|
|
18349
|
+
/** Glob pattern for matching JSON files */
|
|
18350
|
+
declare const jsonGlob = "**/*.json";
|
|
18351
|
+
/** Glob pattern for matching JSON5 files */
|
|
18352
|
+
declare const json5Glob = "**/*.json5";
|
|
18353
|
+
/** Glob pattern for matching JSON with Comments files */
|
|
18354
|
+
declare const jsoncGlob = "**/*.jsonc";
|
|
18355
|
+
/** Glob patterns for matching TypeScript configuration files */
|
|
18356
|
+
declare const tsConfigGlob: string[];
|
|
18357
|
+
/** Glob pattern for matching YAML files */
|
|
18358
|
+
declare const yamlGlob = "**/*.{yml,yaml}";
|
|
18359
|
+
/** Glob pattern for matching pnpm-workspace.yaml file */
|
|
18360
|
+
declare const pnpmWorkspaceGlob = "pnpm-workspace.yaml";
|
|
18361
|
+
/** Glob pattern for matching package.json files */
|
|
18362
|
+
declare const packageJsonGlob = "**/package.json";
|
|
18363
|
+
/**
|
|
18364
|
+
* Common glob patterns for files and directories that should be ignored by ESLint.
|
|
18365
|
+
* Includes node_modules, build outputs, lock files, temporary files, and tool-specific caches.
|
|
18366
|
+
*/
|
|
18367
|
+
declare const ignoresGlob: string[];
|
|
18368
|
+
//#endregion
|
|
18332
18369
|
//#region src/utils.d.ts
|
|
18333
18370
|
/**
|
|
18334
18371
|
* Extracts and merges the rules from multiple ESLint configuration arrays.
|
|
@@ -18352,4 +18389,4 @@ declare function importModule<TModule>(module: Awaitable<TModule>): Promise<TMod
|
|
|
18352
18389
|
default: infer TModuleDefault;
|
|
18353
18390
|
} ? TModuleDefault : TModule>;
|
|
18354
18391
|
//#endregion
|
|
18355
|
-
export { type ConfigNames, type ConfigOptions, type RuleOptions, type Rules, type SharedOptions, type TypedFlatConfigItem, extractRules, factory, importModule };
|
|
18392
|
+
export { type ConfigNames, type ConfigOptions, type RuleOptions, type Rules, type SharedOptions, type TypedFlatConfigItem, codeInMdGlob, extractRules, factory, ignoresGlob, importModule, jsGlob, json5Glob, jsonGlob, jsoncGlob, mdGlob, mdInMdGlob, packageJsonGlob, pnpmWorkspaceGlob, scriptsGlob, testsGlob, tsConfigGlob, tsGlob, vueGlob, yamlGlob };
|
package/dist/index.d.mts
CHANGED
|
@@ -18329,6 +18329,43 @@ interface ConfigOptions {
|
|
|
18329
18329
|
*/
|
|
18330
18330
|
declare function factory(options?: ConfigOptions): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
18331
18331
|
//#endregion
|
|
18332
|
+
//#region src/globs.d.ts
|
|
18333
|
+
/** Glob pattern for matching JavaScript files */
|
|
18334
|
+
declare const jsGlob = "**/*.{js,cjs,mjs}";
|
|
18335
|
+
/** Glob pattern for matching TypeScript files */
|
|
18336
|
+
declare const tsGlob = "**/*.{ts,cts,mts}";
|
|
18337
|
+
/** Glob pattern for matching Vue single-file components */
|
|
18338
|
+
declare const vueGlob = "**/*.vue";
|
|
18339
|
+
/** Glob pattern for matching Markdown files */
|
|
18340
|
+
declare const mdGlob = "**/*.md";
|
|
18341
|
+
/** Glob pattern for matching virtual files extracted from Markdown */
|
|
18342
|
+
declare const mdInMdGlob = "**/*.md/*.md";
|
|
18343
|
+
/** Glob pattern for matching code blocks embedded in Markdown files */
|
|
18344
|
+
declare const codeInMdGlob = "**/*.md/**/*.{js,cjs,mjs,ts,cts,mts,vue}";
|
|
18345
|
+
/** Glob pattern for matching scripts files */
|
|
18346
|
+
declare const scriptsGlob = "**/*.{js,cjs,mjs,ts,cts,mts}";
|
|
18347
|
+
/** Glob pattern for matching test files */
|
|
18348
|
+
declare const testsGlob: string[];
|
|
18349
|
+
/** Glob pattern for matching JSON files */
|
|
18350
|
+
declare const jsonGlob = "**/*.json";
|
|
18351
|
+
/** Glob pattern for matching JSON5 files */
|
|
18352
|
+
declare const json5Glob = "**/*.json5";
|
|
18353
|
+
/** Glob pattern for matching JSON with Comments files */
|
|
18354
|
+
declare const jsoncGlob = "**/*.jsonc";
|
|
18355
|
+
/** Glob patterns for matching TypeScript configuration files */
|
|
18356
|
+
declare const tsConfigGlob: string[];
|
|
18357
|
+
/** Glob pattern for matching YAML files */
|
|
18358
|
+
declare const yamlGlob = "**/*.{yml,yaml}";
|
|
18359
|
+
/** Glob pattern for matching pnpm-workspace.yaml file */
|
|
18360
|
+
declare const pnpmWorkspaceGlob = "pnpm-workspace.yaml";
|
|
18361
|
+
/** Glob pattern for matching package.json files */
|
|
18362
|
+
declare const packageJsonGlob = "**/package.json";
|
|
18363
|
+
/**
|
|
18364
|
+
* Common glob patterns for files and directories that should be ignored by ESLint.
|
|
18365
|
+
* Includes node_modules, build outputs, lock files, temporary files, and tool-specific caches.
|
|
18366
|
+
*/
|
|
18367
|
+
declare const ignoresGlob: string[];
|
|
18368
|
+
//#endregion
|
|
18332
18369
|
//#region src/utils.d.ts
|
|
18333
18370
|
/**
|
|
18334
18371
|
* Extracts and merges the rules from multiple ESLint configuration arrays.
|
|
@@ -18352,4 +18389,4 @@ declare function importModule<TModule>(module: Awaitable<TModule>): Promise<TMod
|
|
|
18352
18389
|
default: infer TModuleDefault;
|
|
18353
18390
|
} ? TModuleDefault : TModule>;
|
|
18354
18391
|
//#endregion
|
|
18355
|
-
export { type ConfigNames, type ConfigOptions, type RuleOptions, type Rules, type SharedOptions, type TypedFlatConfigItem, extractRules, factory, importModule };
|
|
18392
|
+
export { type ConfigNames, type ConfigOptions, type RuleOptions, type Rules, type SharedOptions, type TypedFlatConfigItem, codeInMdGlob, extractRules, factory, ignoresGlob, importModule, jsGlob, json5Glob, jsonGlob, jsoncGlob, mdGlob, mdInMdGlob, packageJsonGlob, pnpmWorkspaceGlob, scriptsGlob, testsGlob, tsConfigGlob, tsGlob, vueGlob, yamlGlob };
|
package/dist/index.mjs
CHANGED
|
@@ -16,6 +16,8 @@ const mdGlob = "**/*.md";
|
|
|
16
16
|
const mdInMdGlob = "**/*.md/*.md";
|
|
17
17
|
/** Glob pattern for matching code blocks embedded in Markdown files */
|
|
18
18
|
const codeInMdGlob = "**/*.md/**/*.{js,cjs,mjs,ts,cts,mts,vue}";
|
|
19
|
+
/** Glob pattern for matching scripts files */
|
|
20
|
+
const scriptsGlob = "**/*.{js,cjs,mjs,ts,cts,mts}";
|
|
19
21
|
/** Glob pattern for matching test files */
|
|
20
22
|
const testsGlob = ["**/*.{tests,specs,benchmark,bench}.{js,cjs,mjs,ts,cts,mts}", "**/__tests__/**/*.{js,cjs,mjs,ts,cts,mts}"];
|
|
21
23
|
/** Glob pattern for matching JSON files */
|
|
@@ -32,9 +34,11 @@ const yamlGlob = "**/*.{yml,yaml}";
|
|
|
32
34
|
const pnpmWorkspaceGlob = "pnpm-workspace.yaml";
|
|
33
35
|
/** Glob pattern for matching package.json files */
|
|
34
36
|
const packageJsonGlob = "**/package.json";
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Common glob patterns for files and directories that should be ignored by ESLint.
|
|
39
|
+
* Includes node_modules, build outputs, lock files, temporary files, and tool-specific caches.
|
|
40
|
+
*/
|
|
41
|
+
const ignoresGlob = [
|
|
38
42
|
"**/node_modules/**",
|
|
39
43
|
"**/dist/**",
|
|
40
44
|
"**/package-lock.json",
|
|
@@ -71,6 +75,9 @@ const defaultPatterns = [
|
|
|
71
75
|
"**/.agents",
|
|
72
76
|
"**/.*/skills"
|
|
73
77
|
];
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/configs/ignores.ts
|
|
80
|
+
const defaultPatterns = ignoresGlob;
|
|
74
81
|
/**
|
|
75
82
|
* Globs for ignoring files and directories from ESLint scanning.
|
|
76
83
|
* @param patterns Additional ignore patterns or a function to modify the defaults.
|
|
@@ -1127,7 +1134,7 @@ const unicornDefaults = { files: [
|
|
|
1127
1134
|
async function unicorn(options) {
|
|
1128
1135
|
const resolved = defu(options, unicornDefaults);
|
|
1129
1136
|
const unicornPlugin = await importModule(import("eslint-plugin-unicorn"));
|
|
1130
|
-
const baseRules = unicornPlugin.configs.
|
|
1137
|
+
const baseRules = unicornPlugin.configs.recommended?.rules || {};
|
|
1131
1138
|
return [{
|
|
1132
1139
|
name: "favorodera/unicorn/setup",
|
|
1133
1140
|
plugins: { unicorn: unicornPlugin }
|
|
@@ -1137,21 +1144,7 @@ async function unicorn(options) {
|
|
|
1137
1144
|
name: "favorodera/unicorn/rules",
|
|
1138
1145
|
rules: {
|
|
1139
1146
|
...baseRules,
|
|
1140
|
-
"unicorn/
|
|
1141
|
-
"unicorn/error-message": "error",
|
|
1142
|
-
"unicorn/escape-case": "error",
|
|
1143
|
-
"unicorn/new-for-builtins": "error",
|
|
1144
|
-
"unicorn/no-instanceof-builtins": "error",
|
|
1145
|
-
"unicorn/no-new-array": "error",
|
|
1146
|
-
"unicorn/no-new-buffer": "error",
|
|
1147
|
-
"unicorn/number-literal-case": "error",
|
|
1148
|
-
"unicorn/prefer-dom-node-text-content": "error",
|
|
1149
|
-
"unicorn/prefer-includes": "error",
|
|
1150
|
-
"unicorn/prefer-node-protocol": "error",
|
|
1151
|
-
"unicorn/prefer-number-properties": "error",
|
|
1152
|
-
"unicorn/prefer-string-starts-ends-with": "error",
|
|
1153
|
-
"unicorn/prefer-type-error": "error",
|
|
1154
|
-
"unicorn/throw-new-error": "error",
|
|
1147
|
+
"unicorn/filename-case": "off",
|
|
1155
1148
|
...resolved.overrides
|
|
1156
1149
|
}
|
|
1157
1150
|
}];
|
|
@@ -1181,7 +1174,7 @@ async function vue(options) {
|
|
|
1181
1174
|
importModule(import("vue-eslint-parser")),
|
|
1182
1175
|
importModule(import("typescript-eslint"))
|
|
1183
1176
|
]);
|
|
1184
|
-
const baseRules = extractRules(vuePlugin.configs["flat/
|
|
1177
|
+
const baseRules = extractRules(vuePlugin.configs["flat/recommended-error"]);
|
|
1185
1178
|
const processor = sfcBlocks === false ? vuePlugin.processors[".vue"] : mergeProcessors([vuePlugin.processors[".vue"], vueBlocksProcessor(sfcBlocks)]);
|
|
1186
1179
|
return [{
|
|
1187
1180
|
languageOptions: { globals: {
|
|
@@ -1216,22 +1209,78 @@ async function vue(options) {
|
|
|
1216
1209
|
processor,
|
|
1217
1210
|
rules: {
|
|
1218
1211
|
...baseRules,
|
|
1212
|
+
"vue/block-lang": ["error", { script: { lang: "ts" } }],
|
|
1219
1213
|
"vue/block-order": ["error", { order: [
|
|
1220
1214
|
"script",
|
|
1221
1215
|
"template",
|
|
1222
1216
|
"style"
|
|
1223
1217
|
] }],
|
|
1224
1218
|
"vue/block-tag-newline": ["error", {
|
|
1225
|
-
multiline: "
|
|
1226
|
-
singleline: "
|
|
1219
|
+
multiline: "always",
|
|
1220
|
+
singleline: "always"
|
|
1221
|
+
}],
|
|
1222
|
+
"vue/comment-directive": ["error", { reportUnusedDisableDirectives: true }],
|
|
1223
|
+
"vue/define-macros-order": ["error", {
|
|
1224
|
+
defineExposeLast: true,
|
|
1225
|
+
order: [
|
|
1226
|
+
"defineOptions",
|
|
1227
|
+
"definePage",
|
|
1228
|
+
"defineSlots",
|
|
1229
|
+
"defineEmits",
|
|
1230
|
+
"defineProps",
|
|
1231
|
+
"defineModel"
|
|
1232
|
+
]
|
|
1227
1233
|
}],
|
|
1228
|
-
"vue/
|
|
1229
|
-
"vue/
|
|
1234
|
+
"vue/define-props-declaration": ["error", "type-based"],
|
|
1235
|
+
"vue/define-props-destructuring": ["error", { destructure: "never" }],
|
|
1230
1236
|
"vue/multi-word-component-names": "off",
|
|
1231
|
-
"vue/
|
|
1232
|
-
|
|
1233
|
-
|
|
1237
|
+
"vue/next-tick-style": ["error", "promise"],
|
|
1238
|
+
"vue/no-import-compiler-macros": "error",
|
|
1239
|
+
"vue/no-negated-v-if-condition": "error",
|
|
1240
|
+
"vue/no-reserved-component-names": ["error", {
|
|
1241
|
+
disallowVue3BuiltInComponents: true,
|
|
1242
|
+
disallowVueBuiltInComponents: true,
|
|
1243
|
+
htmlElementCaseSensitive: false
|
|
1234
1244
|
}],
|
|
1245
|
+
"vue/no-root-v-if": "error",
|
|
1246
|
+
"vue/no-template-target-blank": "error",
|
|
1247
|
+
"vue/no-unused-emit-declarations": "error",
|
|
1248
|
+
"vue/no-unused-properties": "error",
|
|
1249
|
+
"vue/no-unused-refs": "error",
|
|
1250
|
+
"vue/no-use-v-else-with-v-for": "error",
|
|
1251
|
+
"vue/no-useless-mustaches": "error",
|
|
1252
|
+
"vue/no-useless-v-bind": "error",
|
|
1253
|
+
"vue/padding-line-between-blocks": "error",
|
|
1254
|
+
"vue/padding-line-between-tags": ["error", [
|
|
1255
|
+
{
|
|
1256
|
+
blankLine: "always",
|
|
1257
|
+
next: "*:multi-line",
|
|
1258
|
+
prev: "*:single-line"
|
|
1259
|
+
},
|
|
1260
|
+
{
|
|
1261
|
+
blankLine: "always",
|
|
1262
|
+
next: "*:single-line",
|
|
1263
|
+
prev: "*:multi-line"
|
|
1264
|
+
},
|
|
1265
|
+
{
|
|
1266
|
+
blankLine: "always",
|
|
1267
|
+
next: "*:multi-line",
|
|
1268
|
+
prev: "*:multi-line"
|
|
1269
|
+
},
|
|
1270
|
+
{
|
|
1271
|
+
blankLine: "never",
|
|
1272
|
+
next: "*:single-line",
|
|
1273
|
+
prev: "*:single-line"
|
|
1274
|
+
}
|
|
1275
|
+
]],
|
|
1276
|
+
"vue/prefer-prop-type-boolean-first": "error",
|
|
1277
|
+
"vue/prefer-separate-static-class": "error",
|
|
1278
|
+
"vue/prefer-single-event-payload": "error",
|
|
1279
|
+
"vue/prefer-use-template-ref": "error",
|
|
1280
|
+
"vue/require-explicit-slots": "error",
|
|
1281
|
+
"vue/require-macro-variable-name": "error",
|
|
1282
|
+
"vue/slot-name-casing": ["error", "kebab-case"],
|
|
1283
|
+
"vue/v-for-delimiter-style": ["error", "in"],
|
|
1235
1284
|
...resolved.overrides
|
|
1236
1285
|
}
|
|
1237
1286
|
}];
|
|
@@ -1248,7 +1297,7 @@ const yamlDefaults = { files: [yamlGlob] };
|
|
|
1248
1297
|
async function yaml(options) {
|
|
1249
1298
|
const resolved = defu(options, yamlDefaults);
|
|
1250
1299
|
const [yamlPlugin, yamlParser] = await Promise.all([importModule(import("eslint-plugin-yml")), importModule(import("yaml-eslint-parser"))]);
|
|
1251
|
-
const baseRules = extractRules(yamlPlugin.configs.
|
|
1300
|
+
const baseRules = extractRules(yamlPlugin.configs.standard);
|
|
1252
1301
|
return [
|
|
1253
1302
|
{
|
|
1254
1303
|
name: "favorodera/yaml/setup",
|
|
@@ -1260,28 +1309,11 @@ async function yaml(options) {
|
|
|
1260
1309
|
name: "favorodera/yaml/rules",
|
|
1261
1310
|
rules: {
|
|
1262
1311
|
...renamePluginsInRules(baseRules, { yml: "yaml" }),
|
|
1263
|
-
"style/spaced-comment": "off",
|
|
1264
|
-
"yaml/block-mapping": "error",
|
|
1265
|
-
"yaml/block-mapping-question-indicator-newline": "error",
|
|
1266
|
-
"yaml/block-sequence": "error",
|
|
1267
|
-
"yaml/block-sequence-hyphen-indicator-newline": "error",
|
|
1268
|
-
"yaml/flow-mapping-curly-newline": "error",
|
|
1269
|
-
"yaml/flow-mapping-curly-spacing": "error",
|
|
1270
|
-
"yaml/flow-sequence-bracket-newline": "error",
|
|
1271
|
-
"yaml/flow-sequence-bracket-spacing": "error",
|
|
1272
|
-
"yaml/indent": ["error", 2],
|
|
1273
|
-
"yaml/key-spacing": "error",
|
|
1274
|
-
"yaml/no-empty-key": "error",
|
|
1275
|
-
"yaml/no-empty-sequence-entry": "error",
|
|
1276
|
-
"yaml/no-irregular-whitespace": "error",
|
|
1277
|
-
"yaml/no-tab-indent": "error",
|
|
1278
|
-
"yaml/plain-scalar": "error",
|
|
1279
1312
|
"yaml/quotes": ["error", {
|
|
1280
1313
|
avoidEscape: true,
|
|
1281
1314
|
prefer: "single"
|
|
1282
1315
|
}],
|
|
1283
|
-
"yaml/
|
|
1284
|
-
"yaml/vue-custom-block/no-parsing-error": "error",
|
|
1316
|
+
"yaml/require-string-key": "error",
|
|
1285
1317
|
...resolved.overrides
|
|
1286
1318
|
}
|
|
1287
1319
|
},
|
|
@@ -1405,4 +1437,4 @@ function factory(options = {}) {
|
|
|
1405
1437
|
return composer;
|
|
1406
1438
|
}
|
|
1407
1439
|
//#endregion
|
|
1408
|
-
export { extractRules, factory, importModule };
|
|
1440
|
+
export { codeInMdGlob, extractRules, factory, ignoresGlob, importModule, jsGlob, json5Glob, jsonGlob, jsoncGlob, mdGlob, mdInMdGlob, packageJsonGlob, pnpmWorkspaceGlob, scriptsGlob, testsGlob, tsConfigGlob, tsGlob, vueGlob, yamlGlob };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@favorodera/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.7",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Opinionated, type-safe flat ESLint configuration factory for Vue, TypeScript, Tailwind, and more.",
|
|
7
7
|
"author": "Favour Emeka <favorodera@gmail.com>",
|