eslint-plugin-react-dom 2.0.0-next.49 → 2.0.0-next.50

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.ts CHANGED
@@ -3,7 +3,8 @@ import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts
3
3
  import { RulePreset } from '@eslint-react/kit';
4
4
 
5
5
  declare const RULE_NAME = "no-missing-button-type";
6
- type MessageID = CamelCase<typeof RULE_NAME> | "addButtonType";
6
+ type MessageID = CamelCase<typeof RULE_NAME> | RuleSuggestMessageID;
7
+ type RuleSuggestMessageID = "addButtonType";
7
8
 
8
9
  declare const _default: {
9
10
  configs: {
package/dist/index.js CHANGED
@@ -44,7 +44,7 @@ var settings = {
44
44
 
45
45
  // package.json
46
46
  var name2 = "eslint-plugin-react-dom";
47
- var version = "2.0.0-next.49";
47
+ var version = "2.0.0-next.50";
48
48
  function createJsxElementResolver(context) {
49
49
  const { components, polymorphicPropName } = getSettingsFromContext(context);
50
50
  return {
@@ -323,7 +323,9 @@ function getFix(context, node) {
323
323
  };
324
324
  }
325
325
  var RULE_NAME6 = "no-missing-button-type";
326
- var RULE_FEATURES6 = [];
326
+ var RULE_FEATURES6 = [
327
+ "FIX"
328
+ ];
327
329
  var BUTTON_TYPES = ["button", "submit", "reset"];
328
330
  var no_missing_button_type_default = createRule({
329
331
  meta: {
@@ -363,12 +365,12 @@ function create6(context) {
363
365
  attributeNode,
364
366
  propNameOnJsx
365
367
  );
366
- if (attributeValue.kind === "some" && typeof attributeValue.value !== "string") {
368
+ if (attributeValue.kind !== "some" || typeof attributeValue.value !== "string") {
367
369
  context.report({
368
370
  messageId: "noMissingButtonType",
369
371
  node: attributeNode,
370
372
  suggest: getSuggest((type) => (fixer) => {
371
- return fixer.replaceText(node, `${propNameOnJsx}="${type}"`);
373
+ return fixer.replaceText(attributeNode, `${propNameOnJsx}="${type}"`);
372
374
  })
373
375
  });
374
376
  }
@@ -379,9 +381,7 @@ function create6(context) {
379
381
  messageId: "noMissingButtonType",
380
382
  node,
381
383
  suggest: getSuggest((type) => (fixer) => {
382
- const lastToken = context.sourceCode.getLastToken(node.openingElement);
383
- if (lastToken == null) return null;
384
- return fixer.insertTextBefore(lastToken, ` type="${type}"`);
384
+ return fixer.insertTextAfter(node.openingElement.name, ` type="${type}"`);
385
385
  })
386
386
  });
387
387
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-dom",
3
- "version": "2.0.0-next.49",
3
+ "version": "2.0.0-next.50",
4
4
  "description": "ESLint React's ESLint plugin for React DOM related rules.",
5
5
  "keywords": [
6
6
  "react",
@@ -41,12 +41,12 @@
41
41
  "compare-versions": "^6.1.1",
42
42
  "string-ts": "^2.2.1",
43
43
  "ts-pattern": "^5.7.1",
44
- "@eslint-react/ast": "2.0.0-next.49",
45
- "@eslint-react/core": "2.0.0-next.49",
46
- "@eslint-react/eff": "2.0.0-next.49",
47
- "@eslint-react/kit": "2.0.0-next.49",
48
- "@eslint-react/var": "2.0.0-next.49",
49
- "@eslint-react/shared": "2.0.0-next.49"
44
+ "@eslint-react/ast": "2.0.0-next.50",
45
+ "@eslint-react/eff": "2.0.0-next.50",
46
+ "@eslint-react/kit": "2.0.0-next.50",
47
+ "@eslint-react/core": "2.0.0-next.50",
48
+ "@eslint-react/shared": "2.0.0-next.50",
49
+ "@eslint-react/var": "2.0.0-next.50"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/react": "^19.1.8",