@intl-party/eslint-plugin 1.0.0
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/LICENSE +21 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.js +367 -0
- package/package.json +52 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 IntlParty Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
|
|
2
|
+
|
|
3
|
+
declare const plugin: {
|
|
4
|
+
meta: {
|
|
5
|
+
name: string;
|
|
6
|
+
version: string;
|
|
7
|
+
};
|
|
8
|
+
rules: {
|
|
9
|
+
"no-hardcoded-strings": _typescript_eslint_utils_ts_eslint.RuleModule<"hardcodedString" | "hardcodedStringInAttribute", [], _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
10
|
+
"no-missing-keys": _typescript_eslint_utils_ts_eslint.RuleModule<"missingTranslationKey" | "invalidTranslationKey", [], _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
11
|
+
"prefer-translation-hooks": _typescript_eslint_utils_ts_eslint.RuleModule<"preferUseTranslations" | "preferScopedTranslations", [], _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
12
|
+
};
|
|
13
|
+
configs: {
|
|
14
|
+
recommended: {
|
|
15
|
+
plugins: string[];
|
|
16
|
+
rules: {
|
|
17
|
+
"@intl-party/no-hardcoded-strings": string;
|
|
18
|
+
"@intl-party/no-missing-keys": string;
|
|
19
|
+
"@intl-party/prefer-translation-hooks": string;
|
|
20
|
+
};
|
|
21
|
+
settings: {
|
|
22
|
+
"intl-party": {
|
|
23
|
+
translationFiles: string[];
|
|
24
|
+
defaultLocale: string;
|
|
25
|
+
namespaces: string[];
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
strict: {
|
|
30
|
+
plugins: string[];
|
|
31
|
+
rules: {
|
|
32
|
+
"@intl-party/no-hardcoded-strings": (string | {
|
|
33
|
+
attributes: string[];
|
|
34
|
+
minLength: number;
|
|
35
|
+
ignorePattern: string;
|
|
36
|
+
})[];
|
|
37
|
+
"@intl-party/no-missing-keys": string;
|
|
38
|
+
"@intl-party/prefer-translation-hooks": (string | {
|
|
39
|
+
allowDirectUsage: boolean;
|
|
40
|
+
})[];
|
|
41
|
+
};
|
|
42
|
+
settings: {
|
|
43
|
+
"intl-party": {
|
|
44
|
+
translationFiles: string[];
|
|
45
|
+
defaultLocale: string;
|
|
46
|
+
namespaces: string[];
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export { plugin as default };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
default: () => index_default
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(index_exports);
|
|
26
|
+
|
|
27
|
+
// src/rules/no-hardcoded-strings.ts
|
|
28
|
+
var import_utils = require("@typescript-eslint/utils");
|
|
29
|
+
var noHardcodedStrings = import_utils.ESLintUtils.RuleCreator(
|
|
30
|
+
(name) => `https://github.com/intl-party/intl-party/blob/main/packages/eslint-plugin/docs/rules/${name}.md`
|
|
31
|
+
)({
|
|
32
|
+
name: "no-hardcoded-strings",
|
|
33
|
+
meta: {
|
|
34
|
+
type: "problem",
|
|
35
|
+
docs: {
|
|
36
|
+
description: "Disallow hardcoded strings in JSX elements and specific attributes",
|
|
37
|
+
recommended: "warn"
|
|
38
|
+
},
|
|
39
|
+
fixable: "code",
|
|
40
|
+
schema: [
|
|
41
|
+
{
|
|
42
|
+
type: "object",
|
|
43
|
+
properties: {
|
|
44
|
+
attributes: {
|
|
45
|
+
type: "array",
|
|
46
|
+
items: { type: "string" },
|
|
47
|
+
default: [
|
|
48
|
+
"placeholder",
|
|
49
|
+
"title",
|
|
50
|
+
"aria-label",
|
|
51
|
+
"aria-description",
|
|
52
|
+
"alt"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
ignorePattern: {
|
|
56
|
+
type: "string",
|
|
57
|
+
description: "Regex pattern for strings to ignore"
|
|
58
|
+
},
|
|
59
|
+
minLength: {
|
|
60
|
+
type: "number",
|
|
61
|
+
default: 3,
|
|
62
|
+
description: "Minimum string length to check"
|
|
63
|
+
},
|
|
64
|
+
allowedStrings: {
|
|
65
|
+
type: "array",
|
|
66
|
+
items: { type: "string" },
|
|
67
|
+
default: [],
|
|
68
|
+
description: "Array of specific strings that are allowed"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
additionalProperties: false
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
messages: {
|
|
75
|
+
hardcodedString: 'Hardcoded string "{{text}}" should be translated using t() function',
|
|
76
|
+
hardcodedStringInAttribute: 'Hardcoded string "{{text}}" in {{attribute}} attribute should be translated using t() function'
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
defaultOptions: [{}],
|
|
80
|
+
create(context, [options = {}]) {
|
|
81
|
+
const {
|
|
82
|
+
attributes = [
|
|
83
|
+
"placeholder",
|
|
84
|
+
"title",
|
|
85
|
+
"aria-label",
|
|
86
|
+
"aria-description",
|
|
87
|
+
"alt"
|
|
88
|
+
],
|
|
89
|
+
ignorePattern,
|
|
90
|
+
minLength = 3,
|
|
91
|
+
allowedStrings = []
|
|
92
|
+
} = options;
|
|
93
|
+
const ignoreRegex = ignorePattern ? new RegExp(ignorePattern) : null;
|
|
94
|
+
function isHardcodedString(value) {
|
|
95
|
+
if (value.length < minLength) return false;
|
|
96
|
+
if (allowedStrings.includes(value)) return false;
|
|
97
|
+
if (ignoreRegex && ignoreRegex.test(value)) return false;
|
|
98
|
+
if (/^(https?:\/\/|\/|\.\/|\.\.\/)/.test(value)) return false;
|
|
99
|
+
if (/^[a-z-]+$/.test(value) && value.includes("-")) return false;
|
|
100
|
+
if (/^[A-Z_][A-Z0-9_]*$/.test(value)) return false;
|
|
101
|
+
if (/^\d+(\.\d+)?(px|em|rem|%|vh|vw)$/.test(value)) return false;
|
|
102
|
+
const technicalWords = [
|
|
103
|
+
"div",
|
|
104
|
+
"span",
|
|
105
|
+
"button",
|
|
106
|
+
"input",
|
|
107
|
+
"form",
|
|
108
|
+
"header",
|
|
109
|
+
"footer",
|
|
110
|
+
"nav",
|
|
111
|
+
"main",
|
|
112
|
+
"section",
|
|
113
|
+
"article"
|
|
114
|
+
];
|
|
115
|
+
if (technicalWords.includes(value.toLowerCase())) return false;
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
function checkJSXAttribute(node) {
|
|
119
|
+
if (node.name.type === "JSXIdentifier" && attributes.includes(node.name.name) && node.value?.type === "Literal" && typeof node.value.value === "string" && isHardcodedString(node.value.value)) {
|
|
120
|
+
context.report({
|
|
121
|
+
node: node.value,
|
|
122
|
+
messageId: "hardcodedStringInAttribute",
|
|
123
|
+
data: {
|
|
124
|
+
text: node.value.value,
|
|
125
|
+
attribute: node.name.name
|
|
126
|
+
},
|
|
127
|
+
fix(fixer) {
|
|
128
|
+
return fixer.replaceText(
|
|
129
|
+
node.value,
|
|
130
|
+
`{t('${generateTranslationKey(node.value.value)}')}`
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
function checkJSXText(node) {
|
|
137
|
+
const text = node.value.trim();
|
|
138
|
+
if (text && isHardcodedString(text)) {
|
|
139
|
+
context.report({
|
|
140
|
+
node,
|
|
141
|
+
messageId: "hardcodedString",
|
|
142
|
+
data: { text },
|
|
143
|
+
fix(fixer) {
|
|
144
|
+
return fixer.replaceText(
|
|
145
|
+
node,
|
|
146
|
+
`{t('${generateTranslationKey(text)}')}`
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
function generateTranslationKey(text) {
|
|
153
|
+
return text.toLowerCase().replace(/[^a-z0-9\s]/g, "").replace(/\s+/g, "_").substring(0, 50);
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
JSXAttribute: checkJSXAttribute,
|
|
157
|
+
JSXText: checkJSXText
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
// src/rules/no-missing-keys.ts
|
|
163
|
+
var import_utils2 = require("@typescript-eslint/utils");
|
|
164
|
+
var noMissingKeys = import_utils2.ESLintUtils.RuleCreator(
|
|
165
|
+
(name) => `https://github.com/intl-party/intl-party/blob/main/packages/eslint-plugin/docs/rules/${name}.md`
|
|
166
|
+
)({
|
|
167
|
+
name: "no-missing-keys",
|
|
168
|
+
meta: {
|
|
169
|
+
type: "problem",
|
|
170
|
+
docs: {
|
|
171
|
+
description: "Ensure all translation keys exist in translation files",
|
|
172
|
+
recommended: "error"
|
|
173
|
+
},
|
|
174
|
+
schema: [
|
|
175
|
+
{
|
|
176
|
+
type: "object",
|
|
177
|
+
properties: {
|
|
178
|
+
translationFiles: {
|
|
179
|
+
type: "array",
|
|
180
|
+
items: { type: "string" },
|
|
181
|
+
description: "Paths to translation files to check against"
|
|
182
|
+
},
|
|
183
|
+
defaultLocale: {
|
|
184
|
+
type: "string",
|
|
185
|
+
default: "en",
|
|
186
|
+
description: "Default locale to check keys against"
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
additionalProperties: false
|
|
190
|
+
}
|
|
191
|
+
],
|
|
192
|
+
messages: {
|
|
193
|
+
missingTranslationKey: 'Translation key "{{key}}" is missing from translation files',
|
|
194
|
+
invalidTranslationKey: 'Translation key "{{key}}" has invalid format'
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
defaultOptions: [{}],
|
|
198
|
+
create(context, [options = {}]) {
|
|
199
|
+
const { translationFiles = [], defaultLocale = "en" } = options;
|
|
200
|
+
const translationKeys = /* @__PURE__ */ new Set();
|
|
201
|
+
function isValidTranslationKey(key) {
|
|
202
|
+
return /^[a-zA-Z][a-zA-Z0-9._-]*$/.test(key);
|
|
203
|
+
}
|
|
204
|
+
function checkTranslationCall(node) {
|
|
205
|
+
if (node.callee.type === "Identifier" && node.callee.name === "t" && node.arguments.length > 0 && node.arguments[0].type === "Literal" && typeof node.arguments[0].value === "string") {
|
|
206
|
+
const key = node.arguments[0].value;
|
|
207
|
+
if (!isValidTranslationKey(key)) {
|
|
208
|
+
context.report({
|
|
209
|
+
node: node.arguments[0],
|
|
210
|
+
messageId: "invalidTranslationKey",
|
|
211
|
+
data: { key }
|
|
212
|
+
});
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
function checkUseTranslationsCall(node) {
|
|
218
|
+
if (node.callee.type === "Identifier" && node.callee.name === "useTranslations") {
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return {
|
|
222
|
+
CallExpression(node) {
|
|
223
|
+
checkTranslationCall(node);
|
|
224
|
+
checkUseTranslationsCall(node);
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
// src/rules/prefer-translation-hooks.ts
|
|
231
|
+
var import_utils3 = require("@typescript-eslint/utils");
|
|
232
|
+
var preferTranslationHooks = import_utils3.ESLintUtils.RuleCreator(
|
|
233
|
+
(name) => `https://github.com/intl-party/intl-party/blob/main/packages/eslint-plugin/docs/rules/${name}.md`
|
|
234
|
+
)({
|
|
235
|
+
name: "prefer-translation-hooks",
|
|
236
|
+
meta: {
|
|
237
|
+
type: "suggestion",
|
|
238
|
+
docs: {
|
|
239
|
+
description: "Prefer using translation hooks over direct i18n instance usage in React components",
|
|
240
|
+
recommended: "warn"
|
|
241
|
+
},
|
|
242
|
+
fixable: "code",
|
|
243
|
+
schema: [
|
|
244
|
+
{
|
|
245
|
+
type: "object",
|
|
246
|
+
properties: {
|
|
247
|
+
allowDirectUsage: {
|
|
248
|
+
type: "boolean",
|
|
249
|
+
default: false,
|
|
250
|
+
description: "Allow direct i18n instance usage"
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
additionalProperties: false
|
|
254
|
+
}
|
|
255
|
+
],
|
|
256
|
+
messages: {
|
|
257
|
+
preferUseTranslations: "Prefer using useTranslations() hook instead of direct i18n.t() usage",
|
|
258
|
+
preferScopedTranslations: 'Consider using scoped translations for namespace "{{namespace}}"'
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
defaultOptions: [{}],
|
|
262
|
+
create(context, [options = {}]) {
|
|
263
|
+
const { allowDirectUsage = false } = options;
|
|
264
|
+
function checkMemberExpression(node) {
|
|
265
|
+
if (node.object.type === "Identifier" && node.object.name === "i18n" && node.property.type === "Identifier" && node.property.name === "t" && !allowDirectUsage) {
|
|
266
|
+
context.report({
|
|
267
|
+
node,
|
|
268
|
+
messageId: "preferUseTranslations",
|
|
269
|
+
fix(fixer) {
|
|
270
|
+
return fixer.replaceText(node, "t");
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
function checkCallExpression(node) {
|
|
276
|
+
if (node.callee.type === "Identifier" && node.callee.name === "t" && node.arguments.length > 0 && node.arguments[0].type === "Literal" && typeof node.arguments[0].value === "string") {
|
|
277
|
+
const key = node.arguments[0].value;
|
|
278
|
+
const namespacedKey = key.split(".");
|
|
279
|
+
if (namespacedKey.length > 1) {
|
|
280
|
+
const namespace = namespacedKey[0];
|
|
281
|
+
context.report({
|
|
282
|
+
node,
|
|
283
|
+
messageId: "preferScopedTranslations",
|
|
284
|
+
data: { namespace }
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
return {
|
|
290
|
+
MemberExpression: checkMemberExpression,
|
|
291
|
+
CallExpression: checkCallExpression
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
// src/configs/recommended.ts
|
|
297
|
+
var recommended = {
|
|
298
|
+
plugins: ["@intl-party"],
|
|
299
|
+
rules: {
|
|
300
|
+
"@intl-party/no-hardcoded-strings": "warn",
|
|
301
|
+
"@intl-party/no-missing-keys": "error",
|
|
302
|
+
"@intl-party/prefer-translation-hooks": "warn"
|
|
303
|
+
},
|
|
304
|
+
settings: {
|
|
305
|
+
"intl-party": {
|
|
306
|
+
// Default settings
|
|
307
|
+
translationFiles: ["./translations/**/*.json"],
|
|
308
|
+
defaultLocale: "en",
|
|
309
|
+
namespaces: ["common"]
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
// src/configs/strict.ts
|
|
315
|
+
var strict = {
|
|
316
|
+
plugins: ["@intl-party"],
|
|
317
|
+
rules: {
|
|
318
|
+
"@intl-party/no-hardcoded-strings": [
|
|
319
|
+
"error",
|
|
320
|
+
{
|
|
321
|
+
attributes: [
|
|
322
|
+
"placeholder",
|
|
323
|
+
"title",
|
|
324
|
+
"aria-label",
|
|
325
|
+
"aria-description",
|
|
326
|
+
"alt",
|
|
327
|
+
"label"
|
|
328
|
+
],
|
|
329
|
+
minLength: 2,
|
|
330
|
+
ignorePattern: "^[A-Z_][A-Z0-9_]*$"
|
|
331
|
+
// Ignore constants
|
|
332
|
+
}
|
|
333
|
+
],
|
|
334
|
+
"@intl-party/no-missing-keys": "error",
|
|
335
|
+
"@intl-party/prefer-translation-hooks": [
|
|
336
|
+
"error",
|
|
337
|
+
{
|
|
338
|
+
allowDirectUsage: false
|
|
339
|
+
}
|
|
340
|
+
]
|
|
341
|
+
},
|
|
342
|
+
settings: {
|
|
343
|
+
"intl-party": {
|
|
344
|
+
translationFiles: ["./translations/**/*.json"],
|
|
345
|
+
defaultLocale: "en",
|
|
346
|
+
namespaces: ["common"]
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
// src/index.ts
|
|
352
|
+
var plugin = {
|
|
353
|
+
meta: {
|
|
354
|
+
name: "@intl-party/eslint-plugin",
|
|
355
|
+
version: "0.1.0"
|
|
356
|
+
},
|
|
357
|
+
rules: {
|
|
358
|
+
"no-hardcoded-strings": noHardcodedStrings,
|
|
359
|
+
"no-missing-keys": noMissingKeys,
|
|
360
|
+
"prefer-translation-hooks": preferTranslationHooks
|
|
361
|
+
},
|
|
362
|
+
configs: {
|
|
363
|
+
recommended,
|
|
364
|
+
strict
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
var index_default = plugin;
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@intl-party/eslint-plugin",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "ESLint plugin for IntlParty - detect hardcoded strings and enforce i18n best practices",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"keywords": [
|
|
11
|
+
"eslint",
|
|
12
|
+
"eslint-plugin",
|
|
13
|
+
"i18n",
|
|
14
|
+
"internationalization",
|
|
15
|
+
"typescript",
|
|
16
|
+
"hardcoded-strings"
|
|
17
|
+
],
|
|
18
|
+
"author": "IntlParty Team",
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@typescript-eslint/utils": "^6.15.0"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/eslint": "^8.56.0",
|
|
25
|
+
"@types/node": "^20.10.0",
|
|
26
|
+
"@typescript-eslint/eslint-plugin": "^6.15.0",
|
|
27
|
+
"@typescript-eslint/parser": "^6.15.0",
|
|
28
|
+
"@typescript-eslint/rule-tester": "^6.15.0",
|
|
29
|
+
"eslint": "^8.55.0",
|
|
30
|
+
"jsdom": "^23.0.1",
|
|
31
|
+
"tsup": "^8.0.1",
|
|
32
|
+
"typescript": "^5.3.0",
|
|
33
|
+
"vitest": "^1.0.0"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"eslint": ">=8.0.0"
|
|
37
|
+
},
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "https://github.com/intl-party/intl-party.git",
|
|
41
|
+
"directory": "packages/eslint-plugin"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsup src/index.ts --format cjs --dts",
|
|
45
|
+
"dev": "tsup src/index.ts --format cjs --dts --watch",
|
|
46
|
+
"test": "vitest",
|
|
47
|
+
"test:watch": "vitest --watch",
|
|
48
|
+
"lint": "eslint src --ext .ts",
|
|
49
|
+
"typecheck": "tsc --noEmit",
|
|
50
|
+
"clean": "rm -rf dist"
|
|
51
|
+
}
|
|
52
|
+
}
|