@discord/eslint-plugin-discord-intl 0.26.0-rc.3 → 0.26.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/lib/native-validation.js +7 -7
- package/package.json +2 -2
package/lib/native-validation.js
CHANGED
|
@@ -71,7 +71,7 @@ function processAndValidateNative(sourceCode, fileName, content) {
|
|
|
71
71
|
start: 0,
|
|
72
72
|
end: content.length,
|
|
73
73
|
locale: error.locale ?? 'definition',
|
|
74
|
-
|
|
74
|
+
category: 'correctness',
|
|
75
75
|
fixes: [],
|
|
76
76
|
});
|
|
77
77
|
}
|
|
@@ -109,11 +109,10 @@ function traverseAndReportMatchingNativeValidations(context, predicate) {
|
|
|
109
109
|
* @returns {SourceLocation}
|
|
110
110
|
*/
|
|
111
111
|
function reportedSpan(diagnostic) {
|
|
112
|
-
const messageOffset =
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}) + 1;
|
|
112
|
+
const messageOffset = context.sourceCode.getIndexFromLoc({
|
|
113
|
+
line: diagnostic.messageLine,
|
|
114
|
+
column: diagnostic.messageCol,
|
|
115
|
+
});
|
|
117
116
|
|
|
118
117
|
context.sourceCode.getNodeByRangeIndex(messageOffset);
|
|
119
118
|
return {
|
|
@@ -136,6 +135,7 @@ function traverseAndReportMatchingNativeValidations(context, predicate) {
|
|
|
136
135
|
message: diagnostic.description,
|
|
137
136
|
};
|
|
138
137
|
if (diagnostic.fixes.length > 0 && value.range != null) {
|
|
138
|
+
// Add 1 because ESLint 8 works on 1-based column indices.
|
|
139
139
|
const valueStart = value.range[0] + 1;
|
|
140
140
|
report.fix = (fixer) => {
|
|
141
141
|
return diagnostic.fixes.map((fix) =>
|
|
@@ -145,7 +145,7 @@ function traverseAndReportMatchingNativeValidations(context, predicate) {
|
|
|
145
145
|
|
|
146
146
|
const suggestableFixes = diagnostic.fixes.filter((fix) => fix.message != null);
|
|
147
147
|
if (suggestableFixes.length > 0 && value.range != null) {
|
|
148
|
-
const valueStart = value.range[0]
|
|
148
|
+
const valueStart = value.range[0];
|
|
149
149
|
|
|
150
150
|
report.suggest = suggestableFixes.map((fix) => ({
|
|
151
151
|
desc: /** @type {string} */ (fix.message),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@discord/eslint-plugin-discord-intl",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"description": "ESLint plugin for validating and linting messages and translations using @discord/intl",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@typescript-eslint/scope-manager": "^8.8.1",
|
|
14
|
-
"@discord/intl-loader-core": "0.26.
|
|
14
|
+
"@discord/intl-loader-core": "0.26.1"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@types/eslint": "^8.56.12",
|