maz-ui 5.0.0 → 5.1.0-beta.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/assets/{MazDropzone.DJ8au25t.css → MazDropzone.BW2grpTi.css} +1 -1
- package/dist/chunks/{MazDrawer.DANxKYxJ.js → MazDrawer.CC8zomfx.js} +2 -2
- package/dist/chunks/{MazDropzone.POH3pmfi.js → MazDropzone.Dez5j0WP.js} +2 -2
- package/dist/components/MazDrawer.js +1 -1
- package/dist/components/MazDropzone.js +1 -1
- package/dist/components/MazDropzone.vue.d.ts +2 -2
- package/dist/components/MazInputPrice.vue.d.ts +1 -1
- package/dist/components/index.js +2 -2
- package/docs/README.md +207 -0
- package/docs/agents/agents-md.md +52 -0
- package/docs/agents/claude-rule.md +52 -0
- package/docs/components/maz-accordion.md +76 -0
- package/docs/components/maz-alert.md +241 -0
- package/docs/components/maz-animated-counter.md +87 -0
- package/docs/components/maz-animated-element.md +46 -0
- package/docs/components/maz-animated-text.md +53 -0
- package/docs/components/maz-avatar.md +193 -0
- package/docs/components/maz-backdrop.md +178 -0
- package/docs/components/maz-badge.md +167 -0
- package/docs/components/maz-bottom-sheet.md +257 -0
- package/docs/components/maz-btn-group.md +316 -0
- package/docs/components/maz-btn.md +423 -0
- package/docs/components/maz-card-spotlight.md +84 -0
- package/docs/components/maz-card.md +321 -0
- package/docs/components/maz-carousel.md +153 -0
- package/docs/components/maz-chart.md +206 -0
- package/docs/components/maz-checkbox.md +138 -0
- package/docs/components/maz-checklist.md +251 -0
- package/docs/components/maz-circular-progress-bar.md +109 -0
- package/docs/components/maz-code-highlight.md +155 -0
- package/docs/components/maz-container.md +241 -0
- package/docs/components/maz-date-picker.md +791 -0
- package/docs/components/maz-dialog-confirm.md +215 -0
- package/docs/components/maz-dialog.md +143 -0
- package/docs/components/maz-drawer.md +106 -0
- package/docs/components/maz-dropdown.md +419 -0
- package/docs/components/maz-dropzone.md +387 -0
- package/docs/components/maz-expand-animation.md +82 -0
- package/docs/components/maz-fullscreen-loader.md +58 -0
- package/docs/components/maz-gallery.md +79 -0
- package/docs/components/maz-icon.md +203 -0
- package/docs/components/maz-input-code.md +73 -0
- package/docs/components/maz-input-number.md +79 -0
- package/docs/components/maz-input-phone-number.md +536 -0
- package/docs/components/maz-input-price.md +68 -0
- package/docs/components/maz-input-tags.md +112 -0
- package/docs/components/maz-input.md +334 -0
- package/docs/components/maz-lazy-img.md +113 -0
- package/docs/components/maz-link.md +146 -0
- package/docs/components/maz-loading-bar.md +38 -0
- package/docs/components/maz-markdown-editor.md +320 -0
- package/docs/components/maz-pagination.md +82 -0
- package/docs/components/maz-popover.md +794 -0
- package/docs/components/maz-pull-to-refresh.md +222 -0
- package/docs/components/maz-radio-buttons.md +313 -0
- package/docs/components/maz-radio.md +119 -0
- package/docs/components/maz-read-more.md +209 -0
- package/docs/components/maz-reading-progress-bar.md +96 -0
- package/docs/components/maz-select-country.md +513 -0
- package/docs/components/maz-select.md +318 -0
- package/docs/components/maz-sidebar-content.md +25 -0
- package/docs/components/maz-sidebar-footer.md +25 -0
- package/docs/components/maz-sidebar-group.md +27 -0
- package/docs/components/maz-sidebar-header.md +25 -0
- package/docs/components/maz-sidebar-menu-button.md +41 -0
- package/docs/components/maz-sidebar-menu-item.md +25 -0
- package/docs/components/maz-sidebar-menu-sub.md +32 -0
- package/docs/components/maz-sidebar-menu.md +25 -0
- package/docs/components/maz-sidebar-separator.md +21 -0
- package/docs/components/maz-sidebar-trigger.md +25 -0
- package/docs/components/maz-sidebar.md +507 -0
- package/docs/components/maz-skeleton.md +226 -0
- package/docs/components/maz-slider.md +165 -0
- package/docs/components/maz-spinner.md +84 -0
- package/docs/components/maz-stepper.md +301 -0
- package/docs/components/maz-switch.md +86 -0
- package/docs/components/maz-table-cell.md +27 -0
- package/docs/components/maz-table-row.md +28 -0
- package/docs/components/maz-table-title.md +27 -0
- package/docs/components/maz-table-virtualizer.md +31 -0
- package/docs/components/maz-table.md +426 -0
- package/docs/components/maz-tabs-bar.md +43 -0
- package/docs/components/maz-tabs-content-item.md +27 -0
- package/docs/components/maz-tabs-content.md +27 -0
- package/docs/components/maz-tabs.md +308 -0
- package/docs/components/maz-textarea.md +255 -0
- package/docs/components/maz-ticker.md +427 -0
- package/docs/components/maz-timeline.md +304 -0
- package/docs/components/maz-ui-provider.md +26 -0
- package/docs/components/maz-window-mockup.md +182 -0
- package/docs/composables/use-aos.md +41 -0
- package/docs/composables/use-breakpoints.md +42 -0
- package/docs/composables/use-dialog.md +58 -0
- package/docs/composables/use-display-names.md +130 -0
- package/docs/composables/use-drag.md +185 -0
- package/docs/composables/use-form-validator.md +1123 -0
- package/docs/composables/use-idle-timeout.md +172 -0
- package/docs/composables/use-pull-to-refresh.md +86 -0
- package/docs/composables/use-reading-time.md +132 -0
- package/docs/composables/use-string-matching.md +41 -0
- package/docs/composables/use-swipe.md +171 -0
- package/docs/composables/use-timer.md +104 -0
- package/docs/composables/use-toast.md +50 -0
- package/docs/composables/use-user-visibility.md +127 -0
- package/docs/composables/use-wait.md +50 -0
- package/docs/composables/use-window-size.md +25 -0
- package/docs/directives/click-outside.md +182 -0
- package/docs/directives/fullscreen-img.md +83 -0
- package/docs/directives/lazy-img.md +182 -0
- package/docs/directives/tooltip.md +298 -0
- package/docs/directives/zoom-img.md +100 -0
- package/docs/ecosystem/eslint-config.md +289 -0
- package/docs/ecosystem/icons/icon-set.md +25 -0
- package/docs/ecosystem/icons/index.md +584 -0
- package/docs/ecosystem/mcp.md +165 -0
- package/docs/ecosystem/node/exec-promise.md +93 -0
- package/docs/ecosystem/node/index.md +53 -0
- package/docs/ecosystem/node/logger.md +152 -0
- package/docs/ecosystem/node/print-banner.md +101 -0
- package/docs/ecosystem/node/setup-agents.md +102 -0
- package/docs/ecosystem/nuxt.md +551 -0
- package/docs/ecosystem/stylelint-config.md +310 -0
- package/docs/ecosystem/themes.md +966 -0
- package/docs/ecosystem/translations.md +1173 -0
- package/docs/ecosystem/utils/camel-case.md +37 -0
- package/docs/ecosystem/utils/capitalize.md +37 -0
- package/docs/ecosystem/utils/check-availability.md +85 -0
- package/docs/ecosystem/utils/cookie.md +86 -0
- package/docs/ecosystem/utils/country-code-to-unicode-flag.md +128 -0
- package/docs/ecosystem/utils/currency.md +53 -0
- package/docs/ecosystem/utils/date.md +53 -0
- package/docs/ecosystem/utils/debounce-callback.md +44 -0
- package/docs/ecosystem/utils/debounce-id.md +75 -0
- package/docs/ecosystem/utils/debounce.md +71 -0
- package/docs/ecosystem/utils/fetch-locale-ip.md +39 -0
- package/docs/ecosystem/utils/format-json.md +39 -0
- package/docs/ecosystem/utils/format-phone-number.md +43 -0
- package/docs/ecosystem/utils/get-browser-locale.md +35 -0
- package/docs/ecosystem/utils/get-country-flag-url.md +67 -0
- package/docs/ecosystem/utils/get-error-message.md +45 -0
- package/docs/ecosystem/utils/idle-timeout.md +96 -0
- package/docs/ecosystem/utils/index.md +57 -0
- package/docs/ecosystem/utils/is-client.md +38 -0
- package/docs/ecosystem/utils/is-equal.md +44 -0
- package/docs/ecosystem/utils/is-ios.md +43 -0
- package/docs/ecosystem/utils/is-server.md +37 -0
- package/docs/ecosystem/utils/is-standalone-mode.md +49 -0
- package/docs/ecosystem/utils/kebab-case.md +42 -0
- package/docs/ecosystem/utils/normalize-string.md +83 -0
- package/docs/ecosystem/utils/number.md +51 -0
- package/docs/ecosystem/utils/pascal-case.md +41 -0
- package/docs/ecosystem/utils/prevent-ios-input-zoom.md +72 -0
- package/docs/ecosystem/utils/script-loader.md +85 -0
- package/docs/ecosystem/utils/sleep.md +65 -0
- package/docs/ecosystem/utils/snake-case.md +42 -0
- package/docs/ecosystem/utils/swipe-handler.md +97 -0
- package/docs/ecosystem/utils/textarea-autogrow.md +47 -0
- package/docs/ecosystem/utils/throttle-id.md +54 -0
- package/docs/ecosystem/utils/throttle.md +63 -0
- package/docs/ecosystem/utils/truthy-filter.md +37 -0
- package/docs/ecosystem/utils/types/deep-key-of.md +54 -0
- package/docs/ecosystem/utils/types/deep-partial.md +48 -0
- package/docs/ecosystem/utils/types/deep-required.md +45 -0
- package/docs/ecosystem/utils/types/flatten-object-keys.md +50 -0
- package/docs/ecosystem/utils/types/generic-instance-type.md +48 -0
- package/docs/ecosystem/utils/types/infer-maybe-ref.md +41 -0
- package/docs/ecosystem/utils/upper-first.md +38 -0
- package/docs/ecosystem/utils/user-visibility.md +75 -0
- package/docs/guide/ai-agents.md +237 -0
- package/docs/guide/browser-support.md +88 -0
- package/docs/guide/getting-started.md +191 -0
- package/docs/guide/global-defaults.md +103 -0
- package/docs/guide/maz-ui-provider.md +231 -0
- package/docs/guide/migration-v5.md +871 -0
- package/docs/guide/resolvers.md +650 -0
- package/docs/guide/tailwind.md +483 -0
- package/docs/guide/vue.md +286 -0
- package/docs/manifest.json +1 -0
- package/docs/plugins/aos.md +312 -0
- package/docs/plugins/dialog.md +269 -0
- package/docs/plugins/toast.md +221 -0
- package/docs/plugins/wait.md +78 -0
- package/docs/reference/icons.md +46 -0
- package/docs/reference/tailwind-tokens.md +191 -0
- package/docs/rules.md +57 -0
- package/package.json +31 -4
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "@maz-ui/eslint-config"
|
|
3
|
+
description: "ESLint flat-config preset for Vue/Nuxt/JS/TS projects, layered on @antfu/eslint-config with SonarJS, Tailwind v3+v4 and a11y add-ons."
|
|
4
|
+
package: "@maz-ui/eslint-config"
|
|
5
|
+
url: "https://maz-ui.com/ecosystem/eslint-config"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# @maz-ui/eslint-config
|
|
9
|
+
|
|
10
|
+
> ESLint flat-config preset for Vue/Nuxt/JS/TS projects, layered on @antfu/eslint-config with SonarJS, Tailwind v3+v4 and a11y add-ons.
|
|
11
|
+
|
|
12
|
+
- Package: `@maz-ui/eslint-config`
|
|
13
|
+
- Import: `import { defineConfig } from '@maz-ui/eslint-config'`
|
|
14
|
+
- Web: https://maz-ui.com/ecosystem/eslint-config
|
|
15
|
+
|
|
16
|
+
`@maz-ui/eslint-config` ships an opinionated ESLint **flat config** for the kind of stack maz-ui itself uses: TypeScript, Vue 3 / Nuxt 3, optional Tailwind CSS (v3 or v4), and tests. It is built on top of [`@antfu/eslint-config`](https://github.com/antfu/eslint-config) so you get a battle-tested baseline, then layered with quality rules from [SonarJS](https://github.com/SonarSource/eslint-plugin-sonarjs), Tailwind rules from [`eslint-plugin-better-tailwindcss`](https://github.com/schoero/eslint-plugin-better-tailwindcss), and accessibility rules from [`eslint-plugin-vuejs-accessibility`](https://github.com/vue-a11y/eslint-plugin-vuejs-accessibility).
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pnpm add -D @maz-ui/eslint-config eslint
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The Tailwind plugin and other peer/transitive dependencies are bundled as direct dependencies, so you don't need to install them yourself.
|
|
25
|
+
|
|
26
|
+
## Basic usage
|
|
27
|
+
|
|
28
|
+
Create `eslint.config.ts` (or `.mjs`/`.js`) at the root of your project:
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import { defineConfig } from '@maz-ui/eslint-config'
|
|
32
|
+
|
|
33
|
+
export default defineConfig()
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
That's it. Vue is auto-detected from your `package.json` (presence of `vue` or `nuxt`).
|
|
37
|
+
|
|
38
|
+
## Configuration
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
import { defineConfig } from '@maz-ui/eslint-config'
|
|
42
|
+
|
|
43
|
+
export default defineConfig({
|
|
44
|
+
// Toggle features explicitly (each one is also auto-detected from your deps).
|
|
45
|
+
typescript: true, // default
|
|
46
|
+
vue: true, // auto-detected
|
|
47
|
+
sonarjs: true, // default
|
|
48
|
+
tailwindcss: false, // see "Tailwind support" below
|
|
49
|
+
vueAccessibility: false, // optional
|
|
50
|
+
formatters: true, // CSS/HTML/JSON/YAML/Markdown formatting via dprint
|
|
51
|
+
|
|
52
|
+
// 'production' downgrades console.log to error, 'development' keeps it warning.
|
|
53
|
+
env: 'production',
|
|
54
|
+
|
|
55
|
+
// Extra ignore globs (merged with sensible defaults).
|
|
56
|
+
ignores: ['**/*.generated.ts'],
|
|
57
|
+
|
|
58
|
+
// Direct rule overrides applied on top of the resolved config.
|
|
59
|
+
rules: {
|
|
60
|
+
'no-console': 'error',
|
|
61
|
+
'vue/custom-event-name-casing': ['error', 'kebab-case'],
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
// Log verbosity - see "Logging" below.
|
|
65
|
+
logLevel: 'default',
|
|
66
|
+
})
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Logging
|
|
70
|
+
|
|
71
|
+
The preset prints a titled box summarizing what it resolved (typescript, vue, tailwindcss preset, sonarjs, …) when ESLint loads. Powered by [`@maz-ui/node`](https://www.npmjs.com/package/@maz-ui/node)'s consola-based logger.
|
|
72
|
+
|
|
73
|
+
| `logLevel` | What you see |
|
|
74
|
+
| --- | --- |
|
|
75
|
+
| `'silent'` | Nothing. |
|
|
76
|
+
| `'default'` *(TTY default)* | A titled box summarizing the resolved feature toggles, with `(auto-detected)` / `(default)` annotations next to each value. |
|
|
77
|
+
| `'debug'` | Adds one line per major block applied (Vue rules, SonarJS preset, vue-a11y, Tailwind plugin, test relaxations, user overrides). |
|
|
78
|
+
| `'verbose'` | Adds the final shape: total block count and ignore-glob count. |
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
defineConfig({ logLevel: 'debug' })
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The default is **`'default'` in interactive terminals (TTY) and `'silent'` otherwise** - CI, lint-staged, pipes, and JSON / SARIF formatters all write to stdout, where the box would corrupt machine-readable output. `logLevel` always wins when set explicitly.
|
|
85
|
+
|
|
86
|
+
You can also append raw flat-config items as additional arguments - they merge after the built-in configs:
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
export default defineConfig(
|
|
90
|
+
{ typescript: true },
|
|
91
|
+
{
|
|
92
|
+
files: ['**/*.legacy.ts'],
|
|
93
|
+
rules: { 'ts/no-explicit-any': 'off' },
|
|
94
|
+
},
|
|
95
|
+
)
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Tailwind support
|
|
99
|
+
|
|
100
|
+
Powered by [`eslint-plugin-better-tailwindcss`](https://github.com/schoero/eslint-plugin-better-tailwindcss) - supports both **Tailwind v3 and v4**, and ESLint 7→10.
|
|
101
|
+
|
|
102
|
+
The `tailwindcss` option accepts several shapes:
|
|
103
|
+
|
|
104
|
+
| Value | Behavior |
|
|
105
|
+
| --- | --- |
|
|
106
|
+
| `false` *(default)* | Disabled. |
|
|
107
|
+
| `true` | Same as `'recommended'` with default settings. |
|
|
108
|
+
| `'recommended'` | Stylistic + correctness rules. |
|
|
109
|
+
| `'stylistic'` | Formatting rules only - class order, line wrapping, no duplicate classes, etc. |
|
|
110
|
+
| `'correctness'` | Validation rules only - `no-unknown-classes`, `no-conflicting-classes`. |
|
|
111
|
+
| `MazTailwindcssOptions` | Pick a preset and pass plugin settings (Tailwind config path, prefix entry point, …). |
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
defineConfig({
|
|
115
|
+
tailwindcss: {
|
|
116
|
+
preset: 'recommended',
|
|
117
|
+
// Tailwind v4 - path to the CSS that does `@import "tailwindcss" prefix(maz)`.
|
|
118
|
+
entryPoint: 'src/main.css',
|
|
119
|
+
// Tailwind v3 instead - path to your config file.
|
|
120
|
+
// tailwindConfig: 'tailwind.config.ts',
|
|
121
|
+
// Tailwind v4: detect custom @layer components classes (cards, btns, …).
|
|
122
|
+
detectComponentClasses: true,
|
|
123
|
+
// Monorepo: directory used to resolve `tailwindcss` and the config file.
|
|
124
|
+
cwd: 'apps/web',
|
|
125
|
+
// Custom `maz/tailwind-no-arbitrary-px` rule - see "Custom rules" below.
|
|
126
|
+
noArbitraryPx: true,
|
|
127
|
+
},
|
|
128
|
+
})
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Warning: Plugin needs to know your Tailwind setup**
|
|
132
|
+
|
|
133
|
+
The plugin's correctness rules (`no-unknown-classes`, `no-conflicting-classes`) auto-resolve your Tailwind installation. Without `entryPoint` (v4) or `tailwindConfig` (v3), the plugin falls back to the **default Tailwind config** and won't know about your prefix, custom utilities, or theme tokens - which produces a flood of false positives in non-vanilla setups.
|
|
134
|
+
|
|
135
|
+
If you customize Tailwind in any meaningful way (prefix, extend theme, custom utilities), set `entryPoint` or `tailwindConfig` explicitly. If you hit false positives anyway, downgrade to `'stylistic'` (formatting only) or disable individual rules:
|
|
136
|
+
|
|
137
|
+
```ts
|
|
138
|
+
defineConfig({
|
|
139
|
+
tailwindcss: 'recommended',
|
|
140
|
+
rules: {
|
|
141
|
+
'better-tailwindcss/no-unknown-classes': 'off',
|
|
142
|
+
},
|
|
143
|
+
})
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
The plugin recognizes the most common class-name utilities out of the box (`clsx`, `cn`, `tw-merge`, `cva`, `tv`, …); see the [plugin docs](https://github.com/schoero/eslint-plugin-better-tailwindcss) for the full list and how to register your own.
|
|
147
|
+
|
|
148
|
+
## Custom rules
|
|
149
|
+
|
|
150
|
+
`@maz-ui/eslint-config` ships its own ESLint plugin under the **`maz/*`** namespace. Rules are grouped by category - `maz/tailwind-*` today, with room for `maz/js-*` and others as they get added.
|
|
151
|
+
|
|
152
|
+
### `maz/tailwind-no-arbitrary-px`
|
|
153
|
+
|
|
154
|
+
Forbids `px` units inside Tailwind arbitrary value classes (`w-[16px]`, `m-[-16px]`, `[gap:24px]`, …) and **autofixes** them to `rem` (or `em`) using your project's root font-size. Whitespace inside brackets (e.g. `[up to 100px]`) is left alone, so plain prose is never rewritten by accident.
|
|
155
|
+
|
|
156
|
+
**Note: Registered only when `tailwindcss` is enabled**
|
|
157
|
+
|
|
158
|
+
The `maz` plugin and the `maz/tailwind-*` rules are only added to the flat-config when `tailwindcss` is set to anything other than `false`. With `tailwindcss: false` *(default)*, neither the plugin nor the rule appear in the resolved config - keeping the preset zero-cost for non-Tailwind projects. To use the rule without opting into the full Tailwind preset, register `mazPlugin` manually (see Use the plugin directly).
|
|
159
|
+
|
|
160
|
+
When `tailwindcss` is on, the rule is enabled with defaults. You can tune it two ways:
|
|
161
|
+
|
|
162
|
+
**Standard ESLint override** *(idiomatic, max control)*
|
|
163
|
+
|
|
164
|
+
```ts
|
|
165
|
+
defineConfig({
|
|
166
|
+
tailwindcss: 'recommended',
|
|
167
|
+
rules: {
|
|
168
|
+
'maz/tailwind-no-arbitrary-px': ['error', { baseFontSize: 10, unit: 'em' }],
|
|
169
|
+
},
|
|
170
|
+
})
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
User `rules` overrides are applied in a *trailing* flat-config block, so they win over the defaults wired in by `tailwindcssConfigs`.
|
|
174
|
+
|
|
175
|
+
**Ergonomic shortcut** *(set defaults via `tailwindcss.noArbitraryPx`)*
|
|
176
|
+
|
|
177
|
+
```ts
|
|
178
|
+
defineConfig({
|
|
179
|
+
tailwindcss: {
|
|
180
|
+
preset: 'recommended',
|
|
181
|
+
noArbitraryPx: {
|
|
182
|
+
baseFontSize: 16, // default - divide px by this to get rem
|
|
183
|
+
unit: 'rem', // default - output unit ('rem' | 'em')
|
|
184
|
+
severity: 'error', // default - 'off' | 'warn' | 'error'
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
})
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
| `noArbitraryPx` value | Behavior |
|
|
191
|
+
| ---------------------------------- | --------------------------------------------------- |
|
|
192
|
+
| `true` *(default)* | Enabled with defaults (`baseFontSize: 16`, `rem`). |
|
|
193
|
+
| `false` | Disabled. |
|
|
194
|
+
| `{ baseFontSize, unit, severity }` | Override any subset of the defaults. |
|
|
195
|
+
|
|
196
|
+
If both are set, the standard `rules` override wins (it's the last block applied).
|
|
197
|
+
|
|
198
|
+
What the autofix does (with `baseFontSize: 16`):
|
|
199
|
+
|
|
200
|
+
| Before | After |
|
|
201
|
+
| ----------------------- | ------------------------ |
|
|
202
|
+
| `w-[16px]` | `w-[1rem]` |
|
|
203
|
+
| `m-[-16px]` | `m-[-1rem]` |
|
|
204
|
+
| `tracking-[.5px]` | `tracking-[0.03125rem]` |
|
|
205
|
+
| `p-[16px_8px]` | `p-[1rem_0.5rem]` |
|
|
206
|
+
| `[gap:24px]` | `[gap:1.5rem]` |
|
|
207
|
+
| `w-[calc(100%-16px)]` | `w-[calc(100%-1rem)]` |
|
|
208
|
+
| `md:hover:w-[16px]` | `md:hover:w-[1rem]` |
|
|
209
|
+
|
|
210
|
+
The rule fires on:
|
|
211
|
+
|
|
212
|
+
- JSX `className` strings and template literals
|
|
213
|
+
- Vue SFC static `class="…"` attributes (via `vue-eslint-parser`)
|
|
214
|
+
- Vue dynamic `:class` bindings, including string literals inside arrays / objects
|
|
215
|
+
- Function-call arguments and tagged template literals (`clsx`, `cn`, `cva`, `tw`, …)
|
|
216
|
+
|
|
217
|
+
### Use the plugin directly
|
|
218
|
+
|
|
219
|
+
If you don't want the full Tailwind preset (or just prefer wiring rules yourself), import `mazPlugin` and register it in your own flat-config block. This is also the way to use `maz/tailwind-*` rules **without** enabling `tailwindcss` in `defineConfig`:
|
|
220
|
+
|
|
221
|
+
```ts
|
|
222
|
+
import { mazPlugin } from '@maz-ui/eslint-config'
|
|
223
|
+
|
|
224
|
+
export default [{
|
|
225
|
+
files: ['**/*.{ts,tsx,vue}'],
|
|
226
|
+
plugins: { maz: mazPlugin },
|
|
227
|
+
rules: {
|
|
228
|
+
'maz/tailwind-no-arbitrary-px': ['error', { baseFontSize: 16, unit: 'rem' }],
|
|
229
|
+
},
|
|
230
|
+
}]
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## What it includes
|
|
234
|
+
|
|
235
|
+
- **Antfu base** - TypeScript-aware rules, Stylistic formatting, modern import order.
|
|
236
|
+
- **SonarJS** - code quality and complexity heuristics, with a relaxed set for `*.spec.ts` / `*.test.ts`.
|
|
237
|
+
- **Vue rules** (when Vue/Nuxt is detected) - block-tag order, naming conventions, template a11y.
|
|
238
|
+
- **Tailwind plugin** (opt-in) - class ordering, duplicate / deprecated / unknown / conflicting class detection - see Tailwind support.
|
|
239
|
+
- **`maz/*` custom rules** - namespaced ESLint plugin shipped with the preset; see Custom rules.
|
|
240
|
+
- **Markdown** - prose linting baseline.
|
|
241
|
+
- **vueAccessibility** (opt-in) - `eslint-plugin-vuejs-accessibility` rules with the AudioWorklet globals fix.
|
|
242
|
+
|
|
243
|
+
## Advanced
|
|
244
|
+
|
|
245
|
+
### Compose your own config
|
|
246
|
+
|
|
247
|
+
```ts
|
|
248
|
+
import {
|
|
249
|
+
baseRules,
|
|
250
|
+
mazPlugin,
|
|
251
|
+
sonarjsRules,
|
|
252
|
+
tailwindcssConfigs,
|
|
253
|
+
vueRules,
|
|
254
|
+
} from '@maz-ui/eslint-config'
|
|
255
|
+
|
|
256
|
+
export default [
|
|
257
|
+
{
|
|
258
|
+
plugins: { maz: mazPlugin },
|
|
259
|
+
rules: {
|
|
260
|
+
...baseRules(true), // production = true → no-console: 'error'
|
|
261
|
+
...sonarjsRules,
|
|
262
|
+
...vueRules,
|
|
263
|
+
'maz/tailwind-no-arbitrary-px': 'error',
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
// Drop in just the Tailwind block, with whatever preset and settings you want.
|
|
267
|
+
...tailwindcssConfigs('stylistic', {
|
|
268
|
+
entryPoint: 'src/main.css',
|
|
269
|
+
noArbitraryPx: { unit: 'em' },
|
|
270
|
+
}),
|
|
271
|
+
]
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### Auto-detection caveat (monorepos)
|
|
275
|
+
|
|
276
|
+
Auto-detection of Vue / Nuxt reads the `package.json` in `process.cwd()` only. In a monorepo where `vue` is hoisted to the root and missing from a sub-package's `package.json`, detection silently fails. Set `vue: true` explicitly in those cases:
|
|
277
|
+
|
|
278
|
+
```ts
|
|
279
|
+
defineConfig({ vue: true, tailwindcss: { preset: 'recommended', cwd: 'apps/web' } })
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
## Compatibility
|
|
283
|
+
|
|
284
|
+
| Tool | Required version |
|
|
285
|
+
| --- | --- |
|
|
286
|
+
| ESLint | `>=9.0.0 <11.0.0` |
|
|
287
|
+
| Node.js | `>=20.19.0` |
|
|
288
|
+
| TypeScript | `^5.0.0` |
|
|
289
|
+
| Tailwind CSS | `^3.3.0 \|\| ^4.0.0` *(when `tailwindcss` is on)* |
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "IconSet"
|
|
3
|
+
description: ""
|
|
4
|
+
package: "@maz-ui/icons"
|
|
5
|
+
url: "https://maz-ui.com/ecosystem/icons/icon-set"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# IconSet
|
|
9
|
+
|
|
10
|
+
>
|
|
11
|
+
|
|
12
|
+
- Package: `@maz-ui/icons`
|
|
13
|
+
- Web: https://maz-ui.com/ecosystem/icons/icon-set
|
|
14
|
+
|
|
15
|
+
The library includes **860+ icons**
|
|
16
|
+
|
|
17
|
+
## Icon Naming Convention
|
|
18
|
+
|
|
19
|
+
All icons follow a consistent naming pattern:
|
|
20
|
+
|
|
21
|
+
- Static Vue components: `Maz` + PascalCase (e.g., `MazUserCircle`)
|
|
22
|
+
- Lazy Vue components: `LazyMaz` + PascalCase (e.g., `LazyMazUserCircle`)
|
|
23
|
+
- SVG files: kebab-case (e.g., `user-circle.svg`)
|
|
24
|
+
|
|
25
|
+
## Find your icon
|