eslint-interactive 13.0.0 → 13.0.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/dist/action/convert-error-to-warning-per-file.d.ts +6 -0
- package/dist/action/convert-error-to-warning-per-file.d.ts.map +1 -0
- package/dist/action/convert-error-to-warning-per-file.js +8 -0
- package/dist/action/convert-error-to-warning-per-file.js.map +1 -0
- package/dist/action/disable-per-file.d.ts +6 -0
- package/dist/action/disable-per-file.d.ts.map +1 -0
- package/dist/action/disable-per-file.js +12 -0
- package/dist/action/disable-per-file.js.map +1 -0
- package/dist/action/disable-per-line.d.ts +6 -0
- package/dist/action/disable-per-line.d.ts.map +1 -0
- package/dist/action/disable-per-line.js +12 -0
- package/dist/action/disable-per-line.js.map +1 -0
- package/dist/action/fix.d.ts +6 -0
- package/dist/action/fix.d.ts.map +1 -0
- package/dist/action/fix.js +6 -0
- package/dist/action/fix.js.map +1 -0
- package/dist/action/index.d.ts +6 -0
- package/dist/action/index.d.ts.map +1 -0
- package/dist/action/index.js +6 -0
- package/dist/action/index.js.map +1 -0
- package/dist/action/print-result-details.d.ts +5 -0
- package/dist/action/print-result-details.d.ts.map +1 -0
- package/dist/action/print-result-details.js +35 -0
- package/dist/action/print-result-details.js.map +1 -0
- package/dist/cli/log.d.ts +6 -0
- package/dist/cli/log.d.ts.map +1 -0
- package/dist/cli/log.js +10 -0
- package/dist/cli/log.js.map +1 -0
- package/dist/cli/package.d.ts +2 -0
- package/dist/cli/package.d.ts.map +1 -0
- package/dist/cli/package.js +6 -0
- package/dist/cli/package.js.map +1 -0
- package/dist/cli/pager.d.ts +2 -0
- package/dist/cli/pager.d.ts.map +1 -0
- package/dist/cli/pager.js +34 -0
- package/dist/cli/pager.js.map +1 -0
- package/dist/cli/parse-argv.d.ts +4 -0
- package/dist/cli/parse-argv.d.ts.map +1 -0
- package/dist/cli/parse-argv.js +82 -0
- package/dist/cli/parse-argv.js.map +1 -0
- package/dist/cli/prompt.d.ts +51 -0
- package/dist/cli/prompt.d.ts.map +1 -0
- package/dist/cli/prompt.js +135 -0
- package/dist/cli/prompt.js.map +1 -0
- package/dist/cli/run.d.ts +8 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +52 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/cli/spinner.d.ts +4 -0
- package/dist/cli/spinner.d.ts.map +1 -0
- package/dist/cli/spinner.js +20 -0
- package/dist/cli/spinner.js.map +1 -0
- package/dist/core-worker.d.ts +21 -0
- package/dist/core-worker.d.ts.map +1 -0
- package/dist/core-worker.js +47 -0
- package/dist/core-worker.js.map +1 -0
- package/dist/core.d.ts +82 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +186 -0
- package/dist/core.js.map +1 -0
- package/dist/eslint/linter.d.ts +18 -0
- package/dist/eslint/linter.d.ts.map +1 -0
- package/dist/eslint/linter.js +71 -0
- package/dist/eslint/linter.js.map +1 -0
- package/dist/eslint/report-translator.d.ts +9 -0
- package/dist/eslint/report-translator.d.ts.map +1 -0
- package/dist/eslint/report-translator.js +75 -0
- package/dist/eslint/report-translator.js.map +1 -0
- package/dist/eslint/rule-fixer.d.ts +80 -0
- package/dist/eslint/rule-fixer.d.ts.map +1 -0
- package/dist/eslint/rule-fixer.js +114 -0
- package/dist/eslint/rule-fixer.js.map +1 -0
- package/dist/eslint/source-code-fixer.d.ts +15 -0
- package/dist/eslint/source-code-fixer.d.ts.map +1 -0
- package/dist/eslint/source-code-fixer.js +131 -0
- package/dist/eslint/source-code-fixer.js.map +1 -0
- package/dist/fix/apply-auto-fixes.d.ts +8 -0
- package/dist/fix/apply-auto-fixes.d.ts.map +1 -0
- package/dist/fix/apply-auto-fixes.js +8 -0
- package/dist/fix/apply-auto-fixes.js.map +1 -0
- package/dist/fix/apply-suggestions.d.ts +11 -0
- package/dist/fix/apply-suggestions.d.ts.map +1 -0
- package/dist/fix/apply-suggestions.js +25 -0
- package/dist/fix/apply-suggestions.js.map +1 -0
- package/dist/fix/convert-error-to-warning-per-file.d.ts +10 -0
- package/dist/fix/convert-error-to-warning-per-file.d.ts.map +1 -0
- package/dist/fix/convert-error-to-warning-per-file.js +28 -0
- package/dist/fix/convert-error-to-warning-per-file.js.map +1 -0
- package/dist/fix/disable-per-file.d.ts +12 -0
- package/dist/fix/disable-per-file.d.ts.map +1 -0
- package/dist/fix/disable-per-file.js +63 -0
- package/dist/fix/disable-per-file.js.map +1 -0
- package/dist/fix/disable-per-line.d.ts +12 -0
- package/dist/fix/disable-per-line.d.ts.map +1 -0
- package/dist/fix/disable-per-line.js +72 -0
- package/dist/fix/disable-per-line.js.map +1 -0
- package/dist/fix/index.d.ts +19 -0
- package/dist/fix/index.d.ts.map +1 -0
- package/dist/fix/index.js +8 -0
- package/dist/fix/index.js.map +1 -0
- package/dist/fix/make-fixable-and-fix.d.ts +11 -0
- package/dist/fix/make-fixable-and-fix.d.ts.map +1 -0
- package/dist/fix/make-fixable-and-fix.js +35 -0
- package/dist/fix/make-fixable-and-fix.js.map +1 -0
- package/dist/formatter/colors.d.ts +4 -0
- package/dist/formatter/colors.d.ts.map +1 -0
- package/dist/formatter/colors.js +5 -0
- package/dist/formatter/colors.js.map +1 -0
- package/dist/formatter/format-by-files.d.ts +3 -0
- package/dist/formatter/format-by-files.d.ts.map +1 -0
- package/dist/formatter/format-by-files.js +42 -0
- package/dist/formatter/format-by-files.js.map +1 -0
- package/dist/formatter/format-by-rules.d.ts +8 -0
- package/dist/formatter/format-by-rules.d.ts.map +1 -0
- package/dist/formatter/format-by-rules.js +31 -0
- package/dist/formatter/format-by-rules.js.map +1 -0
- package/dist/formatter/format-table.d.ts +4 -0
- package/dist/formatter/format-table.d.ts.map +1 -0
- package/dist/formatter/format-table.js +62 -0
- package/dist/formatter/format-table.js.map +1 -0
- package/dist/formatter/index.d.ts +6 -0
- package/dist/formatter/index.d.ts.map +1 -0
- package/dist/formatter/index.js +8 -0
- package/dist/formatter/index.js.map +1 -0
- package/dist/formatter/sort-rule-statistics.d.ts +5 -0
- package/dist/formatter/sort-rule-statistics.d.ts.map +1 -0
- package/dist/formatter/sort-rule-statistics.js +34 -0
- package/dist/formatter/sort-rule-statistics.js.map +1 -0
- package/dist/formatter/take-rule-statistics.d.ts +18 -0
- package/dist/formatter/take-rule-statistics.d.ts.map +1 -0
- package/dist/formatter/take-rule-statistics.js +51 -0
- package/dist/formatter/take-rule-statistics.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +4 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +87 -0
- package/dist/plugin.js.map +1 -0
- package/dist/scene/check-results.d.ts +21 -0
- package/dist/scene/check-results.d.ts.map +1 -0
- package/dist/scene/check-results.js +22 -0
- package/dist/scene/check-results.js.map +1 -0
- package/dist/scene/index.d.ts +25 -0
- package/dist/scene/index.d.ts.map +1 -0
- package/dist/scene/index.js +6 -0
- package/dist/scene/index.js.map +1 -0
- package/dist/scene/lint.d.ts +8 -0
- package/dist/scene/lint.d.ts.map +1 -0
- package/dist/scene/lint.js +30 -0
- package/dist/scene/lint.js.map +1 -0
- package/dist/scene/select-action.d.ts +20 -0
- package/dist/scene/select-action.d.ts.map +1 -0
- package/dist/scene/select-action.js +44 -0
- package/dist/scene/select-action.js.map +1 -0
- package/dist/scene/select-rule-ids.d.ts +15 -0
- package/dist/scene/select-rule-ids.d.ts.map +1 -0
- package/dist/scene/select-rule-ids.js +10 -0
- package/dist/scene/select-rule-ids.js.map +1 -0
- package/dist/type.d.ts +12 -0
- package/dist/type.d.ts.map +1 -0
- package/dist/type.js +2 -0
- package/dist/type.js.map +1 -0
- package/dist/util/array.d.ts +3 -0
- package/dist/util/array.d.ts.map +1 -0
- package/dist/util/array.js +14 -0
- package/dist/util/array.js.map +1 -0
- package/dist/util/eslint.d.ts +103 -0
- package/dist/util/eslint.d.ts.map +1 -0
- package/dist/util/eslint.js +220 -0
- package/dist/util/eslint.js.map +1 -0
- package/dist/util/type-check.d.ts +3 -0
- package/dist/util/type-check.d.ts.map +1 -0
- package/dist/util/type-check.js +8 -0
- package/dist/util/type-check.js.map +1 -0
- package/package.json +18 -19
- package/src/index.ts +0 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { unique } from './array.js';
|
|
2
|
+
const COMMENT_RE = /^\s*(?<header>eslint-disable|eslint-disable-next-line)\s+(?<ruleList>[@a-z0-9\-_$/]*(?:\s*,\s*[@a-z0-9\-_$/]*)*(?:\s*,)?)(?:\s+--\s+(?<description>.*\S))?\s*$/u;
|
|
3
|
+
const SHEBANG_PATTERN = /^#!.+?\r?\n/u;
|
|
4
|
+
/**
|
|
5
|
+
* Parses the comment as an ESLint disable comment.
|
|
6
|
+
* Returns undefined if the comment cannot be parsed as a disable comment.
|
|
7
|
+
*
|
|
8
|
+
* ## Reference: Structure of a disable comment
|
|
9
|
+
* /* eslint-disable-next-line rule-a, rule-b, rule-c, rule-d -- I'm the rules.
|
|
10
|
+
* ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^
|
|
11
|
+
* | | | |
|
|
12
|
+
* header | | |
|
|
13
|
+
* ruleList | |
|
|
14
|
+
* descriptionHeader |
|
|
15
|
+
* description
|
|
16
|
+
*/
|
|
17
|
+
export function parseDisableComment(comment) {
|
|
18
|
+
// NOTE: Comment nodes should always have range and loc, but they are optional in the types.
|
|
19
|
+
// If range or loc is missing, consider the parsing failed.
|
|
20
|
+
if (!comment.range || !comment.loc)
|
|
21
|
+
return undefined;
|
|
22
|
+
const result = COMMENT_RE.exec(comment.value);
|
|
23
|
+
if (!result)
|
|
24
|
+
return undefined;
|
|
25
|
+
if (!result.groups)
|
|
26
|
+
return undefined;
|
|
27
|
+
const { header, ruleList, description } = result.groups;
|
|
28
|
+
if (header === undefined || ruleList === undefined)
|
|
29
|
+
return undefined;
|
|
30
|
+
const ruleIds = ruleList
|
|
31
|
+
.split(',')
|
|
32
|
+
.map((r) => r.trim())
|
|
33
|
+
// Exclude empty strings
|
|
34
|
+
.filter((ruleId) => ruleId !== '');
|
|
35
|
+
const scope = header === 'eslint-disable-next-line' ? 'next-line' : 'file';
|
|
36
|
+
// A file scope comment must be block-style.
|
|
37
|
+
if (scope === 'file' && comment.type === 'Line')
|
|
38
|
+
return undefined;
|
|
39
|
+
return {
|
|
40
|
+
type: comment.type,
|
|
41
|
+
scope: header === 'eslint-disable-next-line' ? 'next-line' : 'file',
|
|
42
|
+
ruleIds,
|
|
43
|
+
// description is optional
|
|
44
|
+
...(description === '' || description === undefined ? {} : { description }),
|
|
45
|
+
range: comment.range,
|
|
46
|
+
loc: comment.loc,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Convert text to comment text.
|
|
51
|
+
*/
|
|
52
|
+
export function toCommentText(args) {
|
|
53
|
+
const { type, text } = args;
|
|
54
|
+
if (type === 'Line') {
|
|
55
|
+
return `// ${text}`;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
return `/* ${text} */`;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Convert `DisableComment` to comment text.
|
|
63
|
+
*/
|
|
64
|
+
export function toDisableCommentText({ type, scope, ruleIds, description, }) {
|
|
65
|
+
const header = scope === 'next-line' ? 'eslint-disable-next-line' : 'eslint-disable';
|
|
66
|
+
const ruleList = unique(ruleIds).join(', ');
|
|
67
|
+
const footer = description === undefined ? '' : ` -- ${description}`;
|
|
68
|
+
return toCommentText({ type, text: `${header} ${ruleList}${footer}` });
|
|
69
|
+
}
|
|
70
|
+
function getIndentFromLine(sourceCode, line) {
|
|
71
|
+
const headNodeIndex = sourceCode.getIndexFromLoc({ line, column: 0 });
|
|
72
|
+
// Extract the same indent as the line we want to fix
|
|
73
|
+
const indent = sourceCode.text.slice(headNodeIndex, headNodeIndex +
|
|
74
|
+
sourceCode.text
|
|
75
|
+
.slice(headNodeIndex)
|
|
76
|
+
// ref: https://tc39.es/ecma262/#sec-white-space
|
|
77
|
+
// eslint-disable-next-line no-control-regex
|
|
78
|
+
.search(/[^\u{0009}\u{000B}\u{000C}\u{FEFF}\p{gc=Space_Separator}]/u));
|
|
79
|
+
return indent;
|
|
80
|
+
}
|
|
81
|
+
function isLineInJSXText(sourceCode, line) {
|
|
82
|
+
const headNodeIndex = sourceCode.getIndexFromLoc({ line, column: 0 });
|
|
83
|
+
const headNode = sourceCode.getNodeByRangeIndex(headNodeIndex);
|
|
84
|
+
return headNode?.type === 'JSXText';
|
|
85
|
+
}
|
|
86
|
+
export function isLineInTemplateLiteral(sourceCode, line) {
|
|
87
|
+
const headNodeIndex = sourceCode.getIndexFromLoc({ line, column: 0 });
|
|
88
|
+
const headNode = sourceCode.getNodeByRangeIndex(headNodeIndex);
|
|
89
|
+
return headNode?.type === 'TemplateElement';
|
|
90
|
+
}
|
|
91
|
+
export function getStartColumnOfTemplateExpression(sourceCode, message) {
|
|
92
|
+
for (let i = message.column; i >= 1; i--) {
|
|
93
|
+
const index = sourceCode.getIndexFromLoc({
|
|
94
|
+
line: message.line,
|
|
95
|
+
// Convert 1-indexed to 0-indexed
|
|
96
|
+
column: i - 1,
|
|
97
|
+
});
|
|
98
|
+
const node = sourceCode.getNodeByRangeIndex(index);
|
|
99
|
+
if (node?.type === 'TemplateElement') {
|
|
100
|
+
return i;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
throw new Error(`unreachable: The line ${message.line} does not have a template element.`);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Merge the ruleIds of the disable comments.
|
|
107
|
+
* @param a The ruleIds of first disable comment
|
|
108
|
+
* @param b The ruleIds of second disable comment
|
|
109
|
+
* @returns The ruleIds of merged disable comment
|
|
110
|
+
*/
|
|
111
|
+
export function mergeRuleIds(a, b) {
|
|
112
|
+
return unique([...a, ...b]);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Merge the description of the disable comments.
|
|
116
|
+
* @param a The description of first disable comment
|
|
117
|
+
* @param b The description of second disable comment
|
|
118
|
+
* @returns The description of merged disable comment
|
|
119
|
+
*/
|
|
120
|
+
export function mergeDescription(a, b) {
|
|
121
|
+
if (a === undefined && b === undefined)
|
|
122
|
+
return undefined;
|
|
123
|
+
if (a === undefined)
|
|
124
|
+
return b;
|
|
125
|
+
if (b === undefined)
|
|
126
|
+
return a;
|
|
127
|
+
return `${a}, ${b}`;
|
|
128
|
+
}
|
|
129
|
+
export function insertDescriptionCommentStatementBeforeLine(args) {
|
|
130
|
+
const { fixer, sourceCode, line, column, description } = args;
|
|
131
|
+
const indent = getIndentFromLine(sourceCode, line);
|
|
132
|
+
const headNodeIndex = sourceCode.getIndexFromLoc({ line, column });
|
|
133
|
+
if (isLineInJSXText(sourceCode, line)) {
|
|
134
|
+
const commentText = toCommentText({ type: 'Block', text: description });
|
|
135
|
+
return fixer.insertTextBeforeRange([headNodeIndex, headNodeIndex], `${indent}{${commentText}}\n`);
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
const commentText = toCommentText({ type: 'Line', text: description });
|
|
139
|
+
return fixer.insertTextBeforeRange([headNodeIndex, headNodeIndex], `${indent}${commentText}\n`);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Update existing disable comment.
|
|
144
|
+
* @returns The eslint's fix object
|
|
145
|
+
*/
|
|
146
|
+
export function updateDisableComment(args) {
|
|
147
|
+
const { fixer, disableComment: existingDisableComment, newRules, newDescription } = args;
|
|
148
|
+
const newDisableCommentText = toDisableCommentText({
|
|
149
|
+
type: existingDisableComment.type,
|
|
150
|
+
scope: existingDisableComment.scope,
|
|
151
|
+
ruleIds: newRules,
|
|
152
|
+
description: newDescription,
|
|
153
|
+
});
|
|
154
|
+
return fixer.replaceTextRange(existingDisableComment.range, newDisableCommentText);
|
|
155
|
+
}
|
|
156
|
+
export function insertDisableCommentStatementBeforeLine(args) {
|
|
157
|
+
const { fixer, sourceCode, line, column, scope, ruleIds, description } = args;
|
|
158
|
+
const indent = getIndentFromLine(sourceCode, line);
|
|
159
|
+
const headNodeIndex = sourceCode.getIndexFromLoc({ line, column });
|
|
160
|
+
const isInJSXText = isLineInJSXText(sourceCode, line);
|
|
161
|
+
const type = isInJSXText || scope === 'file' ? 'Block' : 'Line';
|
|
162
|
+
const disableCommentText = toDisableCommentText({
|
|
163
|
+
type,
|
|
164
|
+
scope,
|
|
165
|
+
ruleIds,
|
|
166
|
+
description,
|
|
167
|
+
});
|
|
168
|
+
if (isInJSXText) {
|
|
169
|
+
return fixer.insertTextBeforeRange([headNodeIndex, headNodeIndex], `${indent}{${disableCommentText}}\n`);
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
return fixer.insertTextBeforeRange([headNodeIndex, headNodeIndex], `${indent}${disableCommentText}\n`);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Convert `InlineConfigComment` to comment text.
|
|
177
|
+
*/
|
|
178
|
+
export function toInlineConfigCommentText({ rulesRecord, description }) {
|
|
179
|
+
const header = 'eslint';
|
|
180
|
+
const rulesRecordText = Object.entries(rulesRecord)
|
|
181
|
+
.map(([ruleId, ruleEntry]) => {
|
|
182
|
+
// TODO: Inherit options of the rule set by the user in ESLint config if the option exists.
|
|
183
|
+
return `${ruleId}: ${JSON.stringify(ruleEntry)}`;
|
|
184
|
+
})
|
|
185
|
+
.join(', ');
|
|
186
|
+
if (description === undefined) {
|
|
187
|
+
return `/* ${header} ${rulesRecordText} */`;
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
return `/* ${header} ${rulesRecordText} -- ${description} */`;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Create the results with only messages with the specified rule ids.
|
|
195
|
+
* @param results The lint results.
|
|
196
|
+
* @param ruleIds The rule ids.
|
|
197
|
+
* @returns The results with only messages with the specified rule ids
|
|
198
|
+
*/
|
|
199
|
+
export function filterResultsByRuleId(results, ruleIds) {
|
|
200
|
+
return results
|
|
201
|
+
.map((result) => {
|
|
202
|
+
return {
|
|
203
|
+
...result,
|
|
204
|
+
messages: result.messages.filter((message) => ruleIds.includes(message.ruleId)),
|
|
205
|
+
};
|
|
206
|
+
})
|
|
207
|
+
.filter((result) => result.messages.length > 0);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Find shebang from the first line of the file.
|
|
211
|
+
* @param sourceCodeText The source code text of the file.
|
|
212
|
+
* @returns The information of shebang. If the file does not have shebang, return null.
|
|
213
|
+
*/
|
|
214
|
+
export function findShebang(sourceCodeText) {
|
|
215
|
+
const result = SHEBANG_PATTERN.exec(sourceCodeText);
|
|
216
|
+
if (!result)
|
|
217
|
+
return null;
|
|
218
|
+
return { range: [0, result[0].length] };
|
|
219
|
+
}
|
|
220
|
+
//# sourceMappingURL=eslint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint.js","sourceRoot":"","sources":["../../src/util/eslint.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,UAAU,GACd,iKAAiK,CAAC;AAEpK,MAAM,eAAe,GAAG,cAAc,CAAC;AAWvC;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAgB;IAClD,4FAA4F;IAC5F,2DAA2D;IAC3D,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,GAAG;QAAE,OAAO,SAAS,CAAC;IAErD,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9C,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAC9B,IAAI,CAAC,MAAM,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;I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AAW,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,CAEnD;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,IAAI,MAAM,CAElF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-check.js","sourceRoot":"","sources":["../../src/util/type-check.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,MAAM,UAAU,WAAW,CAAC,OAAgB;IAC1C,MAAM,IAAI,KAAK,CAAC,OAAO,IAAI,kBAAkB,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,QAAQ,CAAS,KAAgC;IAC/D,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;AAC/C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-interactive",
|
|
3
3
|
"description": "The CLI tool to run `eslint --fix` for each rule",
|
|
4
|
-
"version": "13.0.
|
|
4
|
+
"version": "13.0.1",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/mizdra/eslint-interactive.git"
|
|
@@ -18,23 +18,7 @@
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
-
"scripts": {
|
|
22
|
-
"build": "tsc -p tsconfig.build.json",
|
|
23
|
-
"predev": "pnpm run build",
|
|
24
|
-
"dev": "cd example && ../bin/eslint-interactive.js ./lib",
|
|
25
|
-
"lint": "pnpm run --no-bail /^lint:.*/",
|
|
26
|
-
"lint:tsc": "tsc -p tsconfig.json --noEmit",
|
|
27
|
-
"lint:eslint": "eslint .",
|
|
28
|
-
"lint:prettier": "prettier --check .",
|
|
29
|
-
"lint-fix": "pnpm run --no-bail /^lint-fix:.*/",
|
|
30
|
-
"lint-fix:eslint": "eslint . --fix",
|
|
31
|
-
"lint-fix:prettier": "prettier --write .",
|
|
32
|
-
"test": "vitest --run",
|
|
33
|
-
"pree2e": "pnpm run build --noCheck",
|
|
34
|
-
"e2e": "vitest -c vite.config.e2e.ts --run"
|
|
35
|
-
},
|
|
36
21
|
"prettier": "@mizdra/prettier-config-mizdra",
|
|
37
|
-
"packageManager": "pnpm@10.10.0",
|
|
38
22
|
"devDependencies": {
|
|
39
23
|
"@eslint/eslintrc": "^3.3.3",
|
|
40
24
|
"@mizdra/eslint-config-mizdra": "^7.0.0",
|
|
@@ -79,5 +63,20 @@
|
|
|
79
63
|
"!src/**/__snapshots__",
|
|
80
64
|
"dist",
|
|
81
65
|
"static"
|
|
82
|
-
]
|
|
83
|
-
|
|
66
|
+
],
|
|
67
|
+
"scripts": {
|
|
68
|
+
"build": "tsc -p tsconfig.build.json",
|
|
69
|
+
"predev": "pnpm run build",
|
|
70
|
+
"dev": "cd example && ../bin/eslint-interactive.js ./lib",
|
|
71
|
+
"lint": "pnpm run --no-bail /^lint:.*/",
|
|
72
|
+
"lint:tsc": "tsc -p tsconfig.json --noEmit",
|
|
73
|
+
"lint:eslint": "eslint .",
|
|
74
|
+
"lint:prettier": "prettier --check .",
|
|
75
|
+
"lint-fix": "pnpm run --no-bail /^lint-fix:.*/",
|
|
76
|
+
"lint-fix:eslint": "eslint . --fix",
|
|
77
|
+
"lint-fix:prettier": "prettier --write .",
|
|
78
|
+
"test": "vitest --run",
|
|
79
|
+
"pree2e": "pnpm run build --noCheck",
|
|
80
|
+
"e2e": "vitest -c vite.config.e2e.ts --run"
|
|
81
|
+
}
|
|
82
|
+
}
|
package/src/index.ts
CHANGED
|
File without changes
|