eslint-plugin-react-dom 5.30.0-beta.6 → 5.30.0-beta.8
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.js +30 -29
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DEFAULT_ESLINT_REACT_SETTINGS, RE_JAVASCRIPT_PROTOCOL, getSettingsFromContext } from "@eslint-react/shared";
|
|
2
2
|
import * as ESLintUtils from "@typescript-eslint/utils/eslint-utils";
|
|
3
3
|
import { findAttribute, getAttributeStaticValue, getAttributeStaticValueByName, getAttributeValue, getAttributeValueByName, getElementFullType, hasAnyAttribute, hasAttribute, isEmptyExpressionContainer, isHostElement, isPaddingWhitespace, isPlainAttribute } from "@eslint-react/jsx";
|
|
4
|
-
import { getText } from "@eslint-react/eslint";
|
|
4
|
+
import { complete, getText } from "@eslint-react/eslint";
|
|
5
5
|
import { Check, Extract } from "@eslint-react/ast";
|
|
6
6
|
import { AST_NODE_TYPES } from "@typescript-eslint/types";
|
|
7
7
|
import { createImportLookup } from "@eslint-react/var";
|
|
@@ -19,7 +19,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
19
19
|
};
|
|
20
20
|
// package.json
|
|
21
21
|
var name$2 = "eslint-plugin-react-dom";
|
|
22
|
-
var version = "5.30.0-beta.
|
|
22
|
+
var version = "5.30.0-beta.8";
|
|
23
23
|
// src/utils/create-rule.ts
|
|
24
24
|
function getDocsUrl(ruleName) {
|
|
25
25
|
return `https://eslint-react.xyz/docs/rules/dom-${ruleName}`;
|
|
@@ -1481,43 +1481,45 @@ function getStandardName(name, context) {
|
|
|
1481
1481
|
}
|
|
1482
1482
|
// src/rules/no-unknown-property/no-unknown-property.ts
|
|
1483
1483
|
const RULE_NAME$4 = "no-unknown-property";
|
|
1484
|
-
const
|
|
1484
|
+
const defaultOptions$1 = [{
|
|
1485
1485
|
ignore: [],
|
|
1486
1486
|
requireDataLowercase: false
|
|
1487
|
+
}];
|
|
1488
|
+
const schema$1 = [{
|
|
1489
|
+
type: "object",
|
|
1490
|
+
additionalProperties: false,
|
|
1491
|
+
properties: {
|
|
1492
|
+
ignore: {
|
|
1493
|
+
type: "array",
|
|
1494
|
+
description: "Property names to ignore.",
|
|
1495
|
+
items: { type: "string" }
|
|
1496
|
+
},
|
|
1497
|
+
requireDataLowercase: {
|
|
1498
|
+
type: "boolean",
|
|
1499
|
+
description: "Require lowercase names for data-* attributes."
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
}];
|
|
1503
|
+
const messages = {
|
|
1504
|
+
"data-lowercase-required": "React does not recognize data-* props with uppercase characters on a DOM element. Found '{{name}}', use '{{lowerCaseName}}' instead",
|
|
1505
|
+
"invalid-prop-on-tag": "Invalid property '{{name}}' found on tag '{{tagName}}', but it is only allowed on: {{allowedTags}}",
|
|
1506
|
+
"unknown-prop": "Unknown property '{{name}}' found",
|
|
1507
|
+
"unknown-prop-with-standard-name": "Unknown property '{{name}}' found, use '{{standardName}}' instead"
|
|
1487
1508
|
};
|
|
1488
1509
|
var no_unknown_property_default = createRule({
|
|
1489
1510
|
meta: {
|
|
1490
1511
|
type: "problem",
|
|
1491
|
-
defaultOptions: [
|
|
1512
|
+
defaultOptions: [...defaultOptions$1],
|
|
1492
1513
|
docs: { description: "Disallows unknown 'DOM' properties." },
|
|
1493
1514
|
fixable: "code",
|
|
1494
|
-
messages
|
|
1495
|
-
|
|
1496
|
-
"invalid-prop-on-tag": "Invalid property '{{name}}' found on tag '{{tagName}}', but it is only allowed on: {{allowedTags}}",
|
|
1497
|
-
"unknown-prop": "Unknown property '{{name}}' found",
|
|
1498
|
-
"unknown-prop-with-standard-name": "Unknown property '{{name}}' found, use '{{standardName}}' instead"
|
|
1499
|
-
},
|
|
1500
|
-
schema: [{
|
|
1501
|
-
type: "object",
|
|
1502
|
-
additionalProperties: false,
|
|
1503
|
-
properties: {
|
|
1504
|
-
ignore: {
|
|
1505
|
-
type: "array",
|
|
1506
|
-
description: "Property names to ignore.",
|
|
1507
|
-
items: { type: "string" }
|
|
1508
|
-
},
|
|
1509
|
-
requireDataLowercase: {
|
|
1510
|
-
type: "boolean",
|
|
1511
|
-
description: "Require lowercase names for data-* attributes."
|
|
1512
|
-
}
|
|
1513
|
-
}
|
|
1514
|
-
}]
|
|
1515
|
+
messages,
|
|
1516
|
+
schema: schema$1
|
|
1515
1517
|
},
|
|
1516
1518
|
name: RULE_NAME$4,
|
|
1517
1519
|
create: create$4
|
|
1518
1520
|
});
|
|
1519
1521
|
function create$4(context) {
|
|
1520
|
-
const { ignore
|
|
1522
|
+
const { ignore, requireDataLowercase } = complete(context.options[0], defaultOptions$1[0]);
|
|
1521
1523
|
let attributeTagsMap = null;
|
|
1522
1524
|
return { JSXAttribute(node) {
|
|
1523
1525
|
const actualName = getText(context, node.name);
|
|
@@ -1622,8 +1624,7 @@ const schema = [{
|
|
|
1622
1624
|
additionalProperties: false,
|
|
1623
1625
|
properties: { allowReferrer: {
|
|
1624
1626
|
type: "boolean",
|
|
1625
|
-
description: "Allow 'rel=\"noopener\"' without 'noreferrer' so referrer information is preserved."
|
|
1626
|
-
default: false
|
|
1627
|
+
description: "Allow 'rel=\"noopener\"' without 'noreferrer' so referrer information is preserved."
|
|
1627
1628
|
} }
|
|
1628
1629
|
}];
|
|
1629
1630
|
var no_unsafe_target_blank_default = createRule({
|
|
@@ -1643,7 +1644,7 @@ var no_unsafe_target_blank_default = createRule({
|
|
|
1643
1644
|
create: create$2
|
|
1644
1645
|
});
|
|
1645
1646
|
function create$2(context) {
|
|
1646
|
-
const { allowReferrer
|
|
1647
|
+
const { allowReferrer } = complete(context.options[0], defaultOptions[0]);
|
|
1647
1648
|
const resolver = createJSXElementResolver(context);
|
|
1648
1649
|
const requiredRelAttribute = `rel="${allowReferrer ? "noopener" : "noreferrer"}"`;
|
|
1649
1650
|
return { JSXElement(node) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-dom",
|
|
3
|
-
"version": "5.30.0-beta.
|
|
3
|
+
"version": "5.30.0-beta.8",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for DOM related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"dist"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@eslint-react/ast": "5.30.0-beta.
|
|
41
|
-
"@eslint-react/eslint": "5.30.0-beta.
|
|
42
|
-
"@eslint-react/jsx": "5.30.0-beta.
|
|
43
|
-
"@eslint-react/shared": "5.30.0-beta.
|
|
44
|
-
"@eslint-react/var": "5.30.0-beta.
|
|
40
|
+
"@eslint-react/ast": "5.30.0-beta.8",
|
|
41
|
+
"@eslint-react/eslint": "5.30.0-beta.8",
|
|
42
|
+
"@eslint-react/jsx": "5.30.0-beta.8",
|
|
43
|
+
"@eslint-react/shared": "5.30.0-beta.8",
|
|
44
|
+
"@eslint-react/var": "5.30.0-beta.8",
|
|
45
45
|
"@typescript-eslint/types": "^8.72.1",
|
|
46
46
|
"@typescript-eslint/utils": "^8.72.1",
|
|
47
47
|
"compare-versions": "^6.1.1",
|