Skip to content

Commit d35d0d4

Browse files
committed
Revert "merges"
This reverts commit 76f705b, reversing changes made to 5678adf.
1 parent 76f705b commit d35d0d4

30 files changed

+110
-393
lines changed

.circleci/config.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ jobs:
9191
- attach_workspace:
9292
at: "."
9393

94+
- run: npm i -g ts-node
9495
- run: npm run test:end-to-end
9596

9697
test-unit:
@@ -143,10 +144,6 @@ workflows:
143144
- prettier:
144145
requires:
145146
- build
146-
- test-end-to-end:
147-
requires:
148-
- build
149-
- tsc
150147
- test-unit:
151148
requires:
152149
- build

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ module.exports = {
2323
"@typescript-eslint/generic-type-naming": 0,
2424
"@typescript-eslint/indent": 0,
2525
"@typescript-eslint/member-ordering": 0,
26-
"@typescript-eslint/no-empty-function": 0,
2726
"@typescript-eslint/no-explicit-any": 0,
2827
"@typescript-eslint/no-extra-parens": 0,
2928
"@typescript-eslint/no-magic-numbers": 0,
@@ -48,6 +47,7 @@ module.exports = {
4847
"import/prefer-default-export": 0,
4948
"no-console": 0,
5049
"no-continue": 0,
50+
"no-empty-function": 0,
5151
"no-restricted-syntax": 0,
5252
"no-param-reassign": 0,
5353
"no-return-await": 0,

docs/Testing.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,3 @@ Within each directory, a test suite will execute `bin/tslint-to-eslint` and vali
4242

4343
Use `npm run test:end-to-end:accept` to overwrite the expected contents of files with what is actually written.
4444
These behave similarly to updating snapshots in snapshot testing.
45-
46-
> Note: these end-to-end tests use the compiled result of `npm run tsc`, so if you update source code, re-run `npm run tsc` before `npm run test:end-to-end`.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,5 @@
6565
"test:end-to-end:accept": "jest --config=test/jest.config.js --globals=\"{\\\"acceptTestChanges\\\": true }\" --runInBand",
6666
"tsc": "tsc"
6767
},
68-
"version": "0.2.7"
68+
"version": "0.2.6"
6969
}

src/rules/converters.ts

Lines changed: 44 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { convertClassName } from "./converters/class-name";
1212
import { convertCurly } from "./converters/curly";
1313
import { convertCyclomaticComplexity } from "./converters/cyclomatic-complexity";
1414
import { convertEofline } from "./converters/eofline";
15-
import { convertFileNameCasing } from "./converters/file-name-casing";
15+
import { convertMemberAccess } from "./converters/member-access";
1616
import { convertForin } from "./converters/forin";
1717
import { convertFunctionConstructor } from "./converters/function-constructor";
1818
import { convertIncrementDecrement } from "./converters/increment-decrement";
@@ -24,11 +24,9 @@ import { convertLinebreakStyle } from "./converters/linebreak-style";
2424
import { convertMaxClassesPerFile } from "./converters/max-classes-per-file";
2525
import { convertMaxFileLineCount } from "./converters/max-file-line-count";
2626
import { convertMaxLineLength } from "./converters/max-line-length";
27-
import { convertMemberAccess } from "./converters/member-access";
2827
import { convertMemberOrdering } from "./converters/member-ordering";
29-
import { convertNewParens } from "./converters/new-parens";
30-
import { convertNewlineBeforeReturn } from "./converters/newline-before-return";
3128
import { convertNewlinePerChainedCall } from "./converters/newline-per-chained-call";
29+
import { convertNewParens } from "./converters/new-parens";
3230
import { convertNoAngleBracketTypeAssertion } from "./converters/no-angle-bracket-type-assertion";
3331
import { convertNoArg } from "./converters/no-arg";
3432
import { convertNoAsyncWithoutAwait } from "./converters/no-async-without-await";
@@ -41,7 +39,6 @@ import { convertNoConstantCondition } from "./converters/no-constant-condition";
4139
import { convertNoConstruct } from "./converters/no-construct";
4240
import { convertNoControlRegex } from "./converters/no-control-regex";
4341
import { convertNoDebugger } from "./converters/no-debugger";
44-
import { convertNoDuplicateImports } from "./converters/no-duplicate-imports";
4542
import { convertNoDuplicateSuper } from "./converters/no-duplicate-super";
4643
import { convertNoDuplicateSwitchCase } from "./converters/no-duplicate-switch-case";
4744
import { convertNoEmpty } from "./converters/no-empty";
@@ -98,19 +95,19 @@ import { convertPreferObjectSpread } from "./converters/prefer-object-spread";
9895
import { convertPreferReadonly } from "./converters/prefer-readonly";
9996
import { convertPreferTemplate } from "./converters/prefer-template";
10097
import { convertPromiseFunctionAsync } from "./converters/promise-function-async";
101-
import { convertQuotemark } from "./converters/quotemark";
10298
import { convertRadix } from "./converters/radix";
10399
import { convertRestrictPlusOperands } from "./converters/restrict-plus-operands";
104100
import { convertSpaceBeforeFunctionParen } from "./converters/space-before-function-paren";
105101
import { convertSwitchDefault } from "./converters/switch-default";
106-
import { convertTripleEquals } from "./converters/triple-equals";
107-
import { convertTypeLiteralDelimiter } from "./converters/type-literal-delimiter";
108102
import { convertTypedefWhitespace } from "./converters/typedef-whitespace";
103+
import { convertTypeLiteralDelimiter } from "./converters/type-literal-delimiter";
109104
import { convertTypeofCompare } from "./converters/typeof-compare";
110105
import { convertUnifiedSignatures } from "./converters/unified-signatures";
111106
import { convertUnnecessaryBind } from "./converters/unnecessary-bind";
112107
import { convertUnnecessaryConstructor } from "./converters/unnecessary-constructor";
113108
import { convertUseIsnan } from "./converters/use-isnan";
109+
import { convertQuotemark } from "./converters/quotemark";
110+
import { convertTripleEquals } from "./converters/triple-equals";
114111

115112
/**
116113
* Keys TSLint rule names to their ESLint rule converters.
@@ -119,116 +116,113 @@ export const converters = new Map([
119116
["adjacent-overload-signatures", convertAdjacentOverloadSignatures],
120117
["array-type", convertArrayType],
121118
["arrow-parens", convertArrowParens],
122-
["arrow-return-shorthand", convertArrowReturnShorthand],
123119
["await-promise", convertAwaitPromise],
124120
["ban-comma-operator", convertBanCommaOperator],
125121
["ban-ts-ignore", convertBanTsIgnore],
126122
["ban-types", convertBanTypes],
127123
["binary-expression-operand-order", convertBinaryExpressionOperandOrder],
128124
["callable-types", convertCallableTypes],
129125
["class-name", convertClassName],
130-
["curly", convertCurly],
131-
["cyclomatic-complexity", convertCyclomaticComplexity],
132126
["eofline", convertEofline],
133-
["file-name-casing", convertFileNameCasing],
134127
["forin", convertForin],
135128
["function-constructor", convertFunctionConstructor],
136-
["increment-decrement", convertIncrementDecrement],
137129
["indent", convertIndent],
138130
["interface-name", convertInterfaceName],
139131
["interface-over-type-literal", convertInterfaceOverTypeLiteral],
140132
["label-position", convertLabelPosition],
141-
["linebreak-style", convertLinebreakStyle],
142-
["max-classes-per-file", convertMaxClassesPerFile],
143-
["max-file-line-count", convertMaxFileLineCount],
144-
["max-line-length", convertMaxLineLength],
145133
["member-access", convertMemberAccess],
146134
["member-ordering", convertMemberOrdering],
147135
["new-parens", convertNewParens],
148-
["newline-before-return", convertNewlineBeforeReturn],
149136
["newline-per-chained-call", convertNewlinePerChainedCall],
150137
["no-angle-bracket-type-assertion", convertNoAngleBracketTypeAssertion],
151138
["no-any", convertNoExplicitAny],
152139
["no-arg", convertNoArg],
153140
["no-async-without-await", convertNoAsyncWithoutAwait],
154-
["no-banned-terms", convertNoBannedTerms],
155141
["no-bitwise", convertNoBitwise],
156142
["no-conditional-assignment", convertNoConditionalAssignment],
157-
["no-consecutive-blank-lines", convertNoConsecutiveBlankLines],
158-
["no-console", convertNoConsole],
159-
["no-constant-condition", convertNoConstantCondition],
160143
["no-construct", convertNoConstruct],
161-
["no-control-regex", convertNoControlRegex],
162144
["no-debugger", convertNoDebugger],
163-
["no-duplicate-imports", convertNoDuplicateImports],
164145
["no-duplicate-super", convertNoDuplicateSuper],
165146
["no-duplicate-switch-case", convertNoDuplicateSwitchCase],
166147
["no-empty-interface", convertNoEmptyInterface],
167-
["no-empty", convertNoEmpty],
168148
["no-eval", convertNoEval],
169149
["no-floating-promises", convertNoFloatingPromises],
170-
["no-for-in-array", convertNoForInArray],
171150
["no-for-in", convertNoForIn],
151+
["no-for-in-array", convertNoForInArray],
172152
["no-inferrable-types", convertNoInferrableTypes],
173153
["no-internal-module", convertNoInternalModule],
174-
["no-invalid-regexp", convertNoInvalidRegexp],
175-
["no-invalid-template-strings", convertNoInvalidTemplateStrings],
176-
["no-invalid-this", convertNoInvalidThis],
177154
["no-irregular-whitespace", convertNoIrregularWhitespace],
178-
["no-magic-numbers", convertNoMagicNumbers],
179155
["no-misused-new", convertNoMisusedNew],
180-
["no-multiline-string", convertNoMultilineString],
181156
["no-namespace", convertNoNamespace],
182157
["no-non-null-assertion", convertNoNonNullAssertion],
183158
["no-object-literal-type-assertion", convertNoObjectLiteralTypeAssertion],
184-
["no-octal-literal", convertNoOctalLiteral],
185159
["no-parameter-properties", convertNoParameterProperties],
186160
["no-parameter-reassignment", convertNoParameterReassignment],
187161
["no-reference", convertNoReference],
188-
["no-regex-spaces", convertNoRegexSpaces],
189162
["no-require-imports", convertNoRequireImports],
190163
["no-return-await", convertNoReturnAwait],
191164
["no-sparse-arrays", convertNoSparseArrays],
192165
["no-string-literal", convertNoStringLiteral],
193166
["no-string-throw", convertNoStringThrow],
194167
["no-switch-case-fall-through", convertNoSwitchCaseFallThrough],
195-
["no-this-assignment", convertNoThisAssignment],
196168
["no-trailing-whitespace", convertNoTrailingWhitespace],
169+
["no-this-assignment", convertNoThisAssignment],
197170
["no-unbound-method", convertNoUnboundMethod],
198171
["no-unnecessary-class", convertNoUnnecessaryClass],
199172
["no-unnecessary-initializer", convertNoUnnecessaryInitializer],
200173
["no-unnecessary-qualifier", convertNoUnnecessaryQualifier],
201-
["no-unnecessary-semicolons", convertNoUnnecessarySemicolons],
202174
["no-unnecessary-type-assertion", convertNoUnnecessaryTypeAssertion],
203175
["no-unsafe-finally", convertNoUnsafeFinally],
204176
["no-use-before-declare", convertNoUseBeforeDeclare],
205177
["no-var-keyword", convertNoVarKeyword],
206178
["no-var-requires", convertNoVarRequires],
207179
["no-void-expression", convertNoVoidExpression],
208-
["object-literal-key-quotes", convertObjectLiteralKeyQuotes],
209-
["object-literal-shorthand", convertObjectLiteralShorthand],
210-
["one-variable-per-declaration", convertOneVariablePerDeclaration],
211-
["only-arrow-functions", convertOnlyArrowFunctions],
212-
["prefer-const", convertPreferConst],
213180
["prefer-for-of", convertPreferForOf],
214-
["prefer-function-over-method", convertPreferFunctionOverMethod],
215181
["prefer-object-spread", convertPreferObjectSpread],
216-
["prefer-readonly", convertPreferReadonly],
217-
["prefer-template", convertPreferTemplate],
218182
["promise-function-async", convertPromiseFunctionAsync],
219-
["quotemark", convertQuotemark],
220183
["radix", convertRadix],
221184
["restrict-plus-operands", convertRestrictPlusOperands],
222-
["space-before-function-paren", convertSpaceBeforeFunctionParen],
223-
["switch-default", convertSwitchDefault],
224-
["triple-equals", convertTripleEquals],
225185
["type-literal-delimiter", convertTypeLiteralDelimiter],
226186
["typedef-whitespace", convertTypedefWhitespace],
227187
["typeof-compare", convertTypeofCompare],
228188
["unified-signatures", convertUnifiedSignatures],
229189
["unnecessary-bind", convertUnnecessaryBind],
230190
["unnecessary-constructor", convertUnnecessaryConstructor],
231191
["use-isnan", convertUseIsnan],
192+
["arrow-return-shorthand", convertArrowReturnShorthand],
193+
["curly", convertCurly],
194+
["cyclomatic-complexity", convertCyclomaticComplexity],
195+
["increment-decrement", convertIncrementDecrement],
196+
["linebreak-style", convertLinebreakStyle],
197+
["max-classes-per-file", convertMaxClassesPerFile],
198+
["max-file-line-count", convertMaxFileLineCount],
199+
["max-line-length", convertMaxLineLength],
200+
["no-consecutive-blank-lines", convertNoConsecutiveBlankLines],
201+
["no-console", convertNoConsole],
202+
["no-empty", convertNoEmpty],
203+
["no-invalid-template-strings", convertNoInvalidTemplateStrings],
204+
["no-invalid-this", convertNoInvalidThis],
205+
["no-magic-numbers", convertNoMagicNumbers],
206+
["object-literal-key-quotes", convertObjectLiteralKeyQuotes],
207+
["object-literal-shorthand", convertObjectLiteralShorthand],
208+
["one-variable-per-declaration", convertOneVariablePerDeclaration],
209+
["only-arrow-functions", convertOnlyArrowFunctions],
210+
["prefer-const", convertPreferConst],
211+
["prefer-function-over-method", convertPreferFunctionOverMethod],
212+
["prefer-readonly", convertPreferReadonly],
213+
["prefer-template", convertPreferTemplate],
214+
["space-before-function-paren", convertSpaceBeforeFunctionParen],
215+
["switch-default", convertSwitchDefault],
216+
["no-banned-terms", convertNoBannedTerms],
217+
["no-constant-condition", convertNoConstantCondition],
218+
["no-control-regex", convertNoControlRegex],
219+
["no-multiline-string", convertNoMultilineString],
220+
["no-invalid-regexp", convertNoInvalidRegexp],
221+
["no-octal-literal", convertNoOctalLiteral],
222+
["no-regex-spaces", convertNoRegexSpaces],
223+
["no-unnecessary-semicolons", convertNoUnnecessarySemicolons],
224+
["quotemark", convertQuotemark],
225+
["triple-equals", convertTripleEquals],
232226

233227
// These converters are all for rules that need more complex option conversions.
234228
// Some of them will likely need to have notices about changed lint behaviors...
@@ -238,9 +232,12 @@ export const converters = new Map([
238232
// TSLint core rules:
239233
// ["ban", convertBan], // no-restricted-properties
240234
// ["import-blacklist", convertImportBlacklist], // no-restricted-imports
235+
// ["newline-before-return", convertNewlineBeforeReturn],
241236
// ["no-duplicate-variable", convertNoDuplicateVariable], // no-redeclare
242237
// ["no-shadowed-variable", convertNoShadowedVariable], // no-shadow
238+
// ["no-trailing-whitespace", convertNoTrailingWhitespace], // no-trailing-spaces
243239
// ["no-unused-expression", convertNoUnusedExpression], // no-unused-expressions
240+
// ["no-void-expression", convertNoVoidExpression], // (no exact equivalent)
244241
// ["space-within-parens", convertSpaceWithinParens], // space-in-parens
245242
// ["variable-name", convertVariableName], // a bunch of rules...
246243

src/rules/converters/file-name-casing.ts

Lines changed: 0 additions & 61 deletions
This file was deleted.

src/rules/converters/max-line-length.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ export const convertMaxLineLength: RuleConverter = tslintRule => {
1212
};
1313

1414
const collectArguments = (ruleArguments: any[]) => {
15-
if (ruleArguments.length === 0) {
15+
if (ruleArguments.length === 0 || ruleArguments[0] === false || ruleArguments.length < 2) {
1616
return undefined;
1717
}
1818

19-
const argument = ruleArguments[0];
20-
21-
if (typeof argument === "number") {
19+
if (ruleArguments.length === 2 && typeof ruleArguments[1] === "number") {
2220
return {
2321
ruleArguments: [
2422
{
25-
code: argument,
23+
code: ruleArguments[1],
2624
},
2725
],
2826
};
2927
}
3028

29+
const argument = ruleArguments[1];
30+
3131
return {
3232
ruleArguments: [
3333
{

src/rules/converters/newline-before-return.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/rules/converters/no-duplicate-imports.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)