@nkzw/eslint-plugin-fbtee 1.4.0 → 1.5.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 +8 -12
- package/lib/index.cjs +7 -8
- package/lib/index.js +5 -7
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -328,17 +328,13 @@ const Greeting = () => (
|
|
|
328
328
|
```tsx
|
|
329
329
|
<fbt desc="Feed item">
|
|
330
330
|
<fbt:list items={users} name="userList" />{' '}
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
</fbt:plural>{' '}
|
|
339
|
-
playing on
|
|
340
|
-
<fbt:param name="mapName">{game.mapName}</fbt:param>
|
|
341
|
-
</fbt>
|
|
331
|
+
won the game against
|
|
332
|
+
<fbt:plural count={bots} many="bots" name="numberOfBots" showCount="ifMany">
|
|
333
|
+
a bot
|
|
334
|
+
</fbt:plural> on the map
|
|
335
|
+
<fbt:param name="mapName">{game.mapName}</fbt:param>.
|
|
336
|
+
</fbt:plural>
|
|
337
|
+
// Example Output: "Alice, Bob and Charlie won the game against 2 bots on the map Forest Battle."
|
|
342
338
|
```
|
|
343
339
|
|
|
344
340
|
_Note: `<fbt>` is auto-imported for you by the `@nkzw/babel-preset-fbtee` plugin._
|
|
@@ -681,7 +677,7 @@ The open-source version of `fbt`, however, became unmaintained, difficult to set
|
|
|
681
677
|
|
|
682
678
|
**fbtee** remains compatible with `fbt` and migration is straightforward.
|
|
683
679
|
|
|
684
|
-
## Migration from `fbt
|
|
680
|
+
## Migration from `fbt`
|
|
685
681
|
|
|
686
682
|
**fbtee** is compatible with `fbt`. If you are already using `fbt`, migrating to fbtee is straightforward:
|
|
687
683
|
|
package/lib/index.cjs
CHANGED
|
@@ -21,11 +21,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
21
|
}) : target, mod));
|
|
22
22
|
|
|
23
23
|
//#endregion
|
|
24
|
-
|
|
24
|
+
let __typescript_eslint_utils = require("@typescript-eslint/utils");
|
|
25
|
+
__typescript_eslint_utils = __toESM(__typescript_eslint_utils);
|
|
25
26
|
|
|
26
27
|
//#region package.json
|
|
27
28
|
var name = "@nkzw/eslint-plugin-fbtee";
|
|
28
|
-
var version = "1.
|
|
29
|
+
var version = "1.5.1";
|
|
29
30
|
var description = "";
|
|
30
31
|
var keywords = [];
|
|
31
32
|
var repository = {
|
|
@@ -41,8 +42,8 @@ var exports$1 = {
|
|
|
41
42
|
};
|
|
42
43
|
var main = "lib/index.cjs";
|
|
43
44
|
var scripts = { "build": "tsdown src/index.tsx -d lib --target=node22 --format=esm,cjs --clean --dts" };
|
|
44
|
-
var dependencies = { "@typescript-eslint/utils": "^8.
|
|
45
|
-
var devDependencies = { "@typescript-eslint/rule-tester": "^8.
|
|
45
|
+
var dependencies = { "@typescript-eslint/utils": "^8.44.0" };
|
|
46
|
+
var devDependencies = { "@typescript-eslint/rule-tester": "^8.44.0" };
|
|
46
47
|
var package_default = {
|
|
47
48
|
name,
|
|
48
49
|
version,
|
|
@@ -154,8 +155,7 @@ var no_empty_strings_default = createRule({
|
|
|
154
155
|
JSXElement(node) {
|
|
155
156
|
if (!isFbtNode(node)) return;
|
|
156
157
|
if (node.openingElement.name.type === "JSXNamespacedName") return;
|
|
157
|
-
|
|
158
|
-
if (!hasTextContent) context.report({
|
|
158
|
+
if (!validateChildren(node)) context.report({
|
|
159
159
|
messageId: "jsxEmptyString",
|
|
160
160
|
node
|
|
161
161
|
});
|
|
@@ -184,8 +184,7 @@ function validateChildren(node) {
|
|
|
184
184
|
hasTextContent = true;
|
|
185
185
|
continue;
|
|
186
186
|
}
|
|
187
|
-
|
|
188
|
-
if (value) hasTextContent = true;
|
|
187
|
+
if (resolveNodeValue(child.expression)?.trim()) hasTextContent = true;
|
|
189
188
|
}
|
|
190
189
|
if (child.type === "JSXElement" || child.type === "JSXFragment") {
|
|
191
190
|
const childName = elementType(child);
|
package/lib/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ESLintUtils } from "@typescript-eslint/utils";
|
|
|
2
2
|
|
|
3
3
|
//#region package.json
|
|
4
4
|
var name = "@nkzw/eslint-plugin-fbtee";
|
|
5
|
-
var version = "1.
|
|
5
|
+
var version = "1.5.1";
|
|
6
6
|
var description = "";
|
|
7
7
|
var keywords = [];
|
|
8
8
|
var repository = {
|
|
@@ -18,8 +18,8 @@ var exports = {
|
|
|
18
18
|
};
|
|
19
19
|
var main = "lib/index.cjs";
|
|
20
20
|
var scripts = { "build": "tsdown src/index.tsx -d lib --target=node22 --format=esm,cjs --clean --dts" };
|
|
21
|
-
var dependencies = { "@typescript-eslint/utils": "^8.
|
|
22
|
-
var devDependencies = { "@typescript-eslint/rule-tester": "^8.
|
|
21
|
+
var dependencies = { "@typescript-eslint/utils": "^8.44.0" };
|
|
22
|
+
var devDependencies = { "@typescript-eslint/rule-tester": "^8.44.0" };
|
|
23
23
|
var package_default = {
|
|
24
24
|
name,
|
|
25
25
|
version,
|
|
@@ -131,8 +131,7 @@ var no_empty_strings_default = createRule({
|
|
|
131
131
|
JSXElement(node) {
|
|
132
132
|
if (!isFbtNode(node)) return;
|
|
133
133
|
if (node.openingElement.name.type === "JSXNamespacedName") return;
|
|
134
|
-
|
|
135
|
-
if (!hasTextContent) context.report({
|
|
134
|
+
if (!validateChildren(node)) context.report({
|
|
136
135
|
messageId: "jsxEmptyString",
|
|
137
136
|
node
|
|
138
137
|
});
|
|
@@ -161,8 +160,7 @@ function validateChildren(node) {
|
|
|
161
160
|
hasTextContent = true;
|
|
162
161
|
continue;
|
|
163
162
|
}
|
|
164
|
-
|
|
165
|
-
if (value) hasTextContent = true;
|
|
163
|
+
if (resolveNodeValue(child.expression)?.trim()) hasTextContent = true;
|
|
166
164
|
}
|
|
167
165
|
if (child.type === "JSXElement" || child.type === "JSXFragment") {
|
|
168
166
|
const childName = elementType(child);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nkzw/eslint-plugin-fbtee",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"repository": {
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
},
|
|
17
17
|
"main": "lib/index.cjs",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@typescript-eslint/utils": "^8.
|
|
19
|
+
"@typescript-eslint/utils": "^8.44.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@typescript-eslint/rule-tester": "^8.
|
|
22
|
+
"@typescript-eslint/rule-tester": "^8.44.0"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "tsdown src/index.tsx -d lib --target=node22 --format=esm,cjs --clean --dts"
|