@shayanthenerd/eslint-config 0.26.5 → 0.26.6

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.
@@ -9,28 +9,50 @@ import eslintPluginTailwind from "eslint-plugin-better-tailwindcss";
9
9
  import { getDefaultSelectors } from "eslint-plugin-better-tailwindcss/defaults";
10
10
  import { MatcherType, SelectorKind } from "eslint-plugin-better-tailwindcss/types";
11
11
  //#region src/configs/tailwind.ts
12
- const astroAttribute = {
12
+ const astroAttributes = {
13
13
  kind: SelectorKind.Attribute,
14
14
  name: "^class:list$",
15
15
  match: [{ type: MatcherType.String }, { type: MatcherType.ObjectKey }]
16
16
  };
17
- const vueAttributes = [{
17
+ const vueAttributes = {
18
+ kind: SelectorKind.Attribute,
19
+ name: "^(?:v-bind:)?(exactActiveClass|activeClass|inactiveClass|active-class|inactive-class)$",
20
+ match: [{ type: MatcherType.String }, { type: MatcherType.ObjectKey }]
21
+ };
22
+ const nuxtUiAttributes = {
18
23
  kind: SelectorKind.Attribute,
19
24
  name: "^v-bind:ui$",
20
25
  match: [{ type: MatcherType.ObjectValue }]
21
- }, {
22
- kind: SelectorKind.Attribute,
23
- name: "^(?:v-bind:)?(activeClass|inactiveClass|active-class|inactive-class)$",
24
- match: [{ type: MatcherType.String }, { type: MatcherType.ObjectKey }]
25
- }];
26
+ };
27
+ const nuxtUiAppConfigClassPathPattern = [
28
+ "ui\\.",
29
+ "(?!(?:colors|icons)(?:\\.|\\[|$))",
30
+ "(?!.*\\.defaultVariants(?:\\.|\\[|$))",
31
+ "(?!.*\\.compoundVariants\\[\\d+\\]\\.(?!(?:class|className)(?:\\.|\\[|$))[^.\\[]+(?:\\.|\\[|$))",
32
+ ".+"
33
+ ].join("");
34
+ const nuxtUiAppConfigUiFields = {
35
+ kind: SelectorKind.Callee,
36
+ name: "^defineAppConfig$",
37
+ match: [{
38
+ type: MatcherType.ObjectValue,
39
+ path: `^${nuxtUiAppConfigClassPathPattern}$`
40
+ }, {
41
+ type: MatcherType.AnonymousFunctionReturn,
42
+ match: [{ type: MatcherType.String }, { type: MatcherType.ObjectKey }]
43
+ }]
44
+ };
26
45
  function getTailwindConfig(options) {
27
- const { tsConfig, configs: { vue, html, astro, tailwind } } = options;
28
- const { cwd, config, entryPoint, overrides } = isEnabled(tailwind) ? tailwind : defaultOptions.configs.tailwind;
46
+ const { tsConfig, configs: { vue, nuxt, html, astro, tailwind } } = options;
47
+ const { cwd, config, overrides, entryPoint } = isEnabled(tailwind) ? tailwind : defaultOptions.configs.tailwind;
29
48
  const tsconfig = tsConfig ? path.resolve(tsConfig.rootDir, tsConfig.filename) : void 0;
49
+ const isNuxtUiEnabled = isEnabled(nuxt) && isEnabled(nuxt.ui);
30
50
  const selectors = [
31
51
  ...getDefaultSelectors(),
32
- ...isEnabled(vue) ? vueAttributes : [],
33
- isEnabled(astro) ? astroAttribute : void 0
52
+ isEnabled(astro) ? astroAttributes : void 0,
53
+ isEnabled(vue) ? vueAttributes : void 0,
54
+ isNuxtUiEnabled ? nuxtUiAttributes : void 0,
55
+ isNuxtUiEnabled ? nuxtUiAppConfigUiFields : void 0
34
56
  ].filter(isTruthy);
35
57
  return mergeConfigs({
36
58
  name: "shayanthenerd/tailwind",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shayanthenerd/eslint-config",
3
- "version": "0.26.5",
3
+ "version": "0.26.6",
4
4
  "description": "A modern, flexible ESLint configuration for enforcing best practices and maintaining a consistent coding style",
5
5
  "keywords": [
6
6
  "eslint",