eslint-plugin-formatjs 5.2.3 → 5.2.5
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 +1 -1
- package/context-compat.js +0 -1
- package/index.js +0 -1
- package/package.json +3 -3
- package/rules/blocklist-elements.js +2 -3
- package/rules/enforce-default-message.js +1 -2
- package/rules/enforce-description.js +1 -2
- package/rules/enforce-id.js +1 -2
- package/rules/enforce-placeholders.js +1 -2
- package/rules/enforce-plural-rules.js +1 -2
- package/rules/no-camel-case.js +1 -2
- package/rules/no-complex-selectors.js +1 -2
- package/rules/no-emoji.js +1 -2
- package/rules/no-id.js +1 -2
- package/rules/no-invalid-icu.js +0 -1
- package/rules/no-literal-string-in-jsx.js +1 -2
- package/rules/no-missing-icu-plural-one-placeholders.js +1 -2
- package/rules/no-multiple-plurals.js +1 -2
- package/rules/no-multiple-whitespaces.js +1 -2
- package/rules/no-offset.js +1 -2
- package/rules/no-useless-message.js +1 -2
- package/rules/prefer-formatted-message.js +1 -2
- package/rules/prefer-pound-in-plural.js +1 -2
- package/util.js +0 -1
package/README.md
CHANGED
package/context-compat.js
CHANGED
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-formatjs",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.5",
|
|
4
4
|
"description": "ESLint plugin for formatjs",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"picomatch": "2 || 3 || 4",
|
|
29
29
|
"tslib": "2",
|
|
30
30
|
"unicode-emoji-utils": "^1.2.0",
|
|
31
|
-
"@formatjs/icu-messageformat-parser": "2.9.
|
|
32
|
-
"@formatjs/ts-transformer": "3.13.
|
|
31
|
+
"@formatjs/icu-messageformat-parser": "2.9.4",
|
|
32
|
+
"@formatjs/ts-transformer": "3.13.23"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"eslint": "9"
|
|
@@ -91,14 +91,14 @@ function checkNode(context, node) {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
const createRule = utils_1.ESLintUtils.RuleCreator(_ => 'https://formatjs.io/docs/tooling/linter#blocklist-elements');
|
|
94
|
+
const createRule = utils_1.ESLintUtils.RuleCreator(_ => 'https://formatjs.github.io/docs/tooling/linter#blocklist-elements');
|
|
95
95
|
exports.rule = createRule({
|
|
96
96
|
name: exports.name,
|
|
97
97
|
meta: {
|
|
98
98
|
type: 'problem',
|
|
99
99
|
docs: {
|
|
100
100
|
description: 'Disallow specific elements in ICU message format',
|
|
101
|
-
url: 'https://formatjs.io/docs/tooling/linter#blocklist-elements',
|
|
101
|
+
url: 'https://formatjs.github.io/docs/tooling/linter#blocklist-elements',
|
|
102
102
|
},
|
|
103
103
|
fixable: 'code',
|
|
104
104
|
schema: [
|
|
@@ -133,4 +133,3 @@ exports.rule = createRule({
|
|
|
133
133
|
};
|
|
134
134
|
},
|
|
135
135
|
});
|
|
136
|
-
//# sourceMappingURL=blocklist-elements.js.map
|
|
@@ -34,7 +34,7 @@ exports.rule = {
|
|
|
34
34
|
type: 'problem',
|
|
35
35
|
docs: {
|
|
36
36
|
description: 'Enforce defaultMessage in message descriptor',
|
|
37
|
-
url: 'https://formatjs.io/docs/tooling/linter#enforce-default-message',
|
|
37
|
+
url: 'https://formatjs.github.io/docs/tooling/linter#enforce-default-message',
|
|
38
38
|
},
|
|
39
39
|
fixable: 'code',
|
|
40
40
|
schema: [
|
|
@@ -69,4 +69,3 @@ exports.rule = {
|
|
|
69
69
|
};
|
|
70
70
|
},
|
|
71
71
|
};
|
|
72
|
-
//# sourceMappingURL=enforce-default-message.js.map
|
|
@@ -34,7 +34,7 @@ exports.rule = {
|
|
|
34
34
|
type: 'problem',
|
|
35
35
|
docs: {
|
|
36
36
|
description: 'Enforce description in message descriptor',
|
|
37
|
-
url: 'https://formatjs.io/docs/tooling/linter#enforce-description',
|
|
37
|
+
url: 'https://formatjs.github.io/docs/tooling/linter#enforce-description',
|
|
38
38
|
},
|
|
39
39
|
fixable: 'code',
|
|
40
40
|
schema: [
|
|
@@ -67,4 +67,3 @@ exports.rule = {
|
|
|
67
67
|
};
|
|
68
68
|
},
|
|
69
69
|
};
|
|
70
|
-
//# sourceMappingURL=enforce-description.js.map
|
package/rules/enforce-id.js
CHANGED
|
@@ -88,7 +88,7 @@ exports.rule = {
|
|
|
88
88
|
type: 'problem',
|
|
89
89
|
docs: {
|
|
90
90
|
description: 'Enforce (generated) ID in message descriptor',
|
|
91
|
-
url: 'https://formatjs.io/docs/tooling/linter#enforce-id',
|
|
91
|
+
url: 'https://formatjs.github.io/docs/tooling/linter#enforce-id',
|
|
92
92
|
},
|
|
93
93
|
fixable: 'code',
|
|
94
94
|
schema: [
|
|
@@ -154,4 +154,3 @@ Actual: {{actual}}`,
|
|
|
154
154
|
};
|
|
155
155
|
},
|
|
156
156
|
};
|
|
157
|
-
//# sourceMappingURL=enforce-id.js.map
|
|
@@ -107,7 +107,7 @@ exports.rule = {
|
|
|
107
107
|
type: 'problem',
|
|
108
108
|
docs: {
|
|
109
109
|
description: 'Enforce that all messages with placeholders have enough passed-in values',
|
|
110
|
-
url: 'https://formatjs.io/docs/tooling/linter#enforce-placeholders',
|
|
110
|
+
url: 'https://formatjs.github.io/docs/tooling/linter#enforce-placeholders',
|
|
111
111
|
},
|
|
112
112
|
schema: [
|
|
113
113
|
{
|
|
@@ -148,4 +148,3 @@ exports.rule = {
|
|
|
148
148
|
};
|
|
149
149
|
},
|
|
150
150
|
};
|
|
151
|
-
//# sourceMappingURL=enforce-placeholders.js.map
|
|
@@ -65,7 +65,7 @@ exports.rule = {
|
|
|
65
65
|
type: 'problem',
|
|
66
66
|
docs: {
|
|
67
67
|
description: 'Enforce plural rules to always specify certain categories like `one`/`other`',
|
|
68
|
-
url: 'https://formatjs.io/docs/tooling/linter#enforce-plural-rules',
|
|
68
|
+
url: 'https://formatjs.github.io/docs/tooling/linter#enforce-plural-rules',
|
|
69
69
|
},
|
|
70
70
|
fixable: 'code',
|
|
71
71
|
schema: [
|
|
@@ -104,4 +104,3 @@ exports.rule = {
|
|
|
104
104
|
};
|
|
105
105
|
},
|
|
106
106
|
};
|
|
107
|
-
//# sourceMappingURL=enforce-plural-rules.js.map
|
package/rules/no-camel-case.js
CHANGED
|
@@ -50,7 +50,7 @@ exports.rule = {
|
|
|
50
50
|
type: 'problem',
|
|
51
51
|
docs: {
|
|
52
52
|
description: 'Disallow camel case placeholders in message',
|
|
53
|
-
url: 'https://formatjs.io/docs/tooling/linter#no-camel-case',
|
|
53
|
+
url: 'https://formatjs.github.io/docs/tooling/linter#no-camel-case',
|
|
54
54
|
},
|
|
55
55
|
fixable: 'code',
|
|
56
56
|
schema: [],
|
|
@@ -77,4 +77,3 @@ exports.rule = {
|
|
|
77
77
|
};
|
|
78
78
|
},
|
|
79
79
|
};
|
|
80
|
-
//# sourceMappingURL=no-camel-case.js.map
|
|
@@ -99,7 +99,7 @@ results in 2 sentences: "I have a dog" & "I have many dogs".
|
|
|
99
99
|
Default complexity limit is 20
|
|
100
100
|
(using Smartling as a reference: https://help.smartling.com/hc/en-us/articles/360008030994-ICU-MessageFormat)
|
|
101
101
|
`,
|
|
102
|
-
url: 'https://formatjs.io/docs/tooling/linter#no-complex-selectors',
|
|
102
|
+
url: 'https://formatjs.github.io/docs/tooling/linter#no-complex-selectors',
|
|
103
103
|
},
|
|
104
104
|
schema: [
|
|
105
105
|
{
|
|
@@ -137,4 +137,3 @@ Default complexity limit is 20
|
|
|
137
137
|
};
|
|
138
138
|
},
|
|
139
139
|
};
|
|
140
|
-
//# sourceMappingURL=no-complex-selectors.js.map
|
package/rules/no-emoji.js
CHANGED
|
@@ -66,7 +66,7 @@ exports.rule = {
|
|
|
66
66
|
type: 'problem',
|
|
67
67
|
docs: {
|
|
68
68
|
description: 'Disallow emojis in message',
|
|
69
|
-
url: 'https://formatjs.io/docs/tooling/linter#no-emoji',
|
|
69
|
+
url: 'https://formatjs.github.io/docs/tooling/linter#no-emoji',
|
|
70
70
|
},
|
|
71
71
|
fixable: 'code',
|
|
72
72
|
schema: [
|
|
@@ -100,4 +100,3 @@ exports.rule = {
|
|
|
100
100
|
};
|
|
101
101
|
},
|
|
102
102
|
};
|
|
103
|
-
//# sourceMappingURL=no-emoji.js.map
|
package/rules/no-id.js
CHANGED
|
@@ -32,7 +32,7 @@ exports.rule = {
|
|
|
32
32
|
type: 'problem',
|
|
33
33
|
docs: {
|
|
34
34
|
description: 'Ban explicit ID from MessageDescriptor',
|
|
35
|
-
url: 'https://formatjs.io/docs/tooling/linter#no-id',
|
|
35
|
+
url: 'https://formatjs.github.io/docs/tooling/linter#no-id',
|
|
36
36
|
},
|
|
37
37
|
fixable: 'code',
|
|
38
38
|
schema: [],
|
|
@@ -59,4 +59,3 @@ exports.rule = {
|
|
|
59
59
|
};
|
|
60
60
|
},
|
|
61
61
|
};
|
|
62
|
-
//# sourceMappingURL=no-id.js.map
|
package/rules/no-invalid-icu.js
CHANGED
|
@@ -41,7 +41,7 @@ exports.rule = {
|
|
|
41
41
|
type: 'problem',
|
|
42
42
|
docs: {
|
|
43
43
|
description: 'Disallow untranslated literal strings without translation.',
|
|
44
|
-
url: 'https://formatjs.io/docs/tooling/linter#no-literal-string-in-jsx',
|
|
44
|
+
url: 'https://formatjs.github.io/docs/tooling/linter#no-literal-string-in-jsx',
|
|
45
45
|
},
|
|
46
46
|
schema: [
|
|
47
47
|
{
|
|
@@ -181,4 +181,3 @@ exports.rule = {
|
|
|
181
181
|
};
|
|
182
182
|
},
|
|
183
183
|
};
|
|
184
|
-
//# sourceMappingURL=no-literal-string-in-jsx.js.map
|
|
@@ -74,7 +74,7 @@ exports.rule = {
|
|
|
74
74
|
type: 'problem',
|
|
75
75
|
docs: {
|
|
76
76
|
description: 'We use `one {# item}` instead of `one {1 item}` in ICU messages as some locales use the `one` formatting for other similar numbers.',
|
|
77
|
-
url: 'https://formatjs.io/docs/tooling/linter#no-explicit-icu-plural',
|
|
77
|
+
url: 'https://formatjs.github.io/docs/tooling/linter#no-explicit-icu-plural',
|
|
78
78
|
},
|
|
79
79
|
fixable: 'code',
|
|
80
80
|
messages: {
|
|
@@ -101,4 +101,3 @@ exports.rule = {
|
|
|
101
101
|
};
|
|
102
102
|
},
|
|
103
103
|
};
|
|
104
|
-
//# sourceMappingURL=no-missing-icu-plural-one-placeholders.js.map
|
|
@@ -44,7 +44,7 @@ exports.rule = {
|
|
|
44
44
|
type: 'problem',
|
|
45
45
|
docs: {
|
|
46
46
|
description: 'Disallow multiple plural rules in the same message',
|
|
47
|
-
url: 'https://formatjs.io/docs/tooling/linter#no-multiple-plurals',
|
|
47
|
+
url: 'https://formatjs.github.io/docs/tooling/linter#no-multiple-plurals',
|
|
48
48
|
},
|
|
49
49
|
fixable: 'code',
|
|
50
50
|
schema: [],
|
|
@@ -71,4 +71,3 @@ exports.rule = {
|
|
|
71
71
|
};
|
|
72
72
|
},
|
|
73
73
|
};
|
|
74
|
-
//# sourceMappingURL=no-multiple-plurals.js.map
|
|
@@ -114,7 +114,7 @@ exports.rule = {
|
|
|
114
114
|
type: 'problem',
|
|
115
115
|
docs: {
|
|
116
116
|
description: 'Prevents usage of multiple consecutive whitespaces in message',
|
|
117
|
-
url: 'https://formatjs.io/docs/tooling/linter#no-multiple-whitespaces',
|
|
117
|
+
url: 'https://formatjs.github.io/docs/tooling/linter#no-multiple-whitespaces',
|
|
118
118
|
},
|
|
119
119
|
messages: {
|
|
120
120
|
noMultipleWhitespaces: 'Multiple consecutive whitespaces are not allowed',
|
|
@@ -142,4 +142,3 @@ exports.rule = {
|
|
|
142
142
|
};
|
|
143
143
|
},
|
|
144
144
|
};
|
|
145
|
-
//# sourceMappingURL=no-multiple-whitespaces.js.map
|
package/rules/no-offset.js
CHANGED
|
@@ -43,7 +43,7 @@ exports.rule = {
|
|
|
43
43
|
type: 'problem',
|
|
44
44
|
docs: {
|
|
45
45
|
description: 'Disallow offset in plural rules',
|
|
46
|
-
url: 'https://formatjs.io/docs/tooling/linter#no-offset',
|
|
46
|
+
url: 'https://formatjs.github.io/docs/tooling/linter#no-offset',
|
|
47
47
|
},
|
|
48
48
|
fixable: 'code',
|
|
49
49
|
messages: {
|
|
@@ -70,4 +70,3 @@ exports.rule = {
|
|
|
70
70
|
};
|
|
71
71
|
},
|
|
72
72
|
};
|
|
73
|
-
//# sourceMappingURL=no-offset.js.map
|
|
@@ -42,7 +42,7 @@ exports.rule = {
|
|
|
42
42
|
type: 'problem',
|
|
43
43
|
docs: {
|
|
44
44
|
description: 'Disallow unnecessary formatted message',
|
|
45
|
-
url: 'https://formatjs.io/docs/tooling/linter#no-useless-message',
|
|
45
|
+
url: 'https://formatjs.github.io/docs/tooling/linter#no-useless-message',
|
|
46
46
|
},
|
|
47
47
|
fixable: 'code',
|
|
48
48
|
schema: [],
|
|
@@ -72,4 +72,3 @@ exports.rule = {
|
|
|
72
72
|
};
|
|
73
73
|
},
|
|
74
74
|
};
|
|
75
|
-
//# sourceMappingURL=no-useless-message.js.map
|
|
@@ -8,7 +8,7 @@ exports.rule = {
|
|
|
8
8
|
type: 'suggestion',
|
|
9
9
|
docs: {
|
|
10
10
|
description: 'Prefer `FormattedMessage` component over `intl.formatMessage` if applicable.',
|
|
11
|
-
url: 'https://formatjs.io/docs/tooling/linter#prefer-formatted-message',
|
|
11
|
+
url: 'https://formatjs.github.io/docs/tooling/linter#prefer-formatted-message',
|
|
12
12
|
},
|
|
13
13
|
messages: {
|
|
14
14
|
jsxChildren: 'Prefer `FormattedMessage` over `intl.formatMessage` in the JSX children expression.',
|
|
@@ -34,4 +34,3 @@ exports.rule = {
|
|
|
34
34
|
};
|
|
35
35
|
},
|
|
36
36
|
};
|
|
37
|
-
//# sourceMappingURL=prefer-formatted-message.js.map
|
|
@@ -164,7 +164,7 @@ exports.rule = {
|
|
|
164
164
|
type: 'suggestion',
|
|
165
165
|
docs: {
|
|
166
166
|
description: 'Prefer using # to reference the count in the plural argument.',
|
|
167
|
-
url: 'https://formatjs.io/docs/tooling/linter#prefer-pound-in-plurals',
|
|
167
|
+
url: 'https://formatjs.github.io/docs/tooling/linter#prefer-pound-in-plurals',
|
|
168
168
|
},
|
|
169
169
|
messages: {
|
|
170
170
|
preferPoundInPlurals: 'Prefer using # to reference the count in the plural argument instead of repeating the argument.',
|
|
@@ -193,4 +193,3 @@ exports.rule = {
|
|
|
193
193
|
};
|
|
194
194
|
},
|
|
195
195
|
};
|
|
196
|
-
//# sourceMappingURL=prefer-pound-in-plural.js.map
|
package/util.js
CHANGED