@shayanthenerd/eslint-config 0.28.1 → 0.28.3

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 CHANGED
@@ -80,7 +80,7 @@ Legend:
80
80
  {
81
81
  "scripts": {
82
82
  "lint:inspect": "npx @eslint/config-inspector",
83
- "lint": "eslint --fix --cache --cache-location='node_modules/.cache/.eslintcache'"
83
+ "lint": "eslint --fix --max-warnings=0 --cache --cache-location='node_modules/.cache/.eslintcache'"
84
84
  }
85
85
  }
86
86
  ```
@@ -363,7 +363,7 @@ _package.json_:
363
363
  {
364
364
  "scripts": {
365
365
  "format": "prettier --write . --cache",
366
- "lint": "eslint --fix --cache --cache-location='node_modules/.cache/.eslintcache'"
366
+ "lint": "eslint --fix --max-warnings=0 --cache --cache-location='node_modules/.cache/.eslintcache'"
367
367
  }
368
368
  }
369
369
  ```
@@ -427,7 +427,7 @@ _.vscode/settings.json_:
427
427
  packageDir?: string,
428
428
  tsConfig?: false | {
429
429
  filename?: string,
430
- rootDir: string,
430
+ rootDir?: string,
431
431
  },
432
432
 
433
433
  project?: {
@@ -18,7 +18,7 @@ function getImportXConfig(options) {
18
18
  isEnabled(astro) ? globs.astro : ""
19
19
  ].filter(isTruthy),
20
20
  plugins: { "import-x": eslintPluginImportX },
21
- settings: isEnabled(typescript) ? eslintPluginImportX.flatConfigs.typescript.settings : void 0,
21
+ settings: isEnabled(typescript) ? eslintPluginImportX.flatConfigs.typescript.settings : {},
22
22
  rules: getImportXRules(options)
23
23
  }, overrides);
24
24
  }
@@ -10,7 +10,7 @@ import path from "node:path";
10
10
  function getNodeConfig(options) {
11
11
  const { tsConfig, configs: { vue, node, astro } } = options;
12
12
  const { overrides } = isEnabled(node) ? node : defaultOptions.configs.node;
13
- const tsconfig = tsConfig ? path.resolve(tsConfig.rootDir, tsConfig.filename) : void 0;
13
+ const tsconfigPath = tsConfig ? path.resolve(tsConfig.rootDir, tsConfig.filename) : void 0;
14
14
  return mergeConfigs({
15
15
  name: "shayanthenerd/node",
16
16
  files: [
@@ -20,7 +20,7 @@ function getNodeConfig(options) {
20
20
  isEnabled(astro) ? globs.astro : ""
21
21
  ].filter(isTruthy),
22
22
  plugins: { n: eslintPluginNode },
23
- settings: { n: { tsconfigPath: tsconfig } },
23
+ settings: { n: tsconfigPath ? { tsconfigPath } : void 0 },
24
24
  rules: getNodeRules(options)
25
25
  }, overrides);
26
26
  }
@@ -45,7 +45,7 @@ const nuxtUiAppConfigUiFields = {
45
45
  function getTailwindConfig(options) {
46
46
  const { tsConfig, configs: { vue, nuxt, html, astro, tailwind } } = options;
47
47
  const { cwd, config, overrides, entryPoint } = isEnabled(tailwind) ? tailwind : defaultOptions.configs.tailwind;
48
- const tsconfig = tsConfig ? path.resolve(tsConfig.rootDir, tsConfig.filename) : void 0;
48
+ const tsconfigPath = tsConfig ? path.resolve(tsConfig.rootDir, tsConfig.filename) : void 0;
49
49
  const isNuxtUiEnabled = isEnabled(nuxt) && isEnabled(nuxt.ui);
50
50
  const selectors = [
51
51
  ...getDefaultSelectors(),
@@ -66,10 +66,10 @@ function getTailwindConfig(options) {
66
66
  plugins: { "better-tailwindcss": eslintPluginTailwind },
67
67
  settings: { "better-tailwindcss": {
68
68
  cwd,
69
- tsconfig,
70
69
  selectors,
71
70
  entryPoint,
72
71
  tailwindConfig: config,
72
+ tsconfig: tsconfigPath,
73
73
  detectComponentClasses: true
74
74
  } },
75
75
  rules: getTailwindRules(options)
@@ -4,6 +4,7 @@ const defaultOptions = {
4
4
  env: "browser",
5
5
  gitignore: ".gitignore",
6
6
  packageDir: ".",
7
+ tsConfig: false,
7
8
  project: {
8
9
  basePath: ".",
9
10
  globals: {
@@ -1,4 +1,5 @@
1
1
  import { isEnabled } from "../../utils/isEnabled.mjs";
2
+ import { defaultOptions } from "./defaultOptions.mjs";
2
3
  import { isPackageDetected, logDetectedPackages } from "../isPackageDetected.mjs";
3
4
  //#region src/helpers/options/enableDetectedConfigs.ts
4
5
  function enableDetectedConfigs(options) {
@@ -58,11 +59,20 @@ function enableDetectedConfigs(options) {
58
59
  options.configs.test.cypress ??= autoDetectedPackages.cypress;
59
60
  options.configs.test.storybook ??= autoDetectedPackages.storybook;
60
61
  options.configs.test.playwright ??= autoDetectedPackages.playwright;
61
- options.tsConfig ??= options.configs.typescript ? {
62
- rootDir: ".",
63
- filename: "tsconfig.json"
64
- } : void 0;
65
- if (options.configs.vue && options.configs.typescript) {
62
+ const isTypeScriptEnabled = isEnabled(options.configs.typescript);
63
+ if (isTypeScriptEnabled) {
64
+ const defaultTsConfigRootDir = options.packageDir ?? defaultOptions.packageDir;
65
+ const defaultTsConfigFilename = "tsconfig.json";
66
+ if (options.tsConfig === void 0) options.tsConfig = {
67
+ rootDir: defaultTsConfigRootDir,
68
+ filename: defaultTsConfigFilename
69
+ };
70
+ else if (options.tsConfig !== false) {
71
+ options.tsConfig.rootDir ??= defaultTsConfigRootDir;
72
+ options.tsConfig.filename ??= defaultTsConfigFilename;
73
+ }
74
+ }
75
+ if (isTypeScriptEnabled && options.configs.vue) {
66
76
  options.configs.vue = options.configs.vue === true ? {} : options.configs.vue;
67
77
  options.configs.vue.blockLang = { script: "ts" };
68
78
  }
package/dist/index.mjs CHANGED
@@ -82,9 +82,9 @@ function defineConfig(...args) {
82
82
  return defineConfig$1([
83
83
  {
84
84
  name: "shayanthenerd/project",
85
- rules,
86
85
  linterOptions,
87
- ...Object.keys(settings).length > 0 && { settings }
86
+ settings,
87
+ rules
88
88
  },
89
89
  globalIgnores(ignorePatterns, "shayanthenerd/ignores"),
90
90
  getBaseConfig(mergedOptions),
@@ -114,7 +114,7 @@ function getPerfectionistRules(options) {
114
114
  "perfectionist/sort-named-exports": "warn",
115
115
  "perfectionist/sort-imports": ["warn", {
116
116
  environment: env === "bun" ? "bun" : "node",
117
- tsconfig: tsConfig || void 0,
117
+ tsconfig: tsConfig || { rootDir: "" },
118
118
  sortSideEffects: true,
119
119
  fallbackSort: {
120
120
  order: "asc",
@@ -45,11 +45,12 @@ function getTailwindRules(options) {
45
45
  }],
46
46
  "better-tailwindcss/enforce-consistent-variant-order": "warn",
47
47
  "better-tailwindcss/enforce-logical-properties": ["warn", { ignore: nonLogicalTailwindUtilityPatterns }],
48
- "better-tailwindcss/no-duplicate-classes": "error",
48
+ "better-tailwindcss/no-concatenated-classes": "error",
49
+ "better-tailwindcss/no-conflicting-classes": "error",
49
50
  "better-tailwindcss/no-deprecated-classes": "error",
50
- "better-tailwindcss/no-unnecessary-whitespace": "warn",
51
+ "better-tailwindcss/no-duplicate-classes": "error",
51
52
  "better-tailwindcss/no-unknown-classes": [isTailwindV4 ? "warn" : "off", { ignore: userIgnoredUnknownClasses }],
52
- "better-tailwindcss/no-conflicting-classes": "error"
53
+ "better-tailwindcss/no-unnecessary-whitespace": "warn"
53
54
  };
54
55
  }
55
56
  //#endregion
@@ -56,11 +56,12 @@ function getVueRules(options) {
56
56
  "vuejs-accessibility/tabindex-no-positive": "error"
57
57
  };
58
58
  const vueAndNuxtRules = {
59
+ "@typescript-eslint/no-useless-default-assignment": "off",
59
60
  "vue/jsx-uses-vars": "error",
60
61
  "vue/comment-directive": ["error", { reportUnusedDisableDirectives: true }],
61
62
  "vue/multi-word-component-names": "error",
62
63
  "vue/no-arrow-functions-in-watch": "warn",
63
- "vue/no-async-in-computed-properties": ["error", { ignoredObjectNames: ["z"] }],
64
+ "vue/no-async-in-computed-properties": ["error", { ignoredObjectNames: ["z", "zod"] }],
64
65
  "vue/no-child-content": "error",
65
66
  "vue/no-computed-properties-in-data": "error",
66
67
  "vue/no-deprecated-data-object-declaration": "error",
@@ -237,11 +238,7 @@ function getVueRules(options) {
237
238
  multiline: true,
238
239
  consistent: true
239
240
  }],
240
- "vue/object-curly-spacing": [
241
- "warn",
242
- "always",
243
- { emptyObjects: "never" }
244
- ],
241
+ "vue/object-curly-spacing": ["warn", "always"],
245
242
  "vue/object-property-newline": ["warn", { allowAllPropertiesOnSameLine: true }],
246
243
  "vue/object-shorthand": "warn",
247
244
  "vue/operator-linebreak": [
@@ -1873,6 +1873,7 @@ interface ESLintSchema {
1873
1873
  /**
1874
1874
  * Disallow specified modules when loaded by `import`
1875
1875
  * @see https://typescript-eslint.io/rules/no-restricted-imports
1876
+ * @deprecated
1876
1877
  */
1877
1878
  '@typescript-eslint/no-restricted-imports'?: Linter.RuleEntry<TypescriptEslintNoRestrictedImports>;
1878
1879
  /**
@@ -2626,6 +2627,11 @@ interface ESLintSchema {
2626
2627
  * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-shorthand-classes.md
2627
2628
  */
2628
2629
  'better-tailwindcss/enforce-shorthand-classes'?: Linter.RuleEntry<BetterTailwindcssEnforceShorthandClasses>;
2630
+ /**
2631
+ * Disallow concatenated classes in Tailwind CSS class strings.
2632
+ * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-concatenated-classes.md
2633
+ */
2634
+ 'better-tailwindcss/no-concatenated-classes'?: Linter.RuleEntry<BetterTailwindcssNoConcatenatedClasses>;
2629
2635
  /**
2630
2636
  * Disallow classes that produce conflicting styles.
2631
2637
  * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-conflicting-classes.md
@@ -13502,6 +13508,7 @@ type BetterTailwindcssEnforceConsistentLineWrapping = [] | [{
13502
13508
  printWidth?: number;
13503
13509
  strictness?: ("strict" | "loose");
13504
13510
  tabWidth?: number;
13511
+ vueConvertToBinding?: boolean;
13505
13512
  }];
13506
13513
  // ----- better-tailwindcss/enforce-consistent-variable-syntax -----
13507
13514
  type BetterTailwindcssEnforceConsistentVariableSyntax = [] | [{
@@ -14285,6 +14292,201 @@ type BetterTailwindcssEnforceShorthandClasses = [] | [{
14285
14292
  rootFontSize?: number;
14286
14293
  cwd?: string;
14287
14294
  }];
14295
+ // ----- better-tailwindcss/no-concatenated-classes -----
14296
+ type BetterTailwindcssNoConcatenatedClasses = [] | [{
14297
+ selectors?: ({
14298
+ kind: "attribute";
14299
+ match?: ({
14300
+ type: "strings";
14301
+ } | {
14302
+ path?: string;
14303
+ type: "objectKeys";
14304
+ } | {
14305
+ path?: string;
14306
+ type: "objectValues";
14307
+ } | {
14308
+ match: ({
14309
+ type: "strings";
14310
+ } | {
14311
+ path?: string;
14312
+ type: "objectKeys";
14313
+ } | {
14314
+ path?: string;
14315
+ type: "objectValues";
14316
+ })[];
14317
+ type: "anonymousFunctionReturn";
14318
+ })[];
14319
+ name: string;
14320
+ } | ({
14321
+ callTarget?: ("all" | "first" | "last" | number);
14322
+ kind: "callee";
14323
+ match?: ({
14324
+ type: "strings";
14325
+ } | {
14326
+ path?: string;
14327
+ type: "objectKeys";
14328
+ } | {
14329
+ path?: string;
14330
+ type: "objectValues";
14331
+ } | {
14332
+ match: ({
14333
+ type: "strings";
14334
+ } | {
14335
+ path?: string;
14336
+ type: "objectKeys";
14337
+ } | {
14338
+ path?: string;
14339
+ type: "objectValues";
14340
+ })[];
14341
+ type: "anonymousFunctionReturn";
14342
+ })[];
14343
+ name: string;
14344
+ path?: string;
14345
+ targetArgument?: ("all" | "first" | "last" | number);
14346
+ targetCall?: ("all" | "first" | "last" | number);
14347
+ } | {
14348
+ callTarget?: ("all" | "first" | "last" | number);
14349
+ kind: "callee";
14350
+ match?: ({
14351
+ type: "strings";
14352
+ } | {
14353
+ path?: string;
14354
+ type: "objectKeys";
14355
+ } | {
14356
+ path?: string;
14357
+ type: "objectValues";
14358
+ } | {
14359
+ match: ({
14360
+ type: "strings";
14361
+ } | {
14362
+ path?: string;
14363
+ type: "objectKeys";
14364
+ } | {
14365
+ path?: string;
14366
+ type: "objectValues";
14367
+ })[];
14368
+ type: "anonymousFunctionReturn";
14369
+ })[];
14370
+ name?: string;
14371
+ path: string;
14372
+ targetArgument?: ("all" | "first" | "last" | number);
14373
+ targetCall?: ("all" | "first" | "last" | number);
14374
+ }) | ({
14375
+ kind: "tag";
14376
+ match?: ({
14377
+ type: "strings";
14378
+ } | {
14379
+ path?: string;
14380
+ type: "objectKeys";
14381
+ } | {
14382
+ path?: string;
14383
+ type: "objectValues";
14384
+ } | {
14385
+ match: ({
14386
+ type: "strings";
14387
+ } | {
14388
+ path?: string;
14389
+ type: "objectKeys";
14390
+ } | {
14391
+ path?: string;
14392
+ type: "objectValues";
14393
+ })[];
14394
+ type: "anonymousFunctionReturn";
14395
+ })[];
14396
+ name: string;
14397
+ path?: string;
14398
+ } | {
14399
+ kind: "tag";
14400
+ match?: ({
14401
+ type: "strings";
14402
+ } | {
14403
+ path?: string;
14404
+ type: "objectKeys";
14405
+ } | {
14406
+ path?: string;
14407
+ type: "objectValues";
14408
+ } | {
14409
+ match: ({
14410
+ type: "strings";
14411
+ } | {
14412
+ path?: string;
14413
+ type: "objectKeys";
14414
+ } | {
14415
+ path?: string;
14416
+ type: "objectValues";
14417
+ })[];
14418
+ type: "anonymousFunctionReturn";
14419
+ })[];
14420
+ name?: string;
14421
+ path: string;
14422
+ }) | {
14423
+ kind: "variable";
14424
+ match?: ({
14425
+ type: "strings";
14426
+ } | {
14427
+ path?: string;
14428
+ type: "objectKeys";
14429
+ } | {
14430
+ path?: string;
14431
+ type: "objectValues";
14432
+ } | {
14433
+ match: ({
14434
+ type: "strings";
14435
+ } | {
14436
+ path?: string;
14437
+ type: "objectKeys";
14438
+ } | {
14439
+ path?: string;
14440
+ type: "objectValues";
14441
+ })[];
14442
+ type: "anonymousFunctionReturn";
14443
+ })[];
14444
+ name: string;
14445
+ })[];
14446
+ callees?: ([string, ({
14447
+ match: "strings";
14448
+ } | {
14449
+ match: "objectKeys";
14450
+ pathPattern?: string;
14451
+ } | {
14452
+ match: "objectValues";
14453
+ pathPattern?: string;
14454
+ })[]] | string)[];
14455
+ attributes?: (string | [string, ({
14456
+ match: "strings";
14457
+ } | {
14458
+ match: "objectKeys";
14459
+ pathPattern?: string;
14460
+ } | {
14461
+ match: "objectValues";
14462
+ pathPattern?: string;
14463
+ })[]])[];
14464
+ variables?: ([string, ({
14465
+ match: "strings";
14466
+ } | {
14467
+ match: "objectKeys";
14468
+ pathPattern?: string;
14469
+ } | {
14470
+ match: "objectValues";
14471
+ pathPattern?: string;
14472
+ })[]] | string)[];
14473
+ tags?: ([string, ({
14474
+ match: "strings";
14475
+ } | {
14476
+ match: "objectKeys";
14477
+ pathPattern?: string;
14478
+ } | {
14479
+ match: "objectValues";
14480
+ pathPattern?: string;
14481
+ })[]] | string)[];
14482
+ entryPoint?: string;
14483
+ messageStyle?: ("visual" | "compact" | "raw");
14484
+ tailwindConfig?: string;
14485
+ tsconfig?: string;
14486
+ detectComponentClasses?: boolean;
14487
+ rootFontSize?: number;
14488
+ cwd?: string;
14489
+ }];
14288
14490
  // ----- better-tailwindcss/no-conflicting-classes -----
14289
14491
  type BetterTailwindcssNoConflictingClasses = [] | [{
14290
14492
  selectors?: ({
@@ -22970,6 +23172,7 @@ type VueSortKeys = [] | [("asc" | "desc")] | [("asc" | "desc"), {
22970
23172
  ignoreGrandchildrenOf?: unknown[];
22971
23173
  minKeys?: number;
22972
23174
  natural?: boolean;
23175
+ allowLineSeparatedGroups?: boolean;
22973
23176
  }];
22974
23177
  // ----- vue/space-in-parens -----
22975
23178
  type VueSpaceInParens = [] | [("always" | "never")] | [("always" | "never"), {
@@ -81,25 +81,25 @@ interface Options {
81
81
  * - [better-tailwindcss: `tsconfig` option](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#tsconfig)
82
82
  * - [perfectionist/sort-imports: `tsconfig` option](https://perfectionist.dev/rules/sort-imports#tsconfig)
83
83
  *
84
- * @default undefined // `{ rootDir: '.', filename: 'tsconfig.json' }` if TypeScript integration is enabled
84
+ * @default false // `{ rootDir: options.packageDir ?? '.', filename: 'tsconfig.json' }` if TypeScript integration is enabled
85
85
  */
86
86
  tsConfig?: false | {
87
87
  /**
88
- * The name of the root TypeScript config file.
88
+ * The directory of the root TypeScript config file.
89
89
  *
90
90
  * It will fall back to the default value if set to an empty string (`''`).
91
91
  *
92
- * @default 'tsconfig.json'
92
+ * @default options.packageDir ?? '.'
93
93
  */
94
- filename?: string;
94
+ rootDir?: string;
95
95
  /**
96
- * The directory of the root TypeScript config file.
96
+ * The name of the root TypeScript config file.
97
97
  *
98
98
  * It will fall back to the default value if set to an empty string (`''`).
99
99
  *
100
- * @default '.'
100
+ * @default 'tsconfig.json'
101
101
  */
102
- rootDir: string;
102
+ filename?: string;
103
103
  };
104
104
  /*** Project ***/
105
105
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shayanthenerd/eslint-config",
3
- "version": "0.28.1",
3
+ "version": "0.28.3",
4
4
  "description": "A modern, flexible ESLint configuration for enforcing best practices and maintaining a consistent coding style",
5
5
  "keywords": [
6
6
  "eslint",
@@ -49,7 +49,7 @@
49
49
  "{**/*.ts,package.json}": "pnpm lint"
50
50
  },
51
51
  "dependencies": {
52
- "@eslint-react/eslint-plugin": "5.17.1",
52
+ "@eslint-react/eslint-plugin": "5.17.3",
53
53
  "@eslint/css": "1.4.0",
54
54
  "@eslint/markdown": "8.0.3",
55
55
  "@html-eslint/eslint-plugin": "0.64.0",
@@ -63,7 +63,7 @@
63
63
  "eslint-import-resolver-typescript": "4.4.5",
64
64
  "eslint-plugin-astro": "3.0.1",
65
65
  "eslint-plugin-baseline-js": "0.7.0",
66
- "eslint-plugin-better-tailwindcss": "4.6.1",
66
+ "eslint-plugin-better-tailwindcss": "4.7.0",
67
67
  "eslint-plugin-cypress": "6.4.3",
68
68
  "eslint-plugin-import-x": "4.17.1",
69
69
  "eslint-plugin-jsx-a11y": "6.10.2",
@@ -72,16 +72,16 @@
72
72
  "eslint-plugin-perfectionist": "5.10.0",
73
73
  "eslint-plugin-playwright": "2.10.5",
74
74
  "eslint-plugin-promise": "7.3.0",
75
- "eslint-plugin-storybook": "10.5.2",
75
+ "eslint-plugin-storybook": "10.5.3",
76
76
  "eslint-plugin-unicorn": "72.0.0",
77
- "eslint-plugin-vue": "10.9.2",
77
+ "eslint-plugin-vue": "10.10.0",
78
78
  "eslint-plugin-vuejs-accessibility": "2.5.0",
79
79
  "eslint-plugin-zod": "4.8.0",
80
80
  "eslint-plugin-zod-mini": "1.5.0",
81
81
  "globals": "17.7.0",
82
82
  "local-pkg": "1.2.1",
83
83
  "tailwind-csstree": "0.3.3",
84
- "typescript-eslint": "8.64.0"
84
+ "typescript-eslint": "8.65.0"
85
85
  },
86
86
  "devDependencies": {
87
87
  "@arethetypeswrong/cli": "0.18.5",
@@ -92,12 +92,12 @@
92
92
  "eslint": "10.7.0",
93
93
  "eslint-typegen": "2.3.1",
94
94
  "nano-staged": "1.0.2",
95
- "prettier": "3.9.5",
95
+ "prettier": "3.9.6",
96
96
  "publint": "0.3.21",
97
97
  "serve": "14.2.6",
98
98
  "simple-git-hooks": "2.13.1",
99
99
  "ts-morph": "28.0.0",
100
- "tsdown": "0.22.9",
100
+ "tsdown": "0.22.12",
101
101
  "typescript": "6.0.3",
102
102
  "unplugin-unused": "0.5.7"
103
103
  },
@@ -110,7 +110,7 @@
110
110
  "devEngines": {
111
111
  "packageManager": {
112
112
  "name": "pnpm",
113
- "version": "11.13.1",
113
+ "version": "11.15.1",
114
114
  "onFail": "warn"
115
115
  },
116
116
  "runtime": {