From 3c212ac9d3cbf81ea4d38bf80e8f3e24397eb992 Mon Sep 17 00:00:00 2001 From: Afonso Ramos Date: Sat, 5 Oct 2019 14:07:36 +0100 Subject: [PATCH 1/2] use of no-empty-function --- .eslintrc.js | 2 +- src/rules/converters/no-empty.ts | 2 +- src/rules/converters/tests/no-empty.test.ts | 4 ++-- test/tests/custom eslint path/eslintrc.js | 2 +- test/tests/custom eslint path/expected.json | 2 +- test/tests/custom package path/eslintrc.js | 2 +- test/tests/custom typescript path/eslintrc.js | 2 +- test/tests/missing tslint.json/.eslintrc.json | 2 +- test/tests/missing tslint.json/expected.json | 2 +- test/tests/standalone tslint.json/.eslintrc.json | 2 +- test/tests/standalone tslint.json/eslintrc.js | 2 +- test/tests/standalone tslint.json/expected.json | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index a54c28b7f..0d268f342 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -23,6 +23,7 @@ module.exports = { "@typescript-eslint/generic-type-naming": 0, "@typescript-eslint/indent": 0, "@typescript-eslint/member-ordering": 0, + "@typescript-eslint/no-empty-function": 0, "@typescript-eslint/no-explicit-any": 0, "@typescript-eslint/no-extra-parens": 0, "@typescript-eslint/no-magic-numbers": 0, @@ -47,7 +48,6 @@ module.exports = { "import/prefer-default-export": 0, "no-console": 0, "no-continue": 0, - "no-empty-function": 0, "no-restricted-syntax": 0, "no-param-reassign": 0, "no-return-await": 0, diff --git a/src/rules/converters/no-empty.ts b/src/rules/converters/no-empty.ts index c72113595..e07186d96 100644 --- a/src/rules/converters/no-empty.ts +++ b/src/rules/converters/no-empty.ts @@ -25,7 +25,7 @@ const convertNoEmptyRule = (tslintRule: RuleConverterOptions) => { const convertNoEmptyFunctionRule = (tslintRule: RuleConverterOptions) => { return !tslintRule.ruleArguments.includes("allow-empty-functions") ? { - ruleName: "no-empty-functions", + ruleName: "@typescript-eslint/no-empty-function", } : undefined; }; diff --git a/src/rules/converters/tests/no-empty.test.ts b/src/rules/converters/tests/no-empty.test.ts index 776a0eb72..f1d8db89e 100644 --- a/src/rules/converters/tests/no-empty.test.ts +++ b/src/rules/converters/tests/no-empty.test.ts @@ -12,7 +12,7 @@ describe(convertNoEmpty, () => { ruleName: "no-empty", }, { - ruleName: "no-empty-functions", + ruleName: "@typescript-eslint/no-empty-function", }, ], }); @@ -30,7 +30,7 @@ describe(convertNoEmpty, () => { ruleName: "no-empty", }, { - ruleName: "no-empty-functions", + ruleName: "@typescript-eslint/no-empty-function", }, ], }); diff --git a/test/tests/custom eslint path/eslintrc.js b/test/tests/custom eslint path/eslintrc.js index 55fa0b346..17a2d449d 100644 --- a/test/tests/custom eslint path/eslintrc.js +++ b/test/tests/custom eslint path/eslintrc.js @@ -20,7 +20,7 @@ module.exports = { "linebreak-style": "off", "no-bitwise": "off", "no-empty": "off", - "no-empty-functions": "off", + "@typescript-eslint/no-empty-function": "off", "no-magic-numbers": "off", "prefer-template": "off", "@typescript-eslint/tslint/config": [ diff --git a/test/tests/custom eslint path/expected.json b/test/tests/custom eslint path/expected.json index 55fa0b346..17a2d449d 100644 --- a/test/tests/custom eslint path/expected.json +++ b/test/tests/custom eslint path/expected.json @@ -20,7 +20,7 @@ module.exports = { "linebreak-style": "off", "no-bitwise": "off", "no-empty": "off", - "no-empty-functions": "off", + "@typescript-eslint/no-empty-function": "off", "no-magic-numbers": "off", "prefer-template": "off", "@typescript-eslint/tslint/config": [ diff --git a/test/tests/custom package path/eslintrc.js b/test/tests/custom package path/eslintrc.js index 53d923238..cc968c6e0 100644 --- a/test/tests/custom package path/eslintrc.js +++ b/test/tests/custom package path/eslintrc.js @@ -28,7 +28,7 @@ module.exports = { "linebreak-style": "off", "no-bitwise": "off", "no-empty": "off", - "no-empty-functions": "off", + "@typescript-eslint/no-empty-function": "off", "no-magic-numbers": "off", "prefer-template": "off", "@typescript-eslint/tslint/config": [ diff --git a/test/tests/custom typescript path/eslintrc.js b/test/tests/custom typescript path/eslintrc.js index 3dde379e7..0644c4a06 100644 --- a/test/tests/custom typescript path/eslintrc.js +++ b/test/tests/custom typescript path/eslintrc.js @@ -27,7 +27,7 @@ module.exports = { "linebreak-style": "off", "no-bitwise": "off", "no-empty": "off", - "no-empty-functions": "off", + "@typescript-eslint/no-empty-function": "off", "no-magic-numbers": "off", "prefer-template": "off", "@typescript-eslint/tslint/config": [ diff --git a/test/tests/missing tslint.json/.eslintrc.json b/test/tests/missing tslint.json/.eslintrc.json index 9e8bc631d..23cea2fbf 100644 --- a/test/tests/missing tslint.json/.eslintrc.json +++ b/test/tests/missing tslint.json/.eslintrc.json @@ -27,7 +27,7 @@ "linebreak-style": "off", "no-bitwise": "off", "no-empty": "off", - "no-empty-functions": "off", + "@typescript-eslint/no-empty-function": "off", "no-magic-numbers": "off", "prefer-template": "off", "@typescript-eslint/tslint/config": [ diff --git a/test/tests/missing tslint.json/expected.json b/test/tests/missing tslint.json/expected.json index 9e8bc631d..23cea2fbf 100644 --- a/test/tests/missing tslint.json/expected.json +++ b/test/tests/missing tslint.json/expected.json @@ -27,7 +27,7 @@ "linebreak-style": "off", "no-bitwise": "off", "no-empty": "off", - "no-empty-functions": "off", + "@typescript-eslint/no-empty-function": "off", "no-magic-numbers": "off", "prefer-template": "off", "@typescript-eslint/tslint/config": [ diff --git a/test/tests/standalone tslint.json/.eslintrc.json b/test/tests/standalone tslint.json/.eslintrc.json index 9e8bc631d..23cea2fbf 100644 --- a/test/tests/standalone tslint.json/.eslintrc.json +++ b/test/tests/standalone tslint.json/.eslintrc.json @@ -27,7 +27,7 @@ "linebreak-style": "off", "no-bitwise": "off", "no-empty": "off", - "no-empty-functions": "off", + "@typescript-eslint/no-empty-function": "off", "no-magic-numbers": "off", "prefer-template": "off", "@typescript-eslint/tslint/config": [ diff --git a/test/tests/standalone tslint.json/eslintrc.js b/test/tests/standalone tslint.json/eslintrc.js index 53d923238..cc968c6e0 100644 --- a/test/tests/standalone tslint.json/eslintrc.js +++ b/test/tests/standalone tslint.json/eslintrc.js @@ -28,7 +28,7 @@ module.exports = { "linebreak-style": "off", "no-bitwise": "off", "no-empty": "off", - "no-empty-functions": "off", + "@typescript-eslint/no-empty-function": "off", "no-magic-numbers": "off", "prefer-template": "off", "@typescript-eslint/tslint/config": [ diff --git a/test/tests/standalone tslint.json/expected.json b/test/tests/standalone tslint.json/expected.json index 9e8bc631d..23cea2fbf 100644 --- a/test/tests/standalone tslint.json/expected.json +++ b/test/tests/standalone tslint.json/expected.json @@ -27,7 +27,7 @@ "linebreak-style": "off", "no-bitwise": "off", "no-empty": "off", - "no-empty-functions": "off", + "@typescript-eslint/no-empty-function": "off", "no-magic-numbers": "off", "prefer-template": "off", "@typescript-eslint/tslint/config": [ From a37b3391c31283321d822363e16ed70a1d197d62 Mon Sep 17 00:00:00 2001 From: Afonso Ramos Date: Sat, 5 Oct 2019 15:03:31 +0100 Subject: [PATCH 2/2] sorted by name --- test/tests/custom eslint path/eslintrc.js | 2 +- test/tests/custom eslint path/expected.json | 2 +- test/tests/custom package path/eslintrc.js | 2 +- test/tests/custom typescript path/eslintrc.js | 2 +- test/tests/missing tslint.json/.eslintrc.json | 4 ++-- test/tests/missing tslint.json/expected.json | 4 ++-- test/tests/standalone tslint.json/.eslintrc.json | 4 ++-- test/tests/standalone tslint.json/eslintrc.js | 2 +- test/tests/standalone tslint.json/expected.json | 4 ++-- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/test/tests/custom eslint path/eslintrc.js b/test/tests/custom eslint path/eslintrc.js index 17a2d449d..253b94bcc 100644 --- a/test/tests/custom eslint path/eslintrc.js +++ b/test/tests/custom eslint path/eslintrc.js @@ -9,6 +9,7 @@ module.exports = { "@typescript-eslint/array-type": "error", "@typescript-eslint/interface-name-prefix": "error", "@typescript-eslint/member-ordering": "off", + "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-param-reassign": "off", "@typescript-eslint/no-parameter-properties": "off", @@ -20,7 +21,6 @@ module.exports = { "linebreak-style": "off", "no-bitwise": "off", "no-empty": "off", - "@typescript-eslint/no-empty-function": "off", "no-magic-numbers": "off", "prefer-template": "off", "@typescript-eslint/tslint/config": [ diff --git a/test/tests/custom eslint path/expected.json b/test/tests/custom eslint path/expected.json index 17a2d449d..253b94bcc 100644 --- a/test/tests/custom eslint path/expected.json +++ b/test/tests/custom eslint path/expected.json @@ -9,6 +9,7 @@ module.exports = { "@typescript-eslint/array-type": "error", "@typescript-eslint/interface-name-prefix": "error", "@typescript-eslint/member-ordering": "off", + "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-param-reassign": "off", "@typescript-eslint/no-parameter-properties": "off", @@ -20,7 +21,6 @@ module.exports = { "linebreak-style": "off", "no-bitwise": "off", "no-empty": "off", - "@typescript-eslint/no-empty-function": "off", "no-magic-numbers": "off", "prefer-template": "off", "@typescript-eslint/tslint/config": [ diff --git a/test/tests/custom package path/eslintrc.js b/test/tests/custom package path/eslintrc.js index cc968c6e0..d556f9c5e 100644 --- a/test/tests/custom package path/eslintrc.js +++ b/test/tests/custom package path/eslintrc.js @@ -17,6 +17,7 @@ module.exports = { "@typescript-eslint/array-type": "error", "@typescript-eslint/interface-name-prefix": "error", "@typescript-eslint/member-ordering": "off", + "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-param-reassign": "off", "@typescript-eslint/no-parameter-properties": "off", @@ -28,7 +29,6 @@ module.exports = { "linebreak-style": "off", "no-bitwise": "off", "no-empty": "off", - "@typescript-eslint/no-empty-function": "off", "no-magic-numbers": "off", "prefer-template": "off", "@typescript-eslint/tslint/config": [ diff --git a/test/tests/custom typescript path/eslintrc.js b/test/tests/custom typescript path/eslintrc.js index 0644c4a06..f8d211300 100644 --- a/test/tests/custom typescript path/eslintrc.js +++ b/test/tests/custom typescript path/eslintrc.js @@ -16,6 +16,7 @@ module.exports = { "@typescript-eslint/array-type": "error", "@typescript-eslint/interface-name-prefix": "error", "@typescript-eslint/member-ordering": "off", + "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-param-reassign": "off", "@typescript-eslint/no-parameter-properties": "off", @@ -27,7 +28,6 @@ module.exports = { "linebreak-style": "off", "no-bitwise": "off", "no-empty": "off", - "@typescript-eslint/no-empty-function": "off", "no-magic-numbers": "off", "prefer-template": "off", "@typescript-eslint/tslint/config": [ diff --git a/test/tests/missing tslint.json/.eslintrc.json b/test/tests/missing tslint.json/.eslintrc.json index 23cea2fbf..79186a52c 100644 --- a/test/tests/missing tslint.json/.eslintrc.json +++ b/test/tests/missing tslint.json/.eslintrc.json @@ -16,6 +16,7 @@ "@typescript-eslint/array-type": "error", "@typescript-eslint/interface-name-prefix": "error", "@typescript-eslint/member-ordering": "off", + "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-param-reassign": "off", "@typescript-eslint/no-parameter-properties": "off", @@ -27,7 +28,6 @@ "linebreak-style": "off", "no-bitwise": "off", "no-empty": "off", - "@typescript-eslint/no-empty-function": "off", "no-magic-numbers": "off", "prefer-template": "off", "@typescript-eslint/tslint/config": [ @@ -47,4 +47,4 @@ } ] } -} +} \ No newline at end of file diff --git a/test/tests/missing tslint.json/expected.json b/test/tests/missing tslint.json/expected.json index 23cea2fbf..79186a52c 100644 --- a/test/tests/missing tslint.json/expected.json +++ b/test/tests/missing tslint.json/expected.json @@ -16,6 +16,7 @@ "@typescript-eslint/array-type": "error", "@typescript-eslint/interface-name-prefix": "error", "@typescript-eslint/member-ordering": "off", + "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-param-reassign": "off", "@typescript-eslint/no-parameter-properties": "off", @@ -27,7 +28,6 @@ "linebreak-style": "off", "no-bitwise": "off", "no-empty": "off", - "@typescript-eslint/no-empty-function": "off", "no-magic-numbers": "off", "prefer-template": "off", "@typescript-eslint/tslint/config": [ @@ -47,4 +47,4 @@ } ] } -} +} \ No newline at end of file diff --git a/test/tests/standalone tslint.json/.eslintrc.json b/test/tests/standalone tslint.json/.eslintrc.json index 23cea2fbf..79186a52c 100644 --- a/test/tests/standalone tslint.json/.eslintrc.json +++ b/test/tests/standalone tslint.json/.eslintrc.json @@ -16,6 +16,7 @@ "@typescript-eslint/array-type": "error", "@typescript-eslint/interface-name-prefix": "error", "@typescript-eslint/member-ordering": "off", + "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-param-reassign": "off", "@typescript-eslint/no-parameter-properties": "off", @@ -27,7 +28,6 @@ "linebreak-style": "off", "no-bitwise": "off", "no-empty": "off", - "@typescript-eslint/no-empty-function": "off", "no-magic-numbers": "off", "prefer-template": "off", "@typescript-eslint/tslint/config": [ @@ -47,4 +47,4 @@ } ] } -} +} \ No newline at end of file diff --git a/test/tests/standalone tslint.json/eslintrc.js b/test/tests/standalone tslint.json/eslintrc.js index cc968c6e0..d556f9c5e 100644 --- a/test/tests/standalone tslint.json/eslintrc.js +++ b/test/tests/standalone tslint.json/eslintrc.js @@ -17,6 +17,7 @@ module.exports = { "@typescript-eslint/array-type": "error", "@typescript-eslint/interface-name-prefix": "error", "@typescript-eslint/member-ordering": "off", + "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-param-reassign": "off", "@typescript-eslint/no-parameter-properties": "off", @@ -28,7 +29,6 @@ module.exports = { "linebreak-style": "off", "no-bitwise": "off", "no-empty": "off", - "@typescript-eslint/no-empty-function": "off", "no-magic-numbers": "off", "prefer-template": "off", "@typescript-eslint/tslint/config": [ diff --git a/test/tests/standalone tslint.json/expected.json b/test/tests/standalone tslint.json/expected.json index 23cea2fbf..79186a52c 100644 --- a/test/tests/standalone tslint.json/expected.json +++ b/test/tests/standalone tslint.json/expected.json @@ -16,6 +16,7 @@ "@typescript-eslint/array-type": "error", "@typescript-eslint/interface-name-prefix": "error", "@typescript-eslint/member-ordering": "off", + "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-param-reassign": "off", "@typescript-eslint/no-parameter-properties": "off", @@ -27,7 +28,6 @@ "linebreak-style": "off", "no-bitwise": "off", "no-empty": "off", - "@typescript-eslint/no-empty-function": "off", "no-magic-numbers": "off", "prefer-template": "off", "@typescript-eslint/tslint/config": [ @@ -47,4 +47,4 @@ } ] } -} +} \ No newline at end of file