@fabdeh/eslint-config 0.9.0-beta.4 → 0.9.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/dist/index.d.mts CHANGED
@@ -15847,7 +15847,7 @@ declare function stylistic(options?: StylisticOptions): Promise<TypedConfigArray
15847
15847
  * },
15848
15848
  * });
15849
15849
  */
15850
- declare function tailwindcss(options?: (FilesOptions & OverridesOptions & TailwindCssOptions)): Promise<TypedConfigArray>;
15850
+ declare function tailwindcss(options?: (FilesOptions & OverridesOptions & StylisticOptions & TailwindCssOptions)): Promise<TypedConfigArray>;
15851
15851
  //#endregion
15852
15852
  //#region src/configs/toml.d.ts
15853
15853
  /**
package/dist/index.mjs CHANGED
@@ -1740,7 +1740,7 @@ function sortTsConfig() {
1740
1740
  async function tailwindcss(options = {}) {
1741
1741
  await ensurePackages(["eslint-plugin-better-tailwindcss"]);
1742
1742
  const betterTailwindcssPlugin = await interopDefault(import("eslint-plugin-better-tailwindcss"));
1743
- const { files: filesGlob, overrides, enableAllRules, parsers, ...settings } = options;
1743
+ const { files: filesGlob, overrides, enableAllRules, parsers, stylistic = true, ...settings } = options;
1744
1744
  let files;
1745
1745
  let parserConfigs;
1746
1746
  if (parsers) {
@@ -1760,7 +1760,8 @@ async function tailwindcss(options = {}) {
1760
1760
  plugins: { "better-tailwindcss": betterTailwindcssPlugin },
1761
1761
  settings: { "better-tailwindcss": settings },
1762
1762
  rules: {
1763
- ...betterTailwindcssPlugin.configs.recommended.rules,
1763
+ ...betterTailwindcssPlugin.configs.correctness.rules,
1764
+ ...stylistic || enableAllRules ? betterTailwindcssPlugin.configs.stylistic.rules : {},
1764
1765
  ...enableAllRules ? {
1765
1766
  "better-tailwindcss/enforce-consistent-variable-syntax": "warn",
1766
1767
  "better-tailwindcss/no-conflicting-classes": "error",
@@ -2264,11 +2265,9 @@ async function defineProjectConfig(baseConfig, options = {}, ...userConfigs) {
2264
2265
  const { angular: enableAngular = isPackageExists("@angular/core"), jsdoc: enableJsdoc = options.type === "lib", ngrx: enableNgrx = NGRX_PACKAGES.some((p) => isPackageExists(p)), tailwindcss: enableTailwind = false, typescript: typescriptOptions, vitest: enableVitest = isPackageExists("vitest") } = options;
2265
2266
  if (enableNgrx && !enableAngular) throw new Error("NgRx rules can only be enabled if Angular rules are also enabled.");
2266
2267
  const configs = [];
2268
+ const stylisticOptions = workspaceOptions.stylistic === false ? false : typeof workspaceOptions.stylistic === "object" ? workspaceOptions.stylistic : {};
2267
2269
  if (options.ignores && options.ignores.length > 0) configs.push(ignores(options.ignores, "project"));
2268
- if (enableJsdoc) {
2269
- const stylisticOptions = workspaceOptions.stylistic === false ? false : typeof workspaceOptions.stylistic === "object" ? workspaceOptions.stylistic : {};
2270
- configs.push(jsdoc({ stylistic: stylisticOptions }));
2271
- }
2270
+ if (enableJsdoc) configs.push(jsdoc({ stylistic: stylisticOptions }));
2272
2271
  if (typescriptOptions) {
2273
2272
  if (!workspaceOptions.typescript) throw new Error("Project-specific TypeScript configuration requires a base configuration with TypeScript support.");
2274
2273
  configs.push(typescript({
@@ -2298,7 +2297,10 @@ async function defineProjectConfig(baseConfig, options = {}, ...userConfigs) {
2298
2297
  }
2299
2298
  if (enableTailwind) {
2300
2299
  const tailwindcssOptions = resolveSubOptions(options, "tailwindcss");
2301
- configs.push(tailwindcss(tailwindcssOptions));
2300
+ configs.push(tailwindcss({
2301
+ ...tailwindcssOptions,
2302
+ stylistic: stylisticOptions
2303
+ }));
2302
2304
  }
2303
2305
  return tseslint.config(...resolvedBaseConfig, ...await Promise.all(configs), ...await Promise.all(userConfigs));
2304
2306
  }
@@ -2367,7 +2369,10 @@ async function defineConfig(options = {}, ...userConfigs) {
2367
2369
  }
2368
2370
  if (enableTailwind) {
2369
2371
  const tailwindcssOptions = resolveSubOptions(options, "tailwindcss");
2370
- configs.push(tailwindcss(tailwindcssOptions));
2372
+ configs.push(tailwindcss({
2373
+ ...tailwindcssOptions,
2374
+ stylistic: stylisticOptions
2375
+ }));
2371
2376
  }
2372
2377
  if (options.jsonc ?? true) {
2373
2378
  const jsoncOptions = resolveSubOptions(options, "jsonc");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fabdeh/eslint-config",
3
3
  "type": "module",
4
- "version": "0.9.0-beta.4",
4
+ "version": "0.9.0",
5
5
  "description": "My personal eslint config preset",
6
6
  "author": {
7
7
  "name": "Fabien Dehopré",
@@ -139,7 +139,7 @@
139
139
  "tsx": "^4.20.6",
140
140
  "typescript": "^5.9.3",
141
141
  "vitest": "^4.0.14",
142
- "@fabdeh/eslint-config": "0.9.0-beta.4"
142
+ "@fabdeh/eslint-config": "0.9.0"
143
143
  },
144
144
  "resolutions": {
145
145
  "eslint": "catalog:peer"