@favorodera/eslint-config 0.0.7 → 0.0.9

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 CHANGED
@@ -18345,7 +18345,7 @@ declare const codeInMdGlob = "**/*.md/**/*.{js,cjs,mjs,ts,cts,mts,vue}";
18345
18345
  /** Glob pattern for matching scripts files */
18346
18346
  declare const scriptsGlob = "**/*.{js,cjs,mjs,ts,cts,mts}";
18347
18347
  /** Glob pattern for matching test files */
18348
- declare const testsGlob: string[];
18348
+ declare const testGlob = "**/*.{test,spec,bench,benchmark}.{js,cjs,mjs,ts,cts,mts}";
18349
18349
  /** Glob pattern for matching JSON files */
18350
18350
  declare const jsonGlob = "**/*.json";
18351
18351
  /** Glob pattern for matching JSON5 files */
@@ -18389,4 +18389,4 @@ declare function importModule<TModule>(module: Awaitable<TModule>): Promise<TMod
18389
18389
  default: infer TModuleDefault;
18390
18390
  } ? TModuleDefault : TModule>;
18391
18391
  //#endregion
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 };
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, testGlob, tsConfigGlob, tsGlob, vueGlob, yamlGlob };
package/dist/index.mjs CHANGED
@@ -19,7 +19,7 @@ const codeInMdGlob = "**/*.md/**/*.{js,cjs,mjs,ts,cts,mts,vue}";
19
19
  /** Glob pattern for matching scripts files */
20
20
  const scriptsGlob = "**/*.{js,cjs,mjs,ts,cts,mts}";
21
21
  /** Glob pattern for matching test files */
22
- const testsGlob = ["**/*.{tests,specs,benchmark,bench}.{js,cjs,mjs,ts,cts,mts}", "**/__tests__/**/*.{js,cjs,mjs,ts,cts,mts}"];
22
+ const testGlob = "**/*.{test,spec,bench,benchmark}.{js,cjs,mjs,ts,cts,mts}";
23
23
  /** Glob pattern for matching JSON files */
24
24
  const jsonGlob = "**/*.json";
25
25
  /** Glob pattern for matching JSON5 files */
@@ -1034,14 +1034,26 @@ async function tailwind(options) {
1034
1034
  name: "favorodera/tailwind/rules",
1035
1035
  rules: {
1036
1036
  ...renamePluginsInRules(baseRules, { "better-tailwindcss": "tailwind" }),
1037
+ "tailwind/enforce-consistent-class-order": ["error", {
1038
+ componentClassOrder: "asc",
1039
+ componentClassPosition: "start",
1040
+ order: "strict",
1041
+ unknownClassOrder: "asc",
1042
+ unknownClassPosition: "start"
1043
+ }],
1044
+ "tailwind/enforce-consistent-important-position": "off",
1037
1045
  "tailwind/enforce-consistent-line-wrapping": ["error", { group: "emptyLine" }],
1046
+ "tailwind/enforce-consistent-variable-syntax": "off",
1047
+ "tailwind/enforce-consistent-variant-order": "error",
1048
+ "tailwind/enforce-logical-properties": "error",
1049
+ "tailwind/enforce-shorthand-classes": "off",
1038
1050
  ...resolved.overrides
1039
1051
  }
1040
1052
  }];
1041
1053
  }
1042
1054
  //#endregion
1043
1055
  //#region src/configs/test.ts
1044
- const testDefaults = { files: testsGlob };
1056
+ const testDefaults = { files: [testGlob] };
1045
1057
  /**
1046
1058
  * Constructs the flat config items for test linting, extending
1047
1059
  * the recommended Vitest rule sets.
@@ -1062,14 +1074,59 @@ async function test(options) {
1062
1074
  name: "favorodera/test/rules",
1063
1075
  rules: {
1064
1076
  ...renamePluginsInRules(baseRules, { vitest: "test" }),
1077
+ "test/consistent-each-for": ["error", {
1078
+ describe: "for",
1079
+ it: "for",
1080
+ suite: "for",
1081
+ test: "for"
1082
+ }],
1065
1083
  "test/consistent-test-it": ["error", {
1066
1084
  fn: "it",
1067
1085
  withinDescribe: "it"
1068
1086
  }],
1069
- "test/no-identical-title": "error",
1070
- "test/no-import-node-test": "error",
1087
+ "test/consistent-vitest-vi": "error",
1088
+ "test/hoisted-apis-on-top": "error",
1089
+ "test/max-expects": "error",
1090
+ "test/max-nested-describe": "error",
1091
+ "test/no-alias-methods": "error",
1092
+ "test/no-conditional-in-test": "error",
1093
+ "test/no-conditional-tests": "error",
1094
+ "test/no-duplicate-hooks": "error",
1095
+ "test/no-hooks": "error",
1096
+ "test/no-large-snapshots": "warn",
1097
+ "test/no-test-prefixes": "error",
1098
+ "test/no-test-return-statement": "error",
1099
+ "test/padding-around-all": "error",
1100
+ "test/prefer-called-times": "error",
1101
+ "test/prefer-called-with": "error",
1102
+ "test/prefer-comparison-matcher": "error",
1103
+ "test/prefer-each": "error",
1104
+ "test/prefer-equality-matcher": "error",
1105
+ "test/prefer-expect-resolves": "error",
1106
+ "test/prefer-expect-type-of": "error",
1071
1107
  "test/prefer-hooks-in-order": "error",
1108
+ "test/prefer-hooks-on-top": "error",
1109
+ "test/prefer-import-in-mock": "error",
1110
+ "test/prefer-importing-vitest-globals": "error",
1072
1111
  "test/prefer-lowercase-title": "error",
1112
+ "test/prefer-mock-promise-shorthand": "error",
1113
+ "test/prefer-mock-return-shorthand": "error",
1114
+ "test/prefer-snapshot-hint": "error",
1115
+ "test/prefer-spy-on": "error",
1116
+ "test/prefer-strict-boolean-matchers": "error",
1117
+ "test/prefer-strict-equal": "error",
1118
+ "test/prefer-to-be": "error",
1119
+ "test/prefer-to-be-object": "error",
1120
+ "test/prefer-to-contain": "error",
1121
+ "test/prefer-to-have-been-called-times": "error",
1122
+ "test/prefer-to-have-length": "error",
1123
+ "test/prefer-todo": "error",
1124
+ "test/prefer-vi-mocked": "error",
1125
+ "test/require-awaited-expect-poll": "error",
1126
+ "test/require-hook": "error",
1127
+ "test/require-to-throw-message": "error",
1128
+ "test/require-top-level-describe": "error",
1129
+ "test/warn-todo": "warn",
1073
1130
  ...resolved.overrides
1074
1131
  }
1075
1132
  },
@@ -1095,7 +1152,7 @@ const typescriptDefaults = { files: [tsGlob] };
1095
1152
  async function typescript(options) {
1096
1153
  const resolved = defu(options, typescriptDefaults);
1097
1154
  const tsEsLint = await importModule(import("typescript-eslint"));
1098
- const baseRules = extractRules(tsEsLint.configs.recommended, tsEsLint.configs.strict);
1155
+ const baseRules = extractRules(tsEsLint.configs.strict, tsEsLint.configs.stylistic);
1099
1156
  return [{
1100
1157
  name: "favorodera/typescript/setup",
1101
1158
  plugins: { ts: tsEsLint.plugin }
@@ -1112,8 +1169,12 @@ async function typescript(options) {
1112
1169
  default: "generic",
1113
1170
  readonly: "generic"
1114
1171
  }],
1115
- "ts/consistent-type-imports": ["error", { prefer: "type-imports" }],
1116
- "ts/no-empty-object-type": ["error", { allowInterfaces: "with-single-extends" }],
1172
+ "ts/consistent-type-imports": "error",
1173
+ "ts/default-param-last": "error",
1174
+ "ts/method-signature-style": "error",
1175
+ "ts/no-import-type-side-effects": "error",
1176
+ "ts/no-loop-func": "error",
1177
+ "ts/no-redeclare": "error",
1117
1178
  ...resolved.overrides
1118
1179
  }
1119
1180
  }];
@@ -1437,4 +1498,4 @@ function factory(options = {}) {
1437
1498
  return composer;
1438
1499
  }
1439
1500
  //#endregion
1440
- export { codeInMdGlob, extractRules, factory, ignoresGlob, importModule, jsGlob, json5Glob, jsonGlob, jsoncGlob, mdGlob, mdInMdGlob, packageJsonGlob, pnpmWorkspaceGlob, scriptsGlob, testsGlob, tsConfigGlob, tsGlob, vueGlob, yamlGlob };
1501
+ export { codeInMdGlob, extractRules, factory, ignoresGlob, importModule, jsGlob, json5Glob, jsonGlob, jsoncGlob, mdGlob, mdInMdGlob, packageJsonGlob, pnpmWorkspaceGlob, scriptsGlob, testGlob, 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.7",
4
+ "version": "0.0.9",
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>",
@@ -28,14 +28,9 @@
28
28
  "linter"
29
29
  ],
30
30
  "exports": {
31
- ".": {
32
- "import": "./dist/index.mjs",
33
- "require": "./dist/index.cjs"
34
- },
31
+ ".": "./dist/index.mjs",
35
32
  "./package.json": "./package.json"
36
33
  },
37
- "main": "./dist/index.cjs",
38
- "module": "./dist/index.mjs",
39
34
  "types": "./dist/index.d.cts",
40
35
  "files": [
41
36
  "dist"