@allxsmith/eslint-plugin-bestax 1.1.0 → 1.1.1

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
@@ -187,7 +187,7 @@ raw Bulma markup from coming back.
187
187
 
188
188
  ```jsx
189
189
  <button className="button is-primary" /> // ✗ bestax renders .button as Button
190
- <div className="card" /> // ✗ bestax has Card, converted by hand
190
+ <div className="dropdown" /> // ✗ bestax has Dropdown, converted by hand
191
191
  <div className="has-text-centered mt-4" /> // ✓ helper classes are left alone
192
192
  <p className="help" /> // ✓ bestax renders .help inside its form controls
193
193
  ```
@@ -1 +1 @@
1
- {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/generated/metadata.ts"],"names":[],"mappings":"AAIA,uEAAuE;AACvE,MAAM,WAAW,WAAW;IAC1B,4EAA4E;IAC5E,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CACrC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAiItD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,yBAAyB,EAAE,SAAS,MAAM,EAUtD,CAAC;AAEF,mDAAmD;AACnD,MAAM,WAAW,mBAAmB;IAClC,6DAA6D;IAC7D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,MAAM,EAAE,mBAAmB,CA4DzE,CAAC"}
1
+ {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/generated/metadata.ts"],"names":[],"mappings":"AAIA,uEAAuE;AACvE,MAAM,WAAW,WAAW;IAC1B,4EAA4E;IAC5E,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CACrC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAiItD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,yBAAyB,EAAE,SAAS,MAAM,EAUtD,CAAC;AAEF,mDAAmD;AACnD,MAAM,WAAW,mBAAmB;IAClC,6DAA6D;IAC7D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,MAAM,EAAE,mBAAmB,CA+EzE,CAAC"}
@@ -164,7 +164,6 @@ export const TEXT_ALIAS_COLOR_ELEMENTS = [
164
164
  */
165
165
  export const BULMA_COMPONENT_CLASSES = new Map([
166
166
  ['breadcrumb', { component: 'Breadcrumb', converts: false }],
167
- ['card', { component: 'Card', converts: false }],
168
167
  ['cell', { component: 'Cell', converts: false }],
169
168
  ['grid', { component: 'Grid', converts: false }],
170
169
  ['fixed-grid', { component: 'Grid', converts: false }],
@@ -172,9 +171,6 @@ export const BULMA_COMPONENT_CLASSES = new Map([
172
171
  ['checkboxes', { component: 'Checkboxes', converts: false }],
173
172
  ['radio', { component: 'Radio', converts: false }],
174
173
  ['radios', { component: 'Radios', converts: false }],
175
- ['field', { component: 'Field', converts: false }],
176
- ['input', { component: 'Input', converts: false }],
177
- ['textarea', { component: 'TextArea', converts: false }],
178
174
  ['select', { component: 'Select', converts: false }],
179
175
  ['file', { component: 'File', converts: false }],
180
176
  ['dropdown', { component: 'Dropdown', converts: false }],
@@ -184,7 +180,8 @@ export const BULMA_COMPONENT_CLASSES = new Map([
184
180
  ['menu', { component: 'Menu', converts: false }],
185
181
  ['message', { component: 'Message', converts: false }],
186
182
  ['modal', { component: 'Modal', converts: false }],
187
- ['navbar', { component: 'Navbar', converts: false }],
183
+ ['navbar-burger', { component: 'Navbar.Burger', converts: false }],
184
+ ['navbar-link', { component: 'Navbar.Link', converts: false }],
188
185
  ['pagination', { component: 'Pagination', converts: false }],
189
186
  ['panel', { component: 'Panel', converts: false }],
190
187
  ['tabs', { component: 'Tabs', converts: false }],
@@ -208,6 +205,28 @@ export const BULMA_COMPONENT_CLASSES = new Map([
208
205
  ['media-left', { component: 'Media.Left', converts: true }],
209
206
  ['media-content', { component: 'Media.Content', converts: true }],
210
207
  ['media-right', { component: 'Media.Right', converts: true }],
208
+ ['card', { component: 'Card', converts: true }],
209
+ ['card-header', { component: 'Card.Header', converts: true }],
210
+ ['card-header-title', { component: 'Card.Header.Title', converts: true }],
211
+ ['card-header-icon', { component: 'Card.Header.Icon', converts: true }],
212
+ ['card-image', { component: 'Card.Image', converts: true }],
213
+ ['card-content', { component: 'Card.Content', converts: true }],
214
+ ['card-footer', { component: 'Card.Footer', converts: true }],
215
+ ['card-footer-item', { component: 'Card.FooterItem', converts: true }],
216
+ ['navbar', { component: 'Navbar', converts: true }],
217
+ ['navbar-brand', { component: 'Navbar.Brand', converts: true }],
218
+ ['navbar-menu', { component: 'Navbar.Menu', converts: true }],
219
+ ['navbar-start', { component: 'Navbar.Start', converts: true }],
220
+ ['navbar-end', { component: 'Navbar.End', converts: true }],
221
+ ['navbar-item', { component: 'Navbar.Item', converts: true }],
222
+ ['navbar-dropdown', { component: 'Navbar.DropdownMenu', converts: true }],
223
+ ['navbar-divider', { component: 'Navbar.Divider', converts: true }],
224
+ ['field', { component: 'Field', converts: true }],
225
+ ['field-label', { component: 'Field.Label', converts: true }],
226
+ ['field-body', { component: 'Field.Body', converts: true }],
227
+ ['control', { component: 'Control', converts: true }],
228
+ ['input', { component: 'InputBase', converts: true }],
229
+ ['textarea', { component: 'TextAreaBase', converts: true }],
211
230
  ['buttons', { component: 'Buttons', converts: true }],
212
231
  ['tags', { component: 'Tags', converts: true }],
213
232
  ['button', { component: 'Button', converts: true }],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allxsmith/eslint-plugin-bestax",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "ESLint rules for @allxsmith/bestax-bulma — catches helper-prop values the library silently drops, deprecated props, and the color-as-surface mistake",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -72,5 +72,5 @@
72
72
  "clean": "rimraf dist",
73
73
  "release": "npx semantic-release"
74
74
  },
75
- "readme": "# @allxsmith/eslint-plugin-bestax\n\n[![npm version](https://img.shields.io/npm/v/@allxsmith/eslint-plugin-bestax.svg)](https://www.npmjs.com/package/@allxsmith/eslint-plugin-bestax)\n[![npm downloads](https://img.shields.io/npm/dm/@allxsmith/eslint-plugin-bestax.svg)](https://www.npmjs.com/package/@allxsmith/eslint-plugin-bestax)\n[![npm provenance](https://img.shields.io/badge/npm-provenance-3fb950.svg)](https://www.npmjs.com/package/@allxsmith/eslint-plugin-bestax#provenance)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Socket Badge](https://badge.socket.dev/npm/package/@allxsmith/eslint-plugin-bestax/latest)](https://socket.dev/npm/package/@allxsmith/eslint-plugin-bestax/overview)\n[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/allxsmith/bestax/badge)](https://scorecard.dev/viewer/?uri=github.com/allxsmith/bestax)\n[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/14361/badge)](https://www.bestpractices.dev/projects/14361)\n[![Security policy](https://img.shields.io/badge/security-policy-blue.svg)](https://github.com/allxsmith/bestax/blob/main/SECURITY.md)\n\nESLint rules for [`@allxsmith/bestax-bulma`](https://www.npmjs.com/package/@allxsmith/bestax-bulma).\n\nEvery rule here reports code that does not do what it looks like it does. The\nlibrary's helper props validate by membership and emit nothing for a value they\ndo not recognise, with no throw and no warning, so `textColor=\"blue\"` renders\nnothing and says nothing.\n\n**Scope, up front:** the helper props are typed as literal unions, so if you\nwrite bestax in `.tsx` and run `tsc`, it already catches a wrong literal. This\nplugin is for the places that check does not reach: JavaScript and JSX\nprojects, and lint stages that run before or instead of typechecking. The deprecation and flex rules are additive everywhere, since\nno type error marks a deprecated prop or a flex prop that emits nothing.\n\n## Requirements\n\nESLint 10, using [flat config](https://eslint.org/docs/latest/use/configure/configuration-files).\nThe plugin is ESM-only, which does not rule out a CommonJS config. An\n`eslint.config.cjs` can `require()` it on a Node that supports `require(esm)`,\nand `configs.recommended` reads straight off the result with no interop hop,\nbecause `rules` and `configs` are named exports alongside the default. On a\nNode without that support it throws `ERR_REQUIRE_ESM`, and an `import` from\n`eslint.config.mjs` works either way.\n\n## Setup\n\n```bash\nnpm install --save-dev @allxsmith/eslint-plugin-bestax\n```\n\n### TypeScript\n\nThe preset sets no `parser`, so a TypeScript parser has to come from a config\nobject of your own. Put it first; the preset after:\n\n```js\n// eslint.config.js\nimport bestax from '@allxsmith/eslint-plugin-bestax';\nimport parser from '@typescript-eslint/parser';\n\nexport default [\n { files: ['**/*.{ts,tsx}'], languageOptions: { parser } },\n bestax.configs.recommended,\n];\n```\n\nAny TypeScript setup that sets a parser works the same way, `typescript-eslint`\nincluded, precisely because the preset does not set one of its own.\n\nThe parser is a requirement, not a nicety. The preset matches `.tsx` because\nthat is where a TypeScript project's JSX lives, and with no parser supplied it\nhands that file to the default one, which stops at the first type annotation:\n`Parsing error: The keyword 'interface' is reserved`.\n\n### JavaScript and JSX\n\nIf the project contains no `.tsx` at all, the preset alone is enough:\n\n```js\n// eslint.config.js\nimport bestax from '@allxsmith/eslint-plugin-bestax';\n\nexport default [bestax.configs.recommended];\n```\n\nAdd one `.tsx` file later and you need the parser block above. The failure is\nloud rather than silent, which is the intended trade: leaving `.tsx` out of the\npreset's own `files` would mean a TypeScript project got no rules on any `.tsx`\nfile and no indication why.\n\n### Picking rules yourself\n\n`files` is load-bearing: a flat config object without it inherits ESLint's\ndefault `**/*.{js,mjs,cjs}` set, so leaving it out silently lints none of your\nJSX.\n\n```js\nimport bestax from '@allxsmith/eslint-plugin-bestax';\n\nexport default [\n {\n files: ['**/*.{jsx,tsx}'],\n plugins: { '@allxsmith/bestax': bestax },\n languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } },\n rules: {\n '@allxsmith/bestax/valid-helper-value': 'error',\n '@allxsmith/bestax/no-deprecated-props': 'warn',\n },\n },\n];\n```\n\n## Rules\n\nIn `recommended` — each reports code that does not do what it says:\n\n| Rule | Fixable | What it catches |\n| --------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------- |\n| `valid-helper-value` | — | Helper values the library silently drops: `textAlign=\"center\"` (it is `centered`), `textSize=\"8\"`, `mt=\"1rem\"` |\n| `no-deprecated-props` | partly | Props the library deprecated: `isFullWidth`, `gapSize*`, `icon`. Fixes only the renames that cannot change what renders |\n| `no-inert-flex-props` | — | `justifyContent` and friends without a flex `display`, which emit nothing |\n\nOpt-in — these report code that works, and buy explicitness instead:\n\n| Rule | Fixable | What it asks for |\n| -------------------------- | ------- | ----------------------------------------------------------------------------------------------------------- |\n| `no-color-as-surface` | yes | `textColor` instead of the `color` alias, where `color` cannot mean a surface |\n| `no-bulma-component-class` | — | The bestax component instead of a plain element styled with its Bulma class (`<button className=\"button\">`) |\n\nThe rules that judge bestax elements resolve them through the import and\nthrough scope, so neither your own `<Box>` nor a local shadowing the imported\none is linted against Bulma's rules, and each skips a value it cannot read as a\nliteral. `no-bulma-component-class` reads plain HTML elements instead, and\nleaves components, custom elements and anything inside `<svg>` alone.\n\nA spread is handled by what it can change: `no-color-as-surface` and\n`no-inert-flex-props` go silent, since a spread may carry the prop that makes\nthe code correct; `no-deprecated-props` reports but offers no fix; and\n`valid-helper-value` judges only the values that actually render, so a spread\nBEFORE the attribute leaves it reporting and a spread after it does not: JSX is\nlast-wins throughout, spreads included. `no-bulma-component-class` reports\neither way, since the class is written right there. No autofix changes what the\ncode renders.\n\n### valid-helper-value\n\n```jsx\n<Box textAlign=\"center\" /> // ✗ not a value textAlign accepts. Did you mean `centered`?\n<Box textAlign=\"centered\" /> // ✓\n```\n\nThe valid values come from the library's own exported tuples at lint time, by\nway of its `/constants` subpath, rather than from a list copied into this\npackage. The version those tuples come from is the copy of\n`@allxsmith/bestax-bulma` this plugin resolves, which in an ordinary deduped\ninstall is the same one your app uses; across a major bump it may not be, so\nkeep the two in step.\n\nOne family is outside its reach, knowingly: component-specific `color` props\nhave their own unions, so `<Button color=\"ghost\">` is correct and reporting it\nwould be worse than reporting nothing. And one element shadows a helper name:\n`Theme` takes a prop per Bulma CSS variable, so its `radius` sets\n`--bulma-radius` rather than emitting a class, while its type still says\notherwise. The rule skips that one pair until the library picks a meaning.\n\n### no-deprecated-props\n\n```jsx\n<Button isFullWidth /> // ✗ deprecated → fixes to isFullwidth\n<Tabs color=\"info\" /> // ✗ no .tabs.is-<color> CSS exists; no fix offered\n```\n\nThe table is generated from the library's own TSDoc, so a rename lands here\nwith the library rather than after someone notices.\n\n### no-color-as-surface\n\nOff by default. `color` on the content elements is a documented alias for\n`textColor`, so this rule is about saying which you meant, not about broken\ncode.\n\n```jsx\n<Box color=\"primary\" /> // ✗ ambiguous → fixes to textColor\n<Box bgColor=\"primary\" /> // ✓ a coloured surface\n<Button color=\"primary\" /> // ✓ Button really has an is-primary variant\n\n// ✓ silent: the background is explicit, so `color` is plainly the text half\n<Box bgColor=\"info\" color=\"primary\" />\n```\n\n### no-bulma-component-class\n\nOff by default. It reports a plain element styled with a Bulma class that\nbestax has a component for, and names the component. Turn it on in an app that\nhas moved onto bestax, with `bestax-migrate bulma-classes` or by hand, to keep\nraw Bulma markup from coming back.\n\n```jsx\n<button className=\"button is-primary\" /> // ✗ bestax renders .button as Button\n<div className=\"card\" /> // ✗ bestax has Card, converted by hand\n<div className=\"has-text-centered mt-4\" /> // ✓ helper classes are left alone\n<p className=\"help\" /> // ✓ bestax renders .help inside its form controls\n```\n\nIt reads the classes a `className` spells out, including the strings in a\nternary, a template, or a call to `clsx`, `classnames` or `tailwind-merge`\n(however the file imports or requires it), and reports one class per element:\nthe one the codemod would decide by. A function your app defines, a `cn` in `lib/utils`\nincluded, is one it cannot see into, so it reads nothing there. It only reports. Whether an element converts\ndepends on its tag, attributes and children, and `bestax-migrate bulma-classes`\nis the one place that judges that.\n\n### no-inert-flex-props\n\n```jsx\n<Box justifyContent=\"center\" /> // ✗ emits nothing\n<Box display=\"flex\" justifyContent=\"center\" /> // ✓\n<Box flexGrow=\"1\" /> // ✓ child props always apply\n```\n\n## Links\n\n- [Documentation](https://bestax.io/docs/guides/getting-started/eslint-plugin)\n- [Component library](https://www.npmjs.com/package/@allxsmith/bestax-bulma)\n- [Repository](https://github.com/allxsmith/bestax)\n\n## License\n\nMIT\n"
75
+ "readme": "# @allxsmith/eslint-plugin-bestax\n\n[![npm version](https://img.shields.io/npm/v/@allxsmith/eslint-plugin-bestax.svg)](https://www.npmjs.com/package/@allxsmith/eslint-plugin-bestax)\n[![npm downloads](https://img.shields.io/npm/dm/@allxsmith/eslint-plugin-bestax.svg)](https://www.npmjs.com/package/@allxsmith/eslint-plugin-bestax)\n[![npm provenance](https://img.shields.io/badge/npm-provenance-3fb950.svg)](https://www.npmjs.com/package/@allxsmith/eslint-plugin-bestax#provenance)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Socket Badge](https://badge.socket.dev/npm/package/@allxsmith/eslint-plugin-bestax/latest)](https://socket.dev/npm/package/@allxsmith/eslint-plugin-bestax/overview)\n[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/allxsmith/bestax/badge)](https://scorecard.dev/viewer/?uri=github.com/allxsmith/bestax)\n[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/14361/badge)](https://www.bestpractices.dev/projects/14361)\n[![Security policy](https://img.shields.io/badge/security-policy-blue.svg)](https://github.com/allxsmith/bestax/blob/main/SECURITY.md)\n\nESLint rules for [`@allxsmith/bestax-bulma`](https://www.npmjs.com/package/@allxsmith/bestax-bulma).\n\nEvery rule here reports code that does not do what it looks like it does. The\nlibrary's helper props validate by membership and emit nothing for a value they\ndo not recognise, with no throw and no warning, so `textColor=\"blue\"` renders\nnothing and says nothing.\n\n**Scope, up front:** the helper props are typed as literal unions, so if you\nwrite bestax in `.tsx` and run `tsc`, it already catches a wrong literal. This\nplugin is for the places that check does not reach: JavaScript and JSX\nprojects, and lint stages that run before or instead of typechecking. The deprecation and flex rules are additive everywhere, since\nno type error marks a deprecated prop or a flex prop that emits nothing.\n\n## Requirements\n\nESLint 10, using [flat config](https://eslint.org/docs/latest/use/configure/configuration-files).\nThe plugin is ESM-only, which does not rule out a CommonJS config. An\n`eslint.config.cjs` can `require()` it on a Node that supports `require(esm)`,\nand `configs.recommended` reads straight off the result with no interop hop,\nbecause `rules` and `configs` are named exports alongside the default. On a\nNode without that support it throws `ERR_REQUIRE_ESM`, and an `import` from\n`eslint.config.mjs` works either way.\n\n## Setup\n\n```bash\nnpm install --save-dev @allxsmith/eslint-plugin-bestax\n```\n\n### TypeScript\n\nThe preset sets no `parser`, so a TypeScript parser has to come from a config\nobject of your own. Put it first; the preset after:\n\n```js\n// eslint.config.js\nimport bestax from '@allxsmith/eslint-plugin-bestax';\nimport parser from '@typescript-eslint/parser';\n\nexport default [\n { files: ['**/*.{ts,tsx}'], languageOptions: { parser } },\n bestax.configs.recommended,\n];\n```\n\nAny TypeScript setup that sets a parser works the same way, `typescript-eslint`\nincluded, precisely because the preset does not set one of its own.\n\nThe parser is a requirement, not a nicety. The preset matches `.tsx` because\nthat is where a TypeScript project's JSX lives, and with no parser supplied it\nhands that file to the default one, which stops at the first type annotation:\n`Parsing error: The keyword 'interface' is reserved`.\n\n### JavaScript and JSX\n\nIf the project contains no `.tsx` at all, the preset alone is enough:\n\n```js\n// eslint.config.js\nimport bestax from '@allxsmith/eslint-plugin-bestax';\n\nexport default [bestax.configs.recommended];\n```\n\nAdd one `.tsx` file later and you need the parser block above. The failure is\nloud rather than silent, which is the intended trade: leaving `.tsx` out of the\npreset's own `files` would mean a TypeScript project got no rules on any `.tsx`\nfile and no indication why.\n\n### Picking rules yourself\n\n`files` is load-bearing: a flat config object without it inherits ESLint's\ndefault `**/*.{js,mjs,cjs}` set, so leaving it out silently lints none of your\nJSX.\n\n```js\nimport bestax from '@allxsmith/eslint-plugin-bestax';\n\nexport default [\n {\n files: ['**/*.{jsx,tsx}'],\n plugins: { '@allxsmith/bestax': bestax },\n languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } },\n rules: {\n '@allxsmith/bestax/valid-helper-value': 'error',\n '@allxsmith/bestax/no-deprecated-props': 'warn',\n },\n },\n];\n```\n\n## Rules\n\nIn `recommended` — each reports code that does not do what it says:\n\n| Rule | Fixable | What it catches |\n| --------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------- |\n| `valid-helper-value` | — | Helper values the library silently drops: `textAlign=\"center\"` (it is `centered`), `textSize=\"8\"`, `mt=\"1rem\"` |\n| `no-deprecated-props` | partly | Props the library deprecated: `isFullWidth`, `gapSize*`, `icon`. Fixes only the renames that cannot change what renders |\n| `no-inert-flex-props` | — | `justifyContent` and friends without a flex `display`, which emit nothing |\n\nOpt-in — these report code that works, and buy explicitness instead:\n\n| Rule | Fixable | What it asks for |\n| -------------------------- | ------- | ----------------------------------------------------------------------------------------------------------- |\n| `no-color-as-surface` | yes | `textColor` instead of the `color` alias, where `color` cannot mean a surface |\n| `no-bulma-component-class` | — | The bestax component instead of a plain element styled with its Bulma class (`<button className=\"button\">`) |\n\nThe rules that judge bestax elements resolve them through the import and\nthrough scope, so neither your own `<Box>` nor a local shadowing the imported\none is linted against Bulma's rules, and each skips a value it cannot read as a\nliteral. `no-bulma-component-class` reads plain HTML elements instead, and\nleaves components, custom elements and anything inside `<svg>` alone.\n\nA spread is handled by what it can change: `no-color-as-surface` and\n`no-inert-flex-props` go silent, since a spread may carry the prop that makes\nthe code correct; `no-deprecated-props` reports but offers no fix; and\n`valid-helper-value` judges only the values that actually render, so a spread\nBEFORE the attribute leaves it reporting and a spread after it does not: JSX is\nlast-wins throughout, spreads included. `no-bulma-component-class` reports\neither way, since the class is written right there. No autofix changes what the\ncode renders.\n\n### valid-helper-value\n\n```jsx\n<Box textAlign=\"center\" /> // ✗ not a value textAlign accepts. Did you mean `centered`?\n<Box textAlign=\"centered\" /> // ✓\n```\n\nThe valid values come from the library's own exported tuples at lint time, by\nway of its `/constants` subpath, rather than from a list copied into this\npackage. The version those tuples come from is the copy of\n`@allxsmith/bestax-bulma` this plugin resolves, which in an ordinary deduped\ninstall is the same one your app uses; across a major bump it may not be, so\nkeep the two in step.\n\nOne family is outside its reach, knowingly: component-specific `color` props\nhave their own unions, so `<Button color=\"ghost\">` is correct and reporting it\nwould be worse than reporting nothing. And one element shadows a helper name:\n`Theme` takes a prop per Bulma CSS variable, so its `radius` sets\n`--bulma-radius` rather than emitting a class, while its type still says\notherwise. The rule skips that one pair until the library picks a meaning.\n\n### no-deprecated-props\n\n```jsx\n<Button isFullWidth /> // ✗ deprecated → fixes to isFullwidth\n<Tabs color=\"info\" /> // ✗ no .tabs.is-<color> CSS exists; no fix offered\n```\n\nThe table is generated from the library's own TSDoc, so a rename lands here\nwith the library rather than after someone notices.\n\n### no-color-as-surface\n\nOff by default. `color` on the content elements is a documented alias for\n`textColor`, so this rule is about saying which you meant, not about broken\ncode.\n\n```jsx\n<Box color=\"primary\" /> // ✗ ambiguous → fixes to textColor\n<Box bgColor=\"primary\" /> // ✓ a coloured surface\n<Button color=\"primary\" /> // ✓ Button really has an is-primary variant\n\n// ✓ silent: the background is explicit, so `color` is plainly the text half\n<Box bgColor=\"info\" color=\"primary\" />\n```\n\n### no-bulma-component-class\n\nOff by default. It reports a plain element styled with a Bulma class that\nbestax has a component for, and names the component. Turn it on in an app that\nhas moved onto bestax, with `bestax-migrate bulma-classes` or by hand, to keep\nraw Bulma markup from coming back.\n\n```jsx\n<button className=\"button is-primary\" /> // ✗ bestax renders .button as Button\n<div className=\"dropdown\" /> // ✗ bestax has Dropdown, converted by hand\n<div className=\"has-text-centered mt-4\" /> // ✓ helper classes are left alone\n<p className=\"help\" /> // ✓ bestax renders .help inside its form controls\n```\n\nIt reads the classes a `className` spells out, including the strings in a\nternary, a template, or a call to `clsx`, `classnames` or `tailwind-merge`\n(however the file imports or requires it), and reports one class per element:\nthe one the codemod would decide by. A function your app defines, a `cn` in `lib/utils`\nincluded, is one it cannot see into, so it reads nothing there. It only reports. Whether an element converts\ndepends on its tag, attributes and children, and `bestax-migrate bulma-classes`\nis the one place that judges that.\n\n### no-inert-flex-props\n\n```jsx\n<Box justifyContent=\"center\" /> // ✗ emits nothing\n<Box display=\"flex\" justifyContent=\"center\" /> // ✓\n<Box flexGrow=\"1\" /> // ✓ child props always apply\n```\n\n## Links\n\n- [Documentation](https://bestax.io/docs/guides/getting-started/eslint-plugin)\n- [Component library](https://www.npmjs.com/package/@allxsmith/bestax-bulma)\n- [Repository](https://github.com/allxsmith/bestax)\n\n## License\n\nMIT\n"
76
76
  }