From da1107e9a711f6b9f86dd32c01ffdd7930cf4a6e Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 7 Oct 2019 00:36:06 +0900 Subject: [PATCH 01/13] Reduced size of end-to-end test tslint.json rulesets --- test/tests/custom eslint path/eslintrc.js | 46 +------------------ test/tests/custom eslint path/expected.json | 46 +------------------ test/tests/custom eslint path/stdout.txt | 5 +- .../tslint-to-eslint-config.log | 2 - test/tests/custom eslint path/tslint.json | 30 +----------- test/tests/custom package path/eslintrc.js | 46 +------------------ test/tests/custom package path/stdout.txt | 5 +- .../tslint-to-eslint-config.log | 2 - test/tests/custom package path/tslint.json | 30 +----------- test/tests/custom typescript path/eslintrc.js | 46 +------------------ test/tests/custom typescript path/stdout.txt | 5 +- .../tslint-to-eslint-config.log | 2 - test/tests/custom typescript path/tslint.json | 30 +----------- test/tests/standalone tslint.json/eslintrc.js | 46 +------------------ test/tests/standalone tslint.json/stdout.txt | 5 +- .../tslint-to-eslint-config.log | 2 - test/tests/standalone tslint.json/tslint.json | 30 +----------- 17 files changed, 18 insertions(+), 360 deletions(-) diff --git a/test/tests/custom eslint path/eslintrc.js b/test/tests/custom eslint path/eslintrc.js index 67cd63656..a953e2376 100644 --- a/test/tests/custom eslint path/eslintrc.js +++ b/test/tests/custom eslint path/eslintrc.js @@ -7,48 +7,7 @@ module.exports = { "extends": [], "rules": { "@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", - "@typescript-eslint/no-use-before-declare": "off", - "@typescript-eslint/promise-function-async": "off", - "@typescript-eslint/unbound-method": "off", - "arrow-body-style": "off", - "default-case": "off", - "linebreak-style": "off", - "no-bitwise": "off", - "no-empty": "off", - "no-magic-numbers": "off", - "padding-line-between-statements": [ - "off", - "error", - { - "blankLine": "always", - "prev": "*", - "next": "return" - } - ], - "prefer-template": "off", - "unicorn/filename-case": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "no-implicit-dependencies": [ - true, - "dev" - ], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number" - ] - } - } - ] + "@typescript-eslint/no-floating-promises": "off" }, "globals": {}, "parser": "@typescript-eslint/parser", @@ -57,8 +16,7 @@ module.exports = { "sourceType": "module" }, "plugins": [ - "@typescript-eslint", - "@typescript-eslint/tslint" + "@typescript-eslint" ], "settings": { "import/resolver": { diff --git a/test/tests/custom eslint path/expected.json b/test/tests/custom eslint path/expected.json index 67cd63656..a953e2376 100644 --- a/test/tests/custom eslint path/expected.json +++ b/test/tests/custom eslint path/expected.json @@ -7,48 +7,7 @@ module.exports = { "extends": [], "rules": { "@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", - "@typescript-eslint/no-use-before-declare": "off", - "@typescript-eslint/promise-function-async": "off", - "@typescript-eslint/unbound-method": "off", - "arrow-body-style": "off", - "default-case": "off", - "linebreak-style": "off", - "no-bitwise": "off", - "no-empty": "off", - "no-magic-numbers": "off", - "padding-line-between-statements": [ - "off", - "error", - { - "blankLine": "always", - "prev": "*", - "next": "return" - } - ], - "prefer-template": "off", - "unicorn/filename-case": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "no-implicit-dependencies": [ - true, - "dev" - ], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number" - ] - } - } - ] + "@typescript-eslint/no-floating-promises": "off" }, "globals": {}, "parser": "@typescript-eslint/parser", @@ -57,8 +16,7 @@ module.exports = { "sourceType": "module" }, "plugins": [ - "@typescript-eslint", - "@typescript-eslint/tslint" + "@typescript-eslint" ], "settings": { "import/resolver": { diff --git a/test/tests/custom eslint path/stdout.txt b/test/tests/custom eslint path/stdout.txt index 5b5f91fc5..e472c978c 100644 --- a/test/tests/custom eslint path/stdout.txt +++ b/test/tests/custom eslint path/stdout.txt @@ -1,5 +1,2 @@ -✨ 19 rules replaced with their ESLint equivalents. ✨ -️👀 2 rules do not yet have ESLint equivalents; defaulting to eslint-plugin-tslint. 👀 -⚡ 1 package is required for new ESLint rules. ⚡ - unicorn +✨ 2 rules replaced with their ESLint equivalents. ✨ ✅ All is well! ✅ diff --git a/test/tests/custom eslint path/tslint-to-eslint-config.log b/test/tests/custom eslint path/tslint-to-eslint-config.log index f76acb2ca..e69de29bb 100644 --- a/test/tests/custom eslint path/tslint-to-eslint-config.log +++ b/test/tests/custom eslint path/tslint-to-eslint-config.log @@ -1,2 +0,0 @@ -no-implicit-dependencies does not yet have an ESLint equivalent. -strict-boolean-expressions does not yet have an ESLint equivalent. diff --git a/test/tests/custom eslint path/tslint.json b/test/tests/custom eslint path/tslint.json index 4a2aa47f4..f95fbee90 100644 --- a/test/tests/custom eslint path/tslint.json +++ b/test/tests/custom eslint path/tslint.json @@ -1,35 +1,7 @@ { "rules": { "array-type": [true, "array"], - "arrow-return-shorthand": false, - "completed-docs": false, - "comment-format": false, - "file-name-casing": false, - "linebreak-style": false, - "interface-name": [true, "never-prefix"], - "member-ordering": false, - "newline-before-return": false, - "no-any": false, - "no-bitwise": false, - "no-empty": false, - "no-magic-numbers": false, - "no-import-side-effect": false, - "no-implicit-dependencies": [true, "dev"], - "no-null-keyword": false, - "no-parameter-reassignment": false, - "no-parameter-properties": false, - "no-submodule-imports": false, - "no-unbound-method": false, - "no-unused-variable": false, - "no-use-before-declare": false, - "prefer-conditional-expression": false, - "prefer-method-signature": false, - "prefer-switch": false, - "prefer-template": false, - "promise-function-async": false, - "strict-boolean-expressions": [true, "allow-boolean-or-undefined", "allow-number"], - "switch-default": false, - "switch-final-break": false, + "no-floating-promises": false, "typedef": false } } diff --git a/test/tests/custom package path/eslintrc.js b/test/tests/custom package path/eslintrc.js index 04c4b5f7e..52f2f8c90 100644 --- a/test/tests/custom package path/eslintrc.js +++ b/test/tests/custom package path/eslintrc.js @@ -10,52 +10,10 @@ module.exports = { "sourceType": "module" }, "plugins": [ - "@typescript-eslint", - "@typescript-eslint/tslint" + "@typescript-eslint" ], "rules": { "@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", - "@typescript-eslint/no-use-before-declare": "off", - "@typescript-eslint/promise-function-async": "off", - "@typescript-eslint/unbound-method": "off", - "arrow-body-style": "off", - "default-case": "off", - "linebreak-style": "off", - "no-bitwise": "off", - "no-empty": "off", - "no-magic-numbers": "off", - "padding-line-between-statements": [ - "off", - "error", - { - "blankLine": "always", - "prev": "*", - "next": "return" - } - ], - "prefer-template": "off", - "unicorn/filename-case": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "no-implicit-dependencies": [ - true, - "dev" - ], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number" - ] - } - } - ] + "@typescript-eslint/no-floating-promises": "off" } }; diff --git a/test/tests/custom package path/stdout.txt b/test/tests/custom package path/stdout.txt index 5b5f91fc5..e472c978c 100644 --- a/test/tests/custom package path/stdout.txt +++ b/test/tests/custom package path/stdout.txt @@ -1,5 +1,2 @@ -✨ 19 rules replaced with their ESLint equivalents. ✨ -️👀 2 rules do not yet have ESLint equivalents; defaulting to eslint-plugin-tslint. 👀 -⚡ 1 package is required for new ESLint rules. ⚡ - unicorn +✨ 2 rules replaced with their ESLint equivalents. ✨ ✅ All is well! ✅ diff --git a/test/tests/custom package path/tslint-to-eslint-config.log b/test/tests/custom package path/tslint-to-eslint-config.log index f76acb2ca..e69de29bb 100644 --- a/test/tests/custom package path/tslint-to-eslint-config.log +++ b/test/tests/custom package path/tslint-to-eslint-config.log @@ -1,2 +0,0 @@ -no-implicit-dependencies does not yet have an ESLint equivalent. -strict-boolean-expressions does not yet have an ESLint equivalent. diff --git a/test/tests/custom package path/tslint.json b/test/tests/custom package path/tslint.json index 4a2aa47f4..f95fbee90 100644 --- a/test/tests/custom package path/tslint.json +++ b/test/tests/custom package path/tslint.json @@ -1,35 +1,7 @@ { "rules": { "array-type": [true, "array"], - "arrow-return-shorthand": false, - "completed-docs": false, - "comment-format": false, - "file-name-casing": false, - "linebreak-style": false, - "interface-name": [true, "never-prefix"], - "member-ordering": false, - "newline-before-return": false, - "no-any": false, - "no-bitwise": false, - "no-empty": false, - "no-magic-numbers": false, - "no-import-side-effect": false, - "no-implicit-dependencies": [true, "dev"], - "no-null-keyword": false, - "no-parameter-reassignment": false, - "no-parameter-properties": false, - "no-submodule-imports": false, - "no-unbound-method": false, - "no-unused-variable": false, - "no-use-before-declare": false, - "prefer-conditional-expression": false, - "prefer-method-signature": false, - "prefer-switch": false, - "prefer-template": false, - "promise-function-async": false, - "strict-boolean-expressions": [true, "allow-boolean-or-undefined", "allow-number"], - "switch-default": false, - "switch-final-break": false, + "no-floating-promises": false, "typedef": false } } diff --git a/test/tests/custom typescript path/eslintrc.js b/test/tests/custom typescript path/eslintrc.js index 1727af53d..ce5c90638 100644 --- a/test/tests/custom typescript path/eslintrc.js +++ b/test/tests/custom typescript path/eslintrc.js @@ -9,52 +9,10 @@ module.exports = { "sourceType": "module" }, "plugins": [ - "@typescript-eslint", - "@typescript-eslint/tslint" + "@typescript-eslint" ], "rules": { "@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", - "@typescript-eslint/no-use-before-declare": "off", - "@typescript-eslint/promise-function-async": "off", - "@typescript-eslint/unbound-method": "off", - "arrow-body-style": "off", - "default-case": "off", - "linebreak-style": "off", - "no-bitwise": "off", - "no-empty": "off", - "no-magic-numbers": "off", - "padding-line-between-statements": [ - "off", - "error", - { - "blankLine": "always", - "prev": "*", - "next": "return" - } - ], - "prefer-template": "off", - "unicorn/filename-case": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "no-implicit-dependencies": [ - true, - "dev" - ], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number" - ] - } - } - ] + "@typescript-eslint/no-floating-promises": "off" } }; diff --git a/test/tests/custom typescript path/stdout.txt b/test/tests/custom typescript path/stdout.txt index 5b5f91fc5..e472c978c 100644 --- a/test/tests/custom typescript path/stdout.txt +++ b/test/tests/custom typescript path/stdout.txt @@ -1,5 +1,2 @@ -✨ 19 rules replaced with their ESLint equivalents. ✨ -️👀 2 rules do not yet have ESLint equivalents; defaulting to eslint-plugin-tslint. 👀 -⚡ 1 package is required for new ESLint rules. ⚡ - unicorn +✨ 2 rules replaced with their ESLint equivalents. ✨ ✅ All is well! ✅ diff --git a/test/tests/custom typescript path/tslint-to-eslint-config.log b/test/tests/custom typescript path/tslint-to-eslint-config.log index f76acb2ca..e69de29bb 100644 --- a/test/tests/custom typescript path/tslint-to-eslint-config.log +++ b/test/tests/custom typescript path/tslint-to-eslint-config.log @@ -1,2 +0,0 @@ -no-implicit-dependencies does not yet have an ESLint equivalent. -strict-boolean-expressions does not yet have an ESLint equivalent. diff --git a/test/tests/custom typescript path/tslint.json b/test/tests/custom typescript path/tslint.json index 4a2aa47f4..f95fbee90 100644 --- a/test/tests/custom typescript path/tslint.json +++ b/test/tests/custom typescript path/tslint.json @@ -1,35 +1,7 @@ { "rules": { "array-type": [true, "array"], - "arrow-return-shorthand": false, - "completed-docs": false, - "comment-format": false, - "file-name-casing": false, - "linebreak-style": false, - "interface-name": [true, "never-prefix"], - "member-ordering": false, - "newline-before-return": false, - "no-any": false, - "no-bitwise": false, - "no-empty": false, - "no-magic-numbers": false, - "no-import-side-effect": false, - "no-implicit-dependencies": [true, "dev"], - "no-null-keyword": false, - "no-parameter-reassignment": false, - "no-parameter-properties": false, - "no-submodule-imports": false, - "no-unbound-method": false, - "no-unused-variable": false, - "no-use-before-declare": false, - "prefer-conditional-expression": false, - "prefer-method-signature": false, - "prefer-switch": false, - "prefer-template": false, - "promise-function-async": false, - "strict-boolean-expressions": [true, "allow-boolean-or-undefined", "allow-number"], - "switch-default": false, - "switch-final-break": false, + "no-floating-promises": false, "typedef": false } } diff --git a/test/tests/standalone tslint.json/eslintrc.js b/test/tests/standalone tslint.json/eslintrc.js index 04c4b5f7e..52f2f8c90 100644 --- a/test/tests/standalone tslint.json/eslintrc.js +++ b/test/tests/standalone tslint.json/eslintrc.js @@ -10,52 +10,10 @@ module.exports = { "sourceType": "module" }, "plugins": [ - "@typescript-eslint", - "@typescript-eslint/tslint" + "@typescript-eslint" ], "rules": { "@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", - "@typescript-eslint/no-use-before-declare": "off", - "@typescript-eslint/promise-function-async": "off", - "@typescript-eslint/unbound-method": "off", - "arrow-body-style": "off", - "default-case": "off", - "linebreak-style": "off", - "no-bitwise": "off", - "no-empty": "off", - "no-magic-numbers": "off", - "padding-line-between-statements": [ - "off", - "error", - { - "blankLine": "always", - "prev": "*", - "next": "return" - } - ], - "prefer-template": "off", - "unicorn/filename-case": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "no-implicit-dependencies": [ - true, - "dev" - ], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number" - ] - } - } - ] + "@typescript-eslint/no-floating-promises": "off" } }; diff --git a/test/tests/standalone tslint.json/stdout.txt b/test/tests/standalone tslint.json/stdout.txt index 5b5f91fc5..e472c978c 100644 --- a/test/tests/standalone tslint.json/stdout.txt +++ b/test/tests/standalone tslint.json/stdout.txt @@ -1,5 +1,2 @@ -✨ 19 rules replaced with their ESLint equivalents. ✨ -️👀 2 rules do not yet have ESLint equivalents; defaulting to eslint-plugin-tslint. 👀 -⚡ 1 package is required for new ESLint rules. ⚡ - unicorn +✨ 2 rules replaced with their ESLint equivalents. ✨ ✅ All is well! ✅ diff --git a/test/tests/standalone tslint.json/tslint-to-eslint-config.log b/test/tests/standalone tslint.json/tslint-to-eslint-config.log index f76acb2ca..e69de29bb 100644 --- a/test/tests/standalone tslint.json/tslint-to-eslint-config.log +++ b/test/tests/standalone tslint.json/tslint-to-eslint-config.log @@ -1,2 +0,0 @@ -no-implicit-dependencies does not yet have an ESLint equivalent. -strict-boolean-expressions does not yet have an ESLint equivalent. diff --git a/test/tests/standalone tslint.json/tslint.json b/test/tests/standalone tslint.json/tslint.json index 4a2aa47f4..f95fbee90 100644 --- a/test/tests/standalone tslint.json/tslint.json +++ b/test/tests/standalone tslint.json/tslint.json @@ -1,35 +1,7 @@ { "rules": { "array-type": [true, "array"], - "arrow-return-shorthand": false, - "completed-docs": false, - "comment-format": false, - "file-name-casing": false, - "linebreak-style": false, - "interface-name": [true, "never-prefix"], - "member-ordering": false, - "newline-before-return": false, - "no-any": false, - "no-bitwise": false, - "no-empty": false, - "no-magic-numbers": false, - "no-import-side-effect": false, - "no-implicit-dependencies": [true, "dev"], - "no-null-keyword": false, - "no-parameter-reassignment": false, - "no-parameter-properties": false, - "no-submodule-imports": false, - "no-unbound-method": false, - "no-unused-variable": false, - "no-use-before-declare": false, - "prefer-conditional-expression": false, - "prefer-method-signature": false, - "prefer-switch": false, - "prefer-template": false, - "promise-function-async": false, - "strict-boolean-expressions": [true, "allow-boolean-or-undefined", "allow-number"], - "switch-default": false, - "switch-final-break": false, + "no-floating-promises": false, "typedef": false } } From 93dbe6844f2d65916eb771427e63c3c3617679b0 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 7 Oct 2019 00:37:47 +0900 Subject: [PATCH 02/13] Wait I wanted to enable no-floating-promises --- test/tests/custom eslint path/eslintrc.js | 2 +- test/tests/custom eslint path/expected.json | 2 +- test/tests/custom eslint path/tslint.json | 2 +- test/tests/custom package path/eslintrc.js | 2 +- test/tests/custom package path/tslint.json | 2 +- test/tests/custom typescript path/eslintrc.js | 2 +- test/tests/custom typescript path/tslint.json | 2 +- test/tests/standalone tslint.json/eslintrc.js | 2 +- test/tests/standalone tslint.json/tslint.json | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/tests/custom eslint path/eslintrc.js b/test/tests/custom eslint path/eslintrc.js index a953e2376..8a5bc1df3 100644 --- a/test/tests/custom eslint path/eslintrc.js +++ b/test/tests/custom eslint path/eslintrc.js @@ -7,7 +7,7 @@ module.exports = { "extends": [], "rules": { "@typescript-eslint/array-type": "error", - "@typescript-eslint/no-floating-promises": "off" + "@typescript-eslint/no-floating-promises": "error" }, "globals": {}, "parser": "@typescript-eslint/parser", diff --git a/test/tests/custom eslint path/expected.json b/test/tests/custom eslint path/expected.json index a953e2376..8a5bc1df3 100644 --- a/test/tests/custom eslint path/expected.json +++ b/test/tests/custom eslint path/expected.json @@ -7,7 +7,7 @@ module.exports = { "extends": [], "rules": { "@typescript-eslint/array-type": "error", - "@typescript-eslint/no-floating-promises": "off" + "@typescript-eslint/no-floating-promises": "error" }, "globals": {}, "parser": "@typescript-eslint/parser", diff --git a/test/tests/custom eslint path/tslint.json b/test/tests/custom eslint path/tslint.json index f95fbee90..6cc0aa010 100644 --- a/test/tests/custom eslint path/tslint.json +++ b/test/tests/custom eslint path/tslint.json @@ -1,7 +1,7 @@ { "rules": { "array-type": [true, "array"], - "no-floating-promises": false, + "no-floating-promises": true, "typedef": false } } diff --git a/test/tests/custom package path/eslintrc.js b/test/tests/custom package path/eslintrc.js index 52f2f8c90..8d4f44d71 100644 --- a/test/tests/custom package path/eslintrc.js +++ b/test/tests/custom package path/eslintrc.js @@ -14,6 +14,6 @@ module.exports = { ], "rules": { "@typescript-eslint/array-type": "error", - "@typescript-eslint/no-floating-promises": "off" + "@typescript-eslint/no-floating-promises": "error" } }; diff --git a/test/tests/custom package path/tslint.json b/test/tests/custom package path/tslint.json index f95fbee90..6cc0aa010 100644 --- a/test/tests/custom package path/tslint.json +++ b/test/tests/custom package path/tslint.json @@ -1,7 +1,7 @@ { "rules": { "array-type": [true, "array"], - "no-floating-promises": false, + "no-floating-promises": true, "typedef": false } } diff --git a/test/tests/custom typescript path/eslintrc.js b/test/tests/custom typescript path/eslintrc.js index ce5c90638..359348ab8 100644 --- a/test/tests/custom typescript path/eslintrc.js +++ b/test/tests/custom typescript path/eslintrc.js @@ -13,6 +13,6 @@ module.exports = { ], "rules": { "@typescript-eslint/array-type": "error", - "@typescript-eslint/no-floating-promises": "off" + "@typescript-eslint/no-floating-promises": "error" } }; diff --git a/test/tests/custom typescript path/tslint.json b/test/tests/custom typescript path/tslint.json index f95fbee90..6cc0aa010 100644 --- a/test/tests/custom typescript path/tslint.json +++ b/test/tests/custom typescript path/tslint.json @@ -1,7 +1,7 @@ { "rules": { "array-type": [true, "array"], - "no-floating-promises": false, + "no-floating-promises": true, "typedef": false } } diff --git a/test/tests/standalone tslint.json/eslintrc.js b/test/tests/standalone tslint.json/eslintrc.js index 52f2f8c90..8d4f44d71 100644 --- a/test/tests/standalone tslint.json/eslintrc.js +++ b/test/tests/standalone tslint.json/eslintrc.js @@ -14,6 +14,6 @@ module.exports = { ], "rules": { "@typescript-eslint/array-type": "error", - "@typescript-eslint/no-floating-promises": "off" + "@typescript-eslint/no-floating-promises": "error" } }; diff --git a/test/tests/standalone tslint.json/tslint.json b/test/tests/standalone tslint.json/tslint.json index f95fbee90..6cc0aa010 100644 --- a/test/tests/standalone tslint.json/tslint.json +++ b/test/tests/standalone tslint.json/tslint.json @@ -1,7 +1,7 @@ { "rules": { "array-type": [true, "array"], - "no-floating-promises": false, + "no-floating-promises": true, "typedef": false } } From de61fced9fbc4c42e4c7e6e5d203ba19eb5fde81 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 6 Oct 2019 17:35:30 -0400 Subject: [PATCH 03/13] Added 'rule notices' and 'unknown rule' tests --- test/tests/rule notices/eslintrc.js | 45 +++++++++++++++++ test/tests/rule notices/expected.json | 45 +++++++++++++++++ test/tests/rule notices/stderr.txt | 0 test/tests/rule notices/stdout.txt | 5 ++ test/tests/rule notices/test.ts | 8 +++ .../rule notices/tslint-to-eslint-config.log | 0 test/tests/rule notices/tslint.json | 6 +++ test/tests/unknown rule/eslintrc.js | 49 +++++++++++++++++++ test/tests/unknown rule/expected.json | 49 +++++++++++++++++++ test/tests/unknown rule/stderr.txt | 0 test/tests/unknown rule/stdout.txt | 2 + test/tests/unknown rule/test.ts | 8 +++ .../unknown rule/tslint-to-eslint-config.log | 1 + test/tests/unknown rule/tslint.json | 5 ++ 14 files changed, 223 insertions(+) create mode 100644 test/tests/rule notices/eslintrc.js create mode 100644 test/tests/rule notices/expected.json create mode 100644 test/tests/rule notices/stderr.txt create mode 100644 test/tests/rule notices/stdout.txt create mode 100644 test/tests/rule notices/test.ts create mode 100644 test/tests/rule notices/tslint-to-eslint-config.log create mode 100644 test/tests/rule notices/tslint.json create mode 100644 test/tests/unknown rule/eslintrc.js create mode 100644 test/tests/unknown rule/expected.json create mode 100644 test/tests/unknown rule/stderr.txt create mode 100644 test/tests/unknown rule/stdout.txt create mode 100644 test/tests/unknown rule/test.ts create mode 100644 test/tests/unknown rule/tslint-to-eslint-config.log create mode 100644 test/tests/unknown rule/tslint.json diff --git a/test/tests/rule notices/eslintrc.js b/test/tests/rule notices/eslintrc.js new file mode 100644 index 000000000..7c1780dcb --- /dev/null +++ b/test/tests/rule notices/eslintrc.js @@ -0,0 +1,45 @@ +module.exports = { + "env": { + "browser": true, + "es6": true, + "node": true + }, + "extends": [], + "rules": { + "max-classes-per-file": [ + "error", + "exclude-class-expressions" + ], + "no-caller": "error" + }, + "globals": {}, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ], + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".mjs", + ".js", + ".json" + ] + } + }, + "import/extensions": [ + ".js", + ".mjs", + ".jsx" + ], + "import/core-modules": [], + "import/ignore": [ + "node_modules", + "\\.(coffee|scss|css|less|hbs|svg|json)$" + ] + } +}; diff --git a/test/tests/rule notices/expected.json b/test/tests/rule notices/expected.json new file mode 100644 index 000000000..7c1780dcb --- /dev/null +++ b/test/tests/rule notices/expected.json @@ -0,0 +1,45 @@ +module.exports = { + "env": { + "browser": true, + "es6": true, + "node": true + }, + "extends": [], + "rules": { + "max-classes-per-file": [ + "error", + "exclude-class-expressions" + ], + "no-caller": "error" + }, + "globals": {}, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ], + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".mjs", + ".js", + ".json" + ] + } + }, + "import/extensions": [ + ".js", + ".mjs", + ".jsx" + ], + "import/core-modules": [], + "import/ignore": [ + "node_modules", + "\\.(coffee|scss|css|less|hbs|svg|json)$" + ] + } +}; diff --git a/test/tests/rule notices/stderr.txt b/test/tests/rule notices/stderr.txt new file mode 100644 index 000000000..e69de29bb diff --git a/test/tests/rule notices/stdout.txt b/test/tests/rule notices/stdout.txt new file mode 100644 index 000000000..9772882e0 --- /dev/null +++ b/test/tests/rule notices/stdout.txt @@ -0,0 +1,5 @@ +✨ 2 rules replaced with their ESLint equivalents. ✨ +📢 1 ESLint rule behaves differently from their TSLint counterparts: 📢 +* max-classes-per-file: + - Class expressions will no longer be ignored. +✅ All is well! ✅ diff --git a/test/tests/rule notices/test.ts b/test/tests/rule notices/test.ts new file mode 100644 index 000000000..31c11e9b1 --- /dev/null +++ b/test/tests/rule notices/test.ts @@ -0,0 +1,8 @@ +import { createTests } from "../../createTests"; + +const eslint = "./eslintrc.js"; + +createTests(__dirname, { + eslint, + extraArgs: ["--eslint", eslint], +}); \ No newline at end of file diff --git a/test/tests/rule notices/tslint-to-eslint-config.log b/test/tests/rule notices/tslint-to-eslint-config.log new file mode 100644 index 000000000..e69de29bb diff --git a/test/tests/rule notices/tslint.json b/test/tests/rule notices/tslint.json new file mode 100644 index 000000000..945857242 --- /dev/null +++ b/test/tests/rule notices/tslint.json @@ -0,0 +1,6 @@ +{ + "rules": { + "max-classes-per-file": [true, "exclude-class-expressions"], + "no-arg": true + } +} diff --git a/test/tests/unknown rule/eslintrc.js b/test/tests/unknown rule/eslintrc.js new file mode 100644 index 000000000..224719ced --- /dev/null +++ b/test/tests/unknown rule/eslintrc.js @@ -0,0 +1,49 @@ +module.exports = { + "env": { + "browser": true, + "es6": true, + "node": true + }, + "extends": [], + "rules": { + "@typescript-eslint/tslint/config": [ + "error", + { + "rules": { + "this-definitely-does-not-exist": true + } + } + ] + }, + "globals": {}, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint", + "@typescript-eslint/tslint" + ], + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".mjs", + ".js", + ".json" + ] + } + }, + "import/extensions": [ + ".js", + ".mjs", + ".jsx" + ], + "import/core-modules": [], + "import/ignore": [ + "node_modules", + "\\.(coffee|scss|css|less|hbs|svg|json)$" + ] + } +}; diff --git a/test/tests/unknown rule/expected.json b/test/tests/unknown rule/expected.json new file mode 100644 index 000000000..224719ced --- /dev/null +++ b/test/tests/unknown rule/expected.json @@ -0,0 +1,49 @@ +module.exports = { + "env": { + "browser": true, + "es6": true, + "node": true + }, + "extends": [], + "rules": { + "@typescript-eslint/tslint/config": [ + "error", + { + "rules": { + "this-definitely-does-not-exist": true + } + } + ] + }, + "globals": {}, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint", + "@typescript-eslint/tslint" + ], + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".mjs", + ".js", + ".json" + ] + } + }, + "import/extensions": [ + ".js", + ".mjs", + ".jsx" + ], + "import/core-modules": [], + "import/ignore": [ + "node_modules", + "\\.(coffee|scss|css|less|hbs|svg|json)$" + ] + } +}; diff --git a/test/tests/unknown rule/stderr.txt b/test/tests/unknown rule/stderr.txt new file mode 100644 index 000000000..e69de29bb diff --git a/test/tests/unknown rule/stdout.txt b/test/tests/unknown rule/stdout.txt new file mode 100644 index 000000000..0827cf75e --- /dev/null +++ b/test/tests/unknown rule/stdout.txt @@ -0,0 +1,2 @@ +️👀 1 rule does not yet have an ESLint equivalent; defaulting to eslint-plugin-tslint. 👀 +✅ All is well! ✅ diff --git a/test/tests/unknown rule/test.ts b/test/tests/unknown rule/test.ts new file mode 100644 index 000000000..31c11e9b1 --- /dev/null +++ b/test/tests/unknown rule/test.ts @@ -0,0 +1,8 @@ +import { createTests } from "../../createTests"; + +const eslint = "./eslintrc.js"; + +createTests(__dirname, { + eslint, + extraArgs: ["--eslint", eslint], +}); \ No newline at end of file diff --git a/test/tests/unknown rule/tslint-to-eslint-config.log b/test/tests/unknown rule/tslint-to-eslint-config.log new file mode 100644 index 000000000..c7eff6b6b --- /dev/null +++ b/test/tests/unknown rule/tslint-to-eslint-config.log @@ -0,0 +1 @@ +this-definitely-does-not-exist does not yet have an ESLint equivalent. diff --git a/test/tests/unknown rule/tslint.json b/test/tests/unknown rule/tslint.json new file mode 100644 index 000000000..e88c90f1a --- /dev/null +++ b/test/tests/unknown rule/tslint.json @@ -0,0 +1,5 @@ +{ + "rules": { + "this-definitely-does-not-exist": true + } +} From 764498dcdab42dc4c41b564f7a659a3af1832195 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 6 Oct 2019 17:39:48 -0400 Subject: [PATCH 04/13] Removed unnecessary new test options --- test/tests/rule notices/test.ts | 7 +------ test/tests/unknown rule/test.ts | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/test/tests/rule notices/test.ts b/test/tests/rule notices/test.ts index 31c11e9b1..1749a97ae 100644 --- a/test/tests/rule notices/test.ts +++ b/test/tests/rule notices/test.ts @@ -1,8 +1,3 @@ import { createTests } from "../../createTests"; -const eslint = "./eslintrc.js"; - -createTests(__dirname, { - eslint, - extraArgs: ["--eslint", eslint], -}); \ No newline at end of file +createTests(__dirname); \ No newline at end of file diff --git a/test/tests/unknown rule/test.ts b/test/tests/unknown rule/test.ts index 31c11e9b1..1749a97ae 100644 --- a/test/tests/unknown rule/test.ts +++ b/test/tests/unknown rule/test.ts @@ -1,8 +1,3 @@ import { createTests } from "../../createTests"; -const eslint = "./eslintrc.js"; - -createTests(__dirname, { - eslint, - extraArgs: ["--eslint", eslint], -}); \ No newline at end of file +createTests(__dirname); \ No newline at end of file From 1155cd6eb141b5d8bd090f17bdc3decf6fcf36f1 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 6 Oct 2019 17:44:29 -0400 Subject: [PATCH 05/13] Whoops, needed to update eslint config names too --- test/tests/rule notices/.eslintrc.json | 45 ++++++++++++++++++++++++++ test/tests/rule notices/eslintrc.js | 33 +++---------------- test/tests/unknown rule/.eslintrc.json | 45 ++++++++++++++++++++++++++ test/tests/unknown rule/eslintrc.js | 37 ++++----------------- test/tests/unknown rule/expected.json | 14 +++----- 5 files changed, 107 insertions(+), 67 deletions(-) create mode 100644 test/tests/rule notices/.eslintrc.json create mode 100644 test/tests/unknown rule/.eslintrc.json diff --git a/test/tests/rule notices/.eslintrc.json b/test/tests/rule notices/.eslintrc.json new file mode 100644 index 000000000..7c1780dcb --- /dev/null +++ b/test/tests/rule notices/.eslintrc.json @@ -0,0 +1,45 @@ +module.exports = { + "env": { + "browser": true, + "es6": true, + "node": true + }, + "extends": [], + "rules": { + "max-classes-per-file": [ + "error", + "exclude-class-expressions" + ], + "no-caller": "error" + }, + "globals": {}, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ], + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".mjs", + ".js", + ".json" + ] + } + }, + "import/extensions": [ + ".js", + ".mjs", + ".jsx" + ], + "import/core-modules": [], + "import/ignore": [ + "node_modules", + "\\.(coffee|scss|css|less|hbs|svg|json)$" + ] + } +}; diff --git a/test/tests/rule notices/eslintrc.js b/test/tests/rule notices/eslintrc.js index 7c1780dcb..19c2be0ed 100644 --- a/test/tests/rule notices/eslintrc.js +++ b/test/tests/rule notices/eslintrc.js @@ -4,15 +4,6 @@ module.exports = { "es6": true, "node": true }, - "extends": [], - "rules": { - "max-classes-per-file": [ - "error", - "exclude-class-expressions" - ], - "no-caller": "error" - }, - "globals": {}, "parser": "@typescript-eslint/parser", "parserOptions": { "project": "tsconfig.json", @@ -21,25 +12,11 @@ module.exports = { "plugins": [ "@typescript-eslint" ], - "settings": { - "import/resolver": { - "node": { - "extensions": [ - ".mjs", - ".js", - ".json" - ] - } - }, - "import/extensions": [ - ".js", - ".mjs", - ".jsx" + "rules": { + "max-classes-per-file": [ + "error", + "exclude-class-expressions" ], - "import/core-modules": [], - "import/ignore": [ - "node_modules", - "\\.(coffee|scss|css|less|hbs|svg|json)$" - ] + "no-caller": "error" } }; diff --git a/test/tests/unknown rule/.eslintrc.json b/test/tests/unknown rule/.eslintrc.json new file mode 100644 index 000000000..7c1780dcb --- /dev/null +++ b/test/tests/unknown rule/.eslintrc.json @@ -0,0 +1,45 @@ +module.exports = { + "env": { + "browser": true, + "es6": true, + "node": true + }, + "extends": [], + "rules": { + "max-classes-per-file": [ + "error", + "exclude-class-expressions" + ], + "no-caller": "error" + }, + "globals": {}, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ], + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".mjs", + ".js", + ".json" + ] + } + }, + "import/extensions": [ + ".js", + ".mjs", + ".jsx" + ], + "import/core-modules": [], + "import/ignore": [ + "node_modules", + "\\.(coffee|scss|css|less|hbs|svg|json)$" + ] + } +}; diff --git a/test/tests/unknown rule/eslintrc.js b/test/tests/unknown rule/eslintrc.js index 224719ced..3b1477b49 100644 --- a/test/tests/unknown rule/eslintrc.js +++ b/test/tests/unknown rule/eslintrc.js @@ -4,18 +4,6 @@ module.exports = { "es6": true, "node": true }, - "extends": [], - "rules": { - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "this-definitely-does-not-exist": true - } - } - ] - }, - "globals": {}, "parser": "@typescript-eslint/parser", "parserOptions": { "project": "tsconfig.json", @@ -25,25 +13,14 @@ module.exports = { "@typescript-eslint", "@typescript-eslint/tslint" ], - "settings": { - "import/resolver": { - "node": { - "extensions": [ - ".mjs", - ".js", - ".json" - ] + "rules": { + "@typescript-eslint/tslint/config": [ + "error", + { + "rules": { + "this-definitely-does-not-exist": true + } } - }, - "import/extensions": [ - ".js", - ".mjs", - ".jsx" - ], - "import/core-modules": [], - "import/ignore": [ - "node_modules", - "\\.(coffee|scss|css|less|hbs|svg|json)$" ] } }; diff --git a/test/tests/unknown rule/expected.json b/test/tests/unknown rule/expected.json index 224719ced..7c1780dcb 100644 --- a/test/tests/unknown rule/expected.json +++ b/test/tests/unknown rule/expected.json @@ -6,14 +6,11 @@ module.exports = { }, "extends": [], "rules": { - "@typescript-eslint/tslint/config": [ + "max-classes-per-file": [ "error", - { - "rules": { - "this-definitely-does-not-exist": true - } - } - ] + "exclude-class-expressions" + ], + "no-caller": "error" }, "globals": {}, "parser": "@typescript-eslint/parser", @@ -22,8 +19,7 @@ module.exports = { "sourceType": "module" }, "plugins": [ - "@typescript-eslint", - "@typescript-eslint/tslint" + "@typescript-eslint" ], "settings": { "import/resolver": { From 1e97c3f2cc82b0233a49223d34c284cce1ca8a6b Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 6 Oct 2019 18:00:28 -0400 Subject: [PATCH 06/13] Normalized file paths and content per .eslintrc.js update --- docs/Testing.md | 4 +- test/createTests.ts | 4 +- .../{expected.json => expected.txt} | 0 test/tests/custom package path/.eslintrc.js | 1 + test/tests/custom package path/.eslintrc.json | 31 --------- test/tests/custom package path/eslintrc.js | 29 ++++++++- test/tests/custom package path/expected.json | 31 --------- test/tests/custom package path/expected.txt | 1 + .../tests/custom typescript path/.eslintrc.js | 1 + .../custom typescript path/.eslintrc.json | 31 --------- test/tests/custom typescript path/eslintrc.js | 29 ++++++++- .../custom typescript path/expected.json | 31 --------- .../tests/custom typescript path/expected.txt | 1 + test/tests/missing tslint.json/.eslintrc.js | 1 + test/tests/missing tslint.json/.eslintrc.json | 50 -------------- test/tests/missing tslint.json/expected.txt | 1 + test/tests/rule notices/.eslintrc.js | 2 + test/tests/rule notices/.eslintrc.json | 45 ------------- test/tests/rule notices/eslintrc.js | 33 ++++++++-- test/tests/rule notices/expected.txt | 2 + .../tests/standalone tslint.json/.eslintrc.js | 1 + .../standalone tslint.json/.eslintrc.json | 50 -------------- test/tests/standalone tslint.json/eslintrc.js | 65 ------------------- .../tests/standalone tslint.json/expected.txt | 1 + test/tests/unknown rule/.eslintrc.js | 1 + test/tests/unknown rule/.eslintrc.json | 45 ------------- test/tests/unknown rule/eslintrc.js | 37 +++++++++-- test/tests/unknown rule/expected.txt | 1 + 28 files changed, 128 insertions(+), 401 deletions(-) rename test/tests/custom eslint path/{expected.json => expected.txt} (100%) create mode 100644 test/tests/custom package path/.eslintrc.js delete mode 100644 test/tests/custom package path/.eslintrc.json delete mode 100644 test/tests/custom package path/expected.json create mode 100644 test/tests/custom package path/expected.txt create mode 100644 test/tests/custom typescript path/.eslintrc.js delete mode 100644 test/tests/custom typescript path/.eslintrc.json delete mode 100644 test/tests/custom typescript path/expected.json create mode 100644 test/tests/custom typescript path/expected.txt create mode 100644 test/tests/missing tslint.json/.eslintrc.js delete mode 100644 test/tests/missing tslint.json/.eslintrc.json create mode 100644 test/tests/missing tslint.json/expected.txt create mode 100644 test/tests/rule notices/.eslintrc.js delete mode 100644 test/tests/rule notices/.eslintrc.json create mode 100644 test/tests/rule notices/expected.txt create mode 100644 test/tests/standalone tslint.json/.eslintrc.js delete mode 100644 test/tests/standalone tslint.json/.eslintrc.json delete mode 100644 test/tests/standalone tslint.json/eslintrc.js create mode 100644 test/tests/standalone tslint.json/expected.txt create mode 100644 test/tests/unknown rule/.eslintrc.js delete mode 100644 test/tests/unknown rule/.eslintrc.json create mode 100644 test/tests/unknown rule/expected.txt diff --git a/docs/Testing.md b/docs/Testing.md index b75bd5fa6..2afdb86b2 100644 --- a/docs/Testing.md +++ b/docs/Testing.md @@ -32,8 +32,8 @@ End-to-end tests that execute the `bin/tslint-to-eslint` command and validate ou Each directory there contains: - `test.ts`: Test file that runs `createTests(__dirname);` to set up tests in that directory -- `.eslintrc.json`: `.gitignore`d output from the most recent test run -- `expected.json`: Expected output ESLint configuration +- `.eslintrc.js`: `.gitignore`d output from the most recent test run +- `expected.txt`: Expected output ESLint configuration - `stderr.txt`: Expected output written to the process `stderr` - `stdout.txt`: Expected output written to the process `stdout` - `tslint.json`: Original TSLint configuration file to convert diff --git a/test/createTests.ts b/test/createTests.ts index 8fa598c31..114b358d1 100644 --- a/test/createTests.ts +++ b/test/createTests.ts @@ -27,7 +27,7 @@ const binFile = path.join(__dirname, "../bin/tslint-to-eslint-config"); export const createTests = ( cwd: string, - { eslint = "./.eslintrc.json", extraArgs = [] }: TestSettings = {}, + { eslint = "./.eslintrc.js", extraArgs = [] }: TestSettings = {}, ) => { const testName = path.basename(cwd); const accept = "acceptTestChanges" in globalThis; @@ -52,7 +52,7 @@ export const createTests = ( // Act await act(testArgs); - await assertFileContents(cwdPath("expected.json"), await readTestFile(eslint), accept); + await assertFileContents(cwdPath("expected.txt"), await readTestFile(eslint), accept); }); test("stderr", async () => { diff --git a/test/tests/custom eslint path/expected.json b/test/tests/custom eslint path/expected.txt similarity index 100% rename from test/tests/custom eslint path/expected.json rename to test/tests/custom eslint path/expected.txt diff --git a/test/tests/custom package path/.eslintrc.js b/test/tests/custom package path/.eslintrc.js new file mode 100644 index 000000000..f053ebf79 --- /dev/null +++ b/test/tests/custom package path/.eslintrc.js @@ -0,0 +1 @@ +module.exports = {}; diff --git a/test/tests/custom package path/.eslintrc.json b/test/tests/custom package path/.eslintrc.json deleted file mode 100644 index 06585f8f1..000000000 --- a/test/tests/custom package path/.eslintrc.json +++ /dev/null @@ -1,31 +0,0 @@ -module.exports = { - env: { - es6: true, - node: true, - }, - parser: "@typescript-eslint/parser", - parserOptions: { - project: "tsconfig.json", - sourceType: "module", - }, - plugins: ["@typescript-eslint", "@typescript-eslint/tslint"], - rules: { - "@typescript-eslint/array-type": "error", - "@typescript-eslint/interface-name-prefix": "error", - "no-magic-numbers": "off", - "prefer-template": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - rules: { - "no-implicit-dependencies": [true, "dev"], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number", - ], - }, - }, - ], - }, -}; diff --git a/test/tests/custom package path/eslintrc.js b/test/tests/custom package path/eslintrc.js index 8d4f44d71..8a5bc1df3 100644 --- a/test/tests/custom package path/eslintrc.js +++ b/test/tests/custom package path/eslintrc.js @@ -4,6 +4,12 @@ module.exports = { "es6": true, "node": true }, + "extends": [], + "rules": { + "@typescript-eslint/array-type": "error", + "@typescript-eslint/no-floating-promises": "error" + }, + "globals": {}, "parser": "@typescript-eslint/parser", "parserOptions": { "project": "tsconfig.json", @@ -12,8 +18,25 @@ module.exports = { "plugins": [ "@typescript-eslint" ], - "rules": { - "@typescript-eslint/array-type": "error", - "@typescript-eslint/no-floating-promises": "error" + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".mjs", + ".js", + ".json" + ] + } + }, + "import/extensions": [ + ".js", + ".mjs", + ".jsx" + ], + "import/core-modules": [], + "import/ignore": [ + "node_modules", + "\\.(coffee|scss|css|less|hbs|svg|json)$" + ] } }; diff --git a/test/tests/custom package path/expected.json b/test/tests/custom package path/expected.json deleted file mode 100644 index 06585f8f1..000000000 --- a/test/tests/custom package path/expected.json +++ /dev/null @@ -1,31 +0,0 @@ -module.exports = { - env: { - es6: true, - node: true, - }, - parser: "@typescript-eslint/parser", - parserOptions: { - project: "tsconfig.json", - sourceType: "module", - }, - plugins: ["@typescript-eslint", "@typescript-eslint/tslint"], - rules: { - "@typescript-eslint/array-type": "error", - "@typescript-eslint/interface-name-prefix": "error", - "no-magic-numbers": "off", - "prefer-template": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - rules: { - "no-implicit-dependencies": [true, "dev"], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number", - ], - }, - }, - ], - }, -}; diff --git a/test/tests/custom package path/expected.txt b/test/tests/custom package path/expected.txt new file mode 100644 index 000000000..f053ebf79 --- /dev/null +++ b/test/tests/custom package path/expected.txt @@ -0,0 +1 @@ +module.exports = {}; diff --git a/test/tests/custom typescript path/.eslintrc.js b/test/tests/custom typescript path/.eslintrc.js new file mode 100644 index 000000000..f053ebf79 --- /dev/null +++ b/test/tests/custom typescript path/.eslintrc.js @@ -0,0 +1 @@ +module.exports = {}; diff --git a/test/tests/custom typescript path/.eslintrc.json b/test/tests/custom typescript path/.eslintrc.json deleted file mode 100644 index 3dc1ec1c1..000000000 --- a/test/tests/custom typescript path/.eslintrc.json +++ /dev/null @@ -1,31 +0,0 @@ -module.exports = { - env: { - browser: true, - node: true, - }, - parser: "@typescript-eslint/parser", - parserOptions: { - project: "tsconfig.json", - sourceType: "module", - }, - plugins: ["@typescript-eslint", "@typescript-eslint/tslint"], - rules: { - "@typescript-eslint/array-type": "error", - "@typescript-eslint/interface-name-prefix": "error", - "no-magic-numbers": "off", - "prefer-template": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - rules: { - "no-implicit-dependencies": [true, "dev"], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number", - ], - }, - }, - ], - }, -}; diff --git a/test/tests/custom typescript path/eslintrc.js b/test/tests/custom typescript path/eslintrc.js index 359348ab8..ea23157c3 100644 --- a/test/tests/custom typescript path/eslintrc.js +++ b/test/tests/custom typescript path/eslintrc.js @@ -3,6 +3,12 @@ module.exports = { "browser": true, "node": true }, + "extends": [], + "rules": { + "@typescript-eslint/array-type": "error", + "@typescript-eslint/no-floating-promises": "error" + }, + "globals": {}, "parser": "@typescript-eslint/parser", "parserOptions": { "project": "tsconfig.json", @@ -11,8 +17,25 @@ module.exports = { "plugins": [ "@typescript-eslint" ], - "rules": { - "@typescript-eslint/array-type": "error", - "@typescript-eslint/no-floating-promises": "error" + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".mjs", + ".js", + ".json" + ] + } + }, + "import/extensions": [ + ".js", + ".mjs", + ".jsx" + ], + "import/core-modules": [], + "import/ignore": [ + "node_modules", + "\\.(coffee|scss|css|less|hbs|svg|json)$" + ] } }; diff --git a/test/tests/custom typescript path/expected.json b/test/tests/custom typescript path/expected.json deleted file mode 100644 index 3dc1ec1c1..000000000 --- a/test/tests/custom typescript path/expected.json +++ /dev/null @@ -1,31 +0,0 @@ -module.exports = { - env: { - browser: true, - node: true, - }, - parser: "@typescript-eslint/parser", - parserOptions: { - project: "tsconfig.json", - sourceType: "module", - }, - plugins: ["@typescript-eslint", "@typescript-eslint/tslint"], - rules: { - "@typescript-eslint/array-type": "error", - "@typescript-eslint/interface-name-prefix": "error", - "no-magic-numbers": "off", - "prefer-template": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - rules: { - "no-implicit-dependencies": [true, "dev"], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number", - ], - }, - }, - ], - }, -}; diff --git a/test/tests/custom typescript path/expected.txt b/test/tests/custom typescript path/expected.txt new file mode 100644 index 000000000..f053ebf79 --- /dev/null +++ b/test/tests/custom typescript path/expected.txt @@ -0,0 +1 @@ +module.exports = {}; diff --git a/test/tests/missing tslint.json/.eslintrc.js b/test/tests/missing tslint.json/.eslintrc.js new file mode 100644 index 000000000..f053ebf79 --- /dev/null +++ b/test/tests/missing tslint.json/.eslintrc.js @@ -0,0 +1 @@ +module.exports = {}; diff --git a/test/tests/missing tslint.json/.eslintrc.json b/test/tests/missing tslint.json/.eslintrc.json deleted file mode 100644 index 79186a52c..000000000 --- a/test/tests/missing tslint.json/.eslintrc.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "env": { - "es6": true, - "node": true - }, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint", - "@typescript-eslint/tslint" - ], - "rules": { - "@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", - "@typescript-eslint/no-use-before-declare": "off", - "@typescript-eslint/promise-function-async": "off", - "@typescript-eslint/unbound-method": "off", - "arrow-body-style": "off", - "default-case": "off", - "linebreak-style": "off", - "no-bitwise": "off", - "no-empty": "off", - "no-magic-numbers": "off", - "prefer-template": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "no-implicit-dependencies": [ - true, - "dev" - ], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number" - ] - } - } - ] - } -} \ No newline at end of file diff --git a/test/tests/missing tslint.json/expected.txt b/test/tests/missing tslint.json/expected.txt new file mode 100644 index 000000000..f053ebf79 --- /dev/null +++ b/test/tests/missing tslint.json/expected.txt @@ -0,0 +1 @@ +module.exports = {}; diff --git a/test/tests/rule notices/.eslintrc.js b/test/tests/rule notices/.eslintrc.js new file mode 100644 index 000000000..7be35b6b6 --- /dev/null +++ b/test/tests/rule notices/.eslintrc.js @@ -0,0 +1,2 @@ +module.exports = { +}; diff --git a/test/tests/rule notices/.eslintrc.json b/test/tests/rule notices/.eslintrc.json deleted file mode 100644 index 7c1780dcb..000000000 --- a/test/tests/rule notices/.eslintrc.json +++ /dev/null @@ -1,45 +0,0 @@ -module.exports = { - "env": { - "browser": true, - "es6": true, - "node": true - }, - "extends": [], - "rules": { - "max-classes-per-file": [ - "error", - "exclude-class-expressions" - ], - "no-caller": "error" - }, - "globals": {}, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint" - ], - "settings": { - "import/resolver": { - "node": { - "extensions": [ - ".mjs", - ".js", - ".json" - ] - } - }, - "import/extensions": [ - ".js", - ".mjs", - ".jsx" - ], - "import/core-modules": [], - "import/ignore": [ - "node_modules", - "\\.(coffee|scss|css|less|hbs|svg|json)$" - ] - } -}; diff --git a/test/tests/rule notices/eslintrc.js b/test/tests/rule notices/eslintrc.js index 19c2be0ed..7c1780dcb 100644 --- a/test/tests/rule notices/eslintrc.js +++ b/test/tests/rule notices/eslintrc.js @@ -4,6 +4,15 @@ module.exports = { "es6": true, "node": true }, + "extends": [], + "rules": { + "max-classes-per-file": [ + "error", + "exclude-class-expressions" + ], + "no-caller": "error" + }, + "globals": {}, "parser": "@typescript-eslint/parser", "parserOptions": { "project": "tsconfig.json", @@ -12,11 +21,25 @@ module.exports = { "plugins": [ "@typescript-eslint" ], - "rules": { - "max-classes-per-file": [ - "error", - "exclude-class-expressions" + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".mjs", + ".js", + ".json" + ] + } + }, + "import/extensions": [ + ".js", + ".mjs", + ".jsx" ], - "no-caller": "error" + "import/core-modules": [], + "import/ignore": [ + "node_modules", + "\\.(coffee|scss|css|less|hbs|svg|json)$" + ] } }; diff --git a/test/tests/rule notices/expected.txt b/test/tests/rule notices/expected.txt new file mode 100644 index 000000000..7be35b6b6 --- /dev/null +++ b/test/tests/rule notices/expected.txt @@ -0,0 +1,2 @@ +module.exports = { +}; diff --git a/test/tests/standalone tslint.json/.eslintrc.js b/test/tests/standalone tslint.json/.eslintrc.js new file mode 100644 index 000000000..f053ebf79 --- /dev/null +++ b/test/tests/standalone tslint.json/.eslintrc.js @@ -0,0 +1 @@ +module.exports = {}; diff --git a/test/tests/standalone tslint.json/.eslintrc.json b/test/tests/standalone tslint.json/.eslintrc.json deleted file mode 100644 index 79186a52c..000000000 --- a/test/tests/standalone tslint.json/.eslintrc.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "env": { - "es6": true, - "node": true - }, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint", - "@typescript-eslint/tslint" - ], - "rules": { - "@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", - "@typescript-eslint/no-use-before-declare": "off", - "@typescript-eslint/promise-function-async": "off", - "@typescript-eslint/unbound-method": "off", - "arrow-body-style": "off", - "default-case": "off", - "linebreak-style": "off", - "no-bitwise": "off", - "no-empty": "off", - "no-magic-numbers": "off", - "prefer-template": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "no-implicit-dependencies": [ - true, - "dev" - ], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number" - ] - } - } - ] - } -} \ No newline at end of file diff --git a/test/tests/standalone tslint.json/eslintrc.js b/test/tests/standalone tslint.json/eslintrc.js deleted file mode 100644 index 98fbf74e6..000000000 --- a/test/tests/standalone tslint.json/eslintrc.js +++ /dev/null @@ -1,65 +0,0 @@ -module.exports = { - "env": { - "browser": true, - "es6": true, - "node": true - }, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint" - ], - "rules": { - "@typescript-eslint/array-type": "error", -<<<<<<< HEAD - "@typescript-eslint/no-floating-promises": "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", - "@typescript-eslint/no-use-before-declare": "off", - "@typescript-eslint/promise-function-async": "off", - "@typescript-eslint/unbound-method": "off", - "arrow-body-style": "off", - "default-case": "off", - "import/no-default-export": "error", - "linebreak-style": "off", - "no-bitwise": "off", - "no-empty": "off", - "no-magic-numbers": "off", - "padding-line-between-statements": [ - "off", - "error", - { - "blankLine": "always", - "prev": "*", - "next": "return" - } - ], - "prefer-template": "off", - "unicorn/filename-case": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "no-implicit-dependencies": [ - true, - "dev" - ], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number" - ] - } - } - ] ->>>>>>> master - } -}; diff --git a/test/tests/standalone tslint.json/expected.txt b/test/tests/standalone tslint.json/expected.txt new file mode 100644 index 000000000..f053ebf79 --- /dev/null +++ b/test/tests/standalone tslint.json/expected.txt @@ -0,0 +1 @@ +module.exports = {}; diff --git a/test/tests/unknown rule/.eslintrc.js b/test/tests/unknown rule/.eslintrc.js new file mode 100644 index 000000000..f053ebf79 --- /dev/null +++ b/test/tests/unknown rule/.eslintrc.js @@ -0,0 +1 @@ +module.exports = {}; diff --git a/test/tests/unknown rule/.eslintrc.json b/test/tests/unknown rule/.eslintrc.json deleted file mode 100644 index 7c1780dcb..000000000 --- a/test/tests/unknown rule/.eslintrc.json +++ /dev/null @@ -1,45 +0,0 @@ -module.exports = { - "env": { - "browser": true, - "es6": true, - "node": true - }, - "extends": [], - "rules": { - "max-classes-per-file": [ - "error", - "exclude-class-expressions" - ], - "no-caller": "error" - }, - "globals": {}, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint" - ], - "settings": { - "import/resolver": { - "node": { - "extensions": [ - ".mjs", - ".js", - ".json" - ] - } - }, - "import/extensions": [ - ".js", - ".mjs", - ".jsx" - ], - "import/core-modules": [], - "import/ignore": [ - "node_modules", - "\\.(coffee|scss|css|less|hbs|svg|json)$" - ] - } -}; diff --git a/test/tests/unknown rule/eslintrc.js b/test/tests/unknown rule/eslintrc.js index 3b1477b49..224719ced 100644 --- a/test/tests/unknown rule/eslintrc.js +++ b/test/tests/unknown rule/eslintrc.js @@ -4,6 +4,18 @@ module.exports = { "es6": true, "node": true }, + "extends": [], + "rules": { + "@typescript-eslint/tslint/config": [ + "error", + { + "rules": { + "this-definitely-does-not-exist": true + } + } + ] + }, + "globals": {}, "parser": "@typescript-eslint/parser", "parserOptions": { "project": "tsconfig.json", @@ -13,14 +25,25 @@ module.exports = { "@typescript-eslint", "@typescript-eslint/tslint" ], - "rules": { - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "this-definitely-does-not-exist": true - } + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".mjs", + ".js", + ".json" + ] } + }, + "import/extensions": [ + ".js", + ".mjs", + ".jsx" + ], + "import/core-modules": [], + "import/ignore": [ + "node_modules", + "\\.(coffee|scss|css|less|hbs|svg|json)$" ] } }; diff --git a/test/tests/unknown rule/expected.txt b/test/tests/unknown rule/expected.txt new file mode 100644 index 000000000..f053ebf79 --- /dev/null +++ b/test/tests/unknown rule/expected.txt @@ -0,0 +1 @@ +module.exports = {}; From a9567c8e7debca1f346eb65f2c1f8d715190c806 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 6 Oct 2019 18:02:36 -0400 Subject: [PATCH 07/13] Removed old expected.json files --- test/tests/missing tslint.json/expected.json | 50 ------------------- test/tests/rule notices/expected.json | 45 ----------------- .../standalone tslint.json/expected.json | 50 ------------------- test/tests/unknown rule/expected.json | 45 ----------------- 4 files changed, 190 deletions(-) delete mode 100644 test/tests/missing tslint.json/expected.json delete mode 100644 test/tests/rule notices/expected.json delete mode 100644 test/tests/standalone tslint.json/expected.json delete mode 100644 test/tests/unknown rule/expected.json diff --git a/test/tests/missing tslint.json/expected.json b/test/tests/missing tslint.json/expected.json deleted file mode 100644 index 79186a52c..000000000 --- a/test/tests/missing tslint.json/expected.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "env": { - "es6": true, - "node": true - }, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint", - "@typescript-eslint/tslint" - ], - "rules": { - "@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", - "@typescript-eslint/no-use-before-declare": "off", - "@typescript-eslint/promise-function-async": "off", - "@typescript-eslint/unbound-method": "off", - "arrow-body-style": "off", - "default-case": "off", - "linebreak-style": "off", - "no-bitwise": "off", - "no-empty": "off", - "no-magic-numbers": "off", - "prefer-template": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "no-implicit-dependencies": [ - true, - "dev" - ], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number" - ] - } - } - ] - } -} \ No newline at end of file diff --git a/test/tests/rule notices/expected.json b/test/tests/rule notices/expected.json deleted file mode 100644 index 7c1780dcb..000000000 --- a/test/tests/rule notices/expected.json +++ /dev/null @@ -1,45 +0,0 @@ -module.exports = { - "env": { - "browser": true, - "es6": true, - "node": true - }, - "extends": [], - "rules": { - "max-classes-per-file": [ - "error", - "exclude-class-expressions" - ], - "no-caller": "error" - }, - "globals": {}, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint" - ], - "settings": { - "import/resolver": { - "node": { - "extensions": [ - ".mjs", - ".js", - ".json" - ] - } - }, - "import/extensions": [ - ".js", - ".mjs", - ".jsx" - ], - "import/core-modules": [], - "import/ignore": [ - "node_modules", - "\\.(coffee|scss|css|less|hbs|svg|json)$" - ] - } -}; diff --git a/test/tests/standalone tslint.json/expected.json b/test/tests/standalone tslint.json/expected.json deleted file mode 100644 index 79186a52c..000000000 --- a/test/tests/standalone tslint.json/expected.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "env": { - "es6": true, - "node": true - }, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint", - "@typescript-eslint/tslint" - ], - "rules": { - "@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", - "@typescript-eslint/no-use-before-declare": "off", - "@typescript-eslint/promise-function-async": "off", - "@typescript-eslint/unbound-method": "off", - "arrow-body-style": "off", - "default-case": "off", - "linebreak-style": "off", - "no-bitwise": "off", - "no-empty": "off", - "no-magic-numbers": "off", - "prefer-template": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "no-implicit-dependencies": [ - true, - "dev" - ], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number" - ] - } - } - ] - } -} \ No newline at end of file diff --git a/test/tests/unknown rule/expected.json b/test/tests/unknown rule/expected.json deleted file mode 100644 index 7c1780dcb..000000000 --- a/test/tests/unknown rule/expected.json +++ /dev/null @@ -1,45 +0,0 @@ -module.exports = { - "env": { - "browser": true, - "es6": true, - "node": true - }, - "extends": [], - "rules": { - "max-classes-per-file": [ - "error", - "exclude-class-expressions" - ], - "no-caller": "error" - }, - "globals": {}, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint" - ], - "settings": { - "import/resolver": { - "node": { - "extensions": [ - ".mjs", - ".js", - ".json" - ] - } - }, - "import/extensions": [ - ".js", - ".mjs", - ".jsx" - ], - "import/core-modules": [], - "import/ignore": [ - "node_modules", - "\\.(coffee|scss|css|less|hbs|svg|json)$" - ] - } -}; From 92ed2ecd270dfe90a740c6c0ffcb4ed07548337f Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 6 Oct 2019 18:04:07 -0400 Subject: [PATCH 08/13] Re-accepted end-to-end tests --- test/tests/standalone tslint.json/eslintrc.js | 42 +++++++++++++++++++ test/tests/standalone tslint.json/stderr.txt | 4 -- test/tests/standalone tslint.json/stdout.txt | 2 + test/tests/standalone tslint.json/tslint.json | 33 --------------- 4 files changed, 44 insertions(+), 37 deletions(-) create mode 100644 test/tests/standalone tslint.json/eslintrc.js diff --git a/test/tests/standalone tslint.json/eslintrc.js b/test/tests/standalone tslint.json/eslintrc.js new file mode 100644 index 000000000..8a5bc1df3 --- /dev/null +++ b/test/tests/standalone tslint.json/eslintrc.js @@ -0,0 +1,42 @@ +module.exports = { + "env": { + "browser": true, + "es6": true, + "node": true + }, + "extends": [], + "rules": { + "@typescript-eslint/array-type": "error", + "@typescript-eslint/no-floating-promises": "error" + }, + "globals": {}, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ], + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".mjs", + ".js", + ".json" + ] + } + }, + "import/extensions": [ + ".js", + ".mjs", + ".jsx" + ], + "import/core-modules": [], + "import/ignore": [ + "node_modules", + "\\.(coffee|scss|css|less|hbs|svg|json)$" + ] + } +}; diff --git a/test/tests/standalone tslint.json/stderr.txt b/test/tests/standalone tslint.json/stderr.txt index 7049ee225..e69de29bb 100644 --- a/test/tests/standalone tslint.json/stderr.txt +++ b/test/tests/standalone tslint.json/stderr.txt @@ -1,4 +0,0 @@ -❌ Could not start tslint-to-eslint: ❌ -Command failed: tslint --print-config "./tslint.json" -Failed to load C:\Code\tslint-to-eslint-config\test\tests\standalone tslint.json\tslint.json: Unexpected token < in JSON at position 59 in C:\Code\tslint-to-eslint-config\test\tests\standalone tslint.json\tslint.json - diff --git a/test/tests/standalone tslint.json/stdout.txt b/test/tests/standalone tslint.json/stdout.txt index e69de29bb..e472c978c 100644 --- a/test/tests/standalone tslint.json/stdout.txt +++ b/test/tests/standalone tslint.json/stdout.txt @@ -0,0 +1,2 @@ +✨ 2 rules replaced with their ESLint equivalents. ✨ +✅ All is well! ✅ diff --git a/test/tests/standalone tslint.json/tslint.json b/test/tests/standalone tslint.json/tslint.json index 3ea406ef1..6cc0aa010 100644 --- a/test/tests/standalone tslint.json/tslint.json +++ b/test/tests/standalone tslint.json/tslint.json @@ -1,40 +1,7 @@ { "rules": { "array-type": [true, "array"], -<<<<<<< HEAD "no-floating-promises": true, -======= - "arrow-return-shorthand": false, - "completed-docs": false, - "comment-format": false, - "file-name-casing": false, - "linebreak-style": false, - "interface-name": [true, "never-prefix"], - "member-ordering": false, - "newline-before-return": false, - "no-any": false, - "no-bitwise": false, - "no-empty": false, - "no-default-export": true, - "no-magic-numbers": false, - "no-import-side-effect": false, - "no-implicit-dependencies": [true, "dev"], - "no-null-keyword": false, - "no-parameter-reassignment": false, - "no-parameter-properties": false, - "no-submodule-imports": false, - "no-unbound-method": false, - "no-unused-variable": false, - "no-use-before-declare": false, - "prefer-conditional-expression": false, - "prefer-method-signature": false, - "prefer-switch": false, - "prefer-template": false, - "promise-function-async": false, - "strict-boolean-expressions": [true, "allow-boolean-or-undefined", "allow-number"], - "switch-default": false, - "switch-final-break": false, ->>>>>>> master "typedef": false } } From 3c123ce0568fc20aa9cee38743246c3ec6f5e39b Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 6 Oct 2019 18:24:13 -0400 Subject: [PATCH 09/13] Again updated eslint path names --- .../custom eslint path/.eslintrc.custom.js | 21 ++++++++ test/tests/custom eslint path/eslintrc.js | 42 ---------------- test/tests/custom eslint path/expected.txt | 23 +-------- test/tests/custom eslint path/test.ts | 2 +- test/tests/custom package path/.eslintrc.js | 22 ++++++++- test/tests/custom package path/eslintrc.js | 42 ---------------- .../tests/custom typescript path/.eslintrc.js | 21 +++++++- test/tests/custom typescript path/eslintrc.js | 41 ---------------- test/tests/rule notices/.eslintrc.js | 20 ++++++++ test/tests/rule notices/eslintrc.js | 45 ----------------- .../tests/standalone tslint.json/.eslintrc.js | 22 ++++++++- test/tests/standalone tslint.json/eslintrc.js | 42 ---------------- test/tests/unknown rule/.eslintrc.js | 27 +++++++++- test/tests/unknown rule/eslintrc.js | 49 ------------------- 14 files changed, 131 insertions(+), 288 deletions(-) create mode 100644 test/tests/custom eslint path/.eslintrc.custom.js delete mode 100644 test/tests/custom eslint path/eslintrc.js delete mode 100644 test/tests/custom package path/eslintrc.js delete mode 100644 test/tests/custom typescript path/eslintrc.js delete mode 100644 test/tests/rule notices/eslintrc.js delete mode 100644 test/tests/standalone tslint.json/eslintrc.js delete mode 100644 test/tests/unknown rule/eslintrc.js diff --git a/test/tests/custom eslint path/.eslintrc.custom.js b/test/tests/custom eslint path/.eslintrc.custom.js new file mode 100644 index 000000000..b6b6646c4 --- /dev/null +++ b/test/tests/custom eslint path/.eslintrc.custom.js @@ -0,0 +1,21 @@ +module.exports = { + "env": { + "browser": true, + "es6": true, + "node": true + }, + "extends": [], + "rules": { + "@typescript-eslint/array-type": "error", + "@typescript-eslint/no-floating-promises": "error" + }, + "globals": {}, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ] +}; diff --git a/test/tests/custom eslint path/eslintrc.js b/test/tests/custom eslint path/eslintrc.js deleted file mode 100644 index 8a5bc1df3..000000000 --- a/test/tests/custom eslint path/eslintrc.js +++ /dev/null @@ -1,42 +0,0 @@ -module.exports = { - "env": { - "browser": true, - "es6": true, - "node": true - }, - "extends": [], - "rules": { - "@typescript-eslint/array-type": "error", - "@typescript-eslint/no-floating-promises": "error" - }, - "globals": {}, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint" - ], - "settings": { - "import/resolver": { - "node": { - "extensions": [ - ".mjs", - ".js", - ".json" - ] - } - }, - "import/extensions": [ - ".js", - ".mjs", - ".jsx" - ], - "import/core-modules": [], - "import/ignore": [ - "node_modules", - "\\.(coffee|scss|css|less|hbs|svg|json)$" - ] - } -}; diff --git a/test/tests/custom eslint path/expected.txt b/test/tests/custom eslint path/expected.txt index 8a5bc1df3..b6b6646c4 100644 --- a/test/tests/custom eslint path/expected.txt +++ b/test/tests/custom eslint path/expected.txt @@ -17,26 +17,5 @@ module.exports = { }, "plugins": [ "@typescript-eslint" - ], - "settings": { - "import/resolver": { - "node": { - "extensions": [ - ".mjs", - ".js", - ".json" - ] - } - }, - "import/extensions": [ - ".js", - ".mjs", - ".jsx" - ], - "import/core-modules": [], - "import/ignore": [ - "node_modules", - "\\.(coffee|scss|css|less|hbs|svg|json)$" - ] - } + ] }; diff --git a/test/tests/custom eslint path/test.ts b/test/tests/custom eslint path/test.ts index 31c11e9b1..299c46880 100644 --- a/test/tests/custom eslint path/test.ts +++ b/test/tests/custom eslint path/test.ts @@ -1,6 +1,6 @@ import { createTests } from "../../createTests"; -const eslint = "./eslintrc.js"; +const eslint = "./.eslintrc.custom.js"; createTests(__dirname, { eslint, diff --git a/test/tests/custom package path/.eslintrc.js b/test/tests/custom package path/.eslintrc.js index f053ebf79..b6b6646c4 100644 --- a/test/tests/custom package path/.eslintrc.js +++ b/test/tests/custom package path/.eslintrc.js @@ -1 +1,21 @@ -module.exports = {}; +module.exports = { + "env": { + "browser": true, + "es6": true, + "node": true + }, + "extends": [], + "rules": { + "@typescript-eslint/array-type": "error", + "@typescript-eslint/no-floating-promises": "error" + }, + "globals": {}, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ] +}; diff --git a/test/tests/custom package path/eslintrc.js b/test/tests/custom package path/eslintrc.js deleted file mode 100644 index 8a5bc1df3..000000000 --- a/test/tests/custom package path/eslintrc.js +++ /dev/null @@ -1,42 +0,0 @@ -module.exports = { - "env": { - "browser": true, - "es6": true, - "node": true - }, - "extends": [], - "rules": { - "@typescript-eslint/array-type": "error", - "@typescript-eslint/no-floating-promises": "error" - }, - "globals": {}, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint" - ], - "settings": { - "import/resolver": { - "node": { - "extensions": [ - ".mjs", - ".js", - ".json" - ] - } - }, - "import/extensions": [ - ".js", - ".mjs", - ".jsx" - ], - "import/core-modules": [], - "import/ignore": [ - "node_modules", - "\\.(coffee|scss|css|less|hbs|svg|json)$" - ] - } -}; diff --git a/test/tests/custom typescript path/.eslintrc.js b/test/tests/custom typescript path/.eslintrc.js index f053ebf79..ab8873da6 100644 --- a/test/tests/custom typescript path/.eslintrc.js +++ b/test/tests/custom typescript path/.eslintrc.js @@ -1 +1,20 @@ -module.exports = {}; +module.exports = { + "env": { + "browser": true, + "node": true + }, + "extends": [], + "rules": { + "@typescript-eslint/array-type": "error", + "@typescript-eslint/no-floating-promises": "error" + }, + "globals": {}, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ] +}; diff --git a/test/tests/custom typescript path/eslintrc.js b/test/tests/custom typescript path/eslintrc.js deleted file mode 100644 index ea23157c3..000000000 --- a/test/tests/custom typescript path/eslintrc.js +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = { - "env": { - "browser": true, - "node": true - }, - "extends": [], - "rules": { - "@typescript-eslint/array-type": "error", - "@typescript-eslint/no-floating-promises": "error" - }, - "globals": {}, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint" - ], - "settings": { - "import/resolver": { - "node": { - "extensions": [ - ".mjs", - ".js", - ".json" - ] - } - }, - "import/extensions": [ - ".js", - ".mjs", - ".jsx" - ], - "import/core-modules": [], - "import/ignore": [ - "node_modules", - "\\.(coffee|scss|css|less|hbs|svg|json)$" - ] - } -}; diff --git a/test/tests/rule notices/.eslintrc.js b/test/tests/rule notices/.eslintrc.js index 7be35b6b6..19c2be0ed 100644 --- a/test/tests/rule notices/.eslintrc.js +++ b/test/tests/rule notices/.eslintrc.js @@ -1,2 +1,22 @@ module.exports = { + "env": { + "browser": true, + "es6": true, + "node": true + }, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ], + "rules": { + "max-classes-per-file": [ + "error", + "exclude-class-expressions" + ], + "no-caller": "error" + } }; diff --git a/test/tests/rule notices/eslintrc.js b/test/tests/rule notices/eslintrc.js deleted file mode 100644 index 7c1780dcb..000000000 --- a/test/tests/rule notices/eslintrc.js +++ /dev/null @@ -1,45 +0,0 @@ -module.exports = { - "env": { - "browser": true, - "es6": true, - "node": true - }, - "extends": [], - "rules": { - "max-classes-per-file": [ - "error", - "exclude-class-expressions" - ], - "no-caller": "error" - }, - "globals": {}, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint" - ], - "settings": { - "import/resolver": { - "node": { - "extensions": [ - ".mjs", - ".js", - ".json" - ] - } - }, - "import/extensions": [ - ".js", - ".mjs", - ".jsx" - ], - "import/core-modules": [], - "import/ignore": [ - "node_modules", - "\\.(coffee|scss|css|less|hbs|svg|json)$" - ] - } -}; diff --git a/test/tests/standalone tslint.json/.eslintrc.js b/test/tests/standalone tslint.json/.eslintrc.js index f053ebf79..b6b6646c4 100644 --- a/test/tests/standalone tslint.json/.eslintrc.js +++ b/test/tests/standalone tslint.json/.eslintrc.js @@ -1 +1,21 @@ -module.exports = {}; +module.exports = { + "env": { + "browser": true, + "es6": true, + "node": true + }, + "extends": [], + "rules": { + "@typescript-eslint/array-type": "error", + "@typescript-eslint/no-floating-promises": "error" + }, + "globals": {}, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ] +}; diff --git a/test/tests/standalone tslint.json/eslintrc.js b/test/tests/standalone tslint.json/eslintrc.js deleted file mode 100644 index 8a5bc1df3..000000000 --- a/test/tests/standalone tslint.json/eslintrc.js +++ /dev/null @@ -1,42 +0,0 @@ -module.exports = { - "env": { - "browser": true, - "es6": true, - "node": true - }, - "extends": [], - "rules": { - "@typescript-eslint/array-type": "error", - "@typescript-eslint/no-floating-promises": "error" - }, - "globals": {}, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint" - ], - "settings": { - "import/resolver": { - "node": { - "extensions": [ - ".mjs", - ".js", - ".json" - ] - } - }, - "import/extensions": [ - ".js", - ".mjs", - ".jsx" - ], - "import/core-modules": [], - "import/ignore": [ - "node_modules", - "\\.(coffee|scss|css|less|hbs|svg|json)$" - ] - } -}; diff --git a/test/tests/unknown rule/.eslintrc.js b/test/tests/unknown rule/.eslintrc.js index f053ebf79..3b1477b49 100644 --- a/test/tests/unknown rule/.eslintrc.js +++ b/test/tests/unknown rule/.eslintrc.js @@ -1 +1,26 @@ -module.exports = {}; +module.exports = { + "env": { + "browser": true, + "es6": true, + "node": true + }, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint", + "@typescript-eslint/tslint" + ], + "rules": { + "@typescript-eslint/tslint/config": [ + "error", + { + "rules": { + "this-definitely-does-not-exist": true + } + } + ] + } +}; diff --git a/test/tests/unknown rule/eslintrc.js b/test/tests/unknown rule/eslintrc.js deleted file mode 100644 index 224719ced..000000000 --- a/test/tests/unknown rule/eslintrc.js +++ /dev/null @@ -1,49 +0,0 @@ -module.exports = { - "env": { - "browser": true, - "es6": true, - "node": true - }, - "extends": [], - "rules": { - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "this-definitely-does-not-exist": true - } - } - ] - }, - "globals": {}, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint", - "@typescript-eslint/tslint" - ], - "settings": { - "import/resolver": { - "node": { - "extensions": [ - ".mjs", - ".js", - ".json" - ] - } - }, - "import/extensions": [ - ".js", - ".mjs", - ".jsx" - ], - "import/core-modules": [], - "import/ignore": [ - "node_modules", - "\\.(coffee|scss|css|less|hbs|svg|json)$" - ] - } -}; From 87c12292d2ac7cff6723a027cdb8438029ffc6df Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 6 Oct 2019 18:33:21 -0400 Subject: [PATCH 10/13] Updated expected baslines, again... --- test/createTestArgs.ts | 2 +- test/tests/custom eslint path/.eslintrc.js | 22 +++++++++++++++ test/tests/custom eslint path/stderr.txt | 17 ++++++++++++ test/tests/custom eslint path/stdout.txt | 2 -- test/tests/custom package path/expected.txt | 22 ++++++++++++++- .../tests/custom typescript path/.eslintrc.js | 2 +- .../tests/custom typescript path/expected.txt | 21 ++++++++++++++- test/tests/rule notices/expected.txt | 20 ++++++++++++++ .../tests/standalone tslint.json/expected.txt | 22 ++++++++++++++- test/tests/unknown rule/expected.txt | 27 ++++++++++++++++++- 10 files changed, 149 insertions(+), 8 deletions(-) create mode 100644 test/tests/custom eslint path/.eslintrc.js diff --git a/test/createTestArgs.ts b/test/createTestArgs.ts index 84efb2306..7bb872156 100644 --- a/test/createTestArgs.ts +++ b/test/createTestArgs.ts @@ -6,7 +6,7 @@ const readdir = promisify(fs.readdir); export const createTestArgs = async (cwd: string, extraArgs: string[]) => { const items = new Set(await readdir(cwd)); - const flags = ["--config", path.join(cwd, ".eslintrc.json")]; + const flags = ["--config", path.join(cwd, ".eslintrc.js")]; if (items.has("tslint.json")) { flags.push("--tslint", path.join(cwd, "tslint.json")); diff --git a/test/tests/custom eslint path/.eslintrc.js b/test/tests/custom eslint path/.eslintrc.js new file mode 100644 index 000000000..bb62eed85 --- /dev/null +++ b/test/tests/custom eslint path/.eslintrc.js @@ -0,0 +1,22 @@ +module.exports = { + "env": { + "browser": true, + "es6": true, + "node": true + }, + "extends": [], + "rules": { + "@typescript-eslint/array-type": "error", + "@typescript-eslint/no-floating-promises": "error", + "previously-existing-rule": "warning", + }, + "globals": {}, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ] +}; diff --git a/test/tests/custom eslint path/stderr.txt b/test/tests/custom eslint path/stderr.txt index e69de29bb..d314b18fa 100644 --- a/test/tests/custom eslint path/stderr.txt +++ b/test/tests/custom eslint path/stderr.txt @@ -0,0 +1,17 @@ +❌ Could not start tslint-to-eslint: ❌ +Command failed: eslint --print-config "./.eslintrc.custom.js" +Error: .eslintrc.js: + Configuration for rule "previously-existing-rule" is invalid: + Severity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '"warning"'). + + at validateRuleOptions (C:\Code\tslint-to-eslint-config\node_modules\eslint\lib\shared\config-validator.js:138:19) + at C:\Code\tslint-to-eslint-config\node_modules\eslint\lib\shared\config-validator.js:193:9 + at Array.forEach () + at validateRules (C:\Code\tslint-to-eslint-config\node_modules\eslint\lib\shared\config-validator.js:190:30) + at validateConfigArray (C:\Code\tslint-to-eslint-config\node_modules\eslint\lib\shared\config-validator.js:337:9) + at CascadingConfigArrayFactory._finalizeConfigArray (C:\Code\tslint-to-eslint-config\node_modules\eslint\lib\cli-engine\cascading-config-array-factory.js:392:13) + at CascadingConfigArrayFactory.getConfigArrayForFile (C:\Code\tslint-to-eslint-config\node_modules\eslint\lib\cli-engine\cascading-config-array-factory.js:248:21) + at CLIEngine.getConfigForFile (C:\Code\tslint-to-eslint-config\node_modules\eslint\lib\cli-engine\cli-engine.js:916:14) + at Object.execute (C:\Code\tslint-to-eslint-config\node_modules\eslint\lib\cli.js:186:39) + at Object. (C:\Code\tslint-to-eslint-config\node_modules\eslint\bin\eslint.js:107:28) + diff --git a/test/tests/custom eslint path/stdout.txt b/test/tests/custom eslint path/stdout.txt index e472c978c..e69de29bb 100644 --- a/test/tests/custom eslint path/stdout.txt +++ b/test/tests/custom eslint path/stdout.txt @@ -1,2 +0,0 @@ -✨ 2 rules replaced with their ESLint equivalents. ✨ -✅ All is well! ✅ diff --git a/test/tests/custom package path/expected.txt b/test/tests/custom package path/expected.txt index f053ebf79..b6b6646c4 100644 --- a/test/tests/custom package path/expected.txt +++ b/test/tests/custom package path/expected.txt @@ -1 +1,21 @@ -module.exports = {}; +module.exports = { + "env": { + "browser": true, + "es6": true, + "node": true + }, + "extends": [], + "rules": { + "@typescript-eslint/array-type": "error", + "@typescript-eslint/no-floating-promises": "error" + }, + "globals": {}, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ] +}; diff --git a/test/tests/custom typescript path/.eslintrc.js b/test/tests/custom typescript path/.eslintrc.js index ab8873da6..2370864a3 100644 --- a/test/tests/custom typescript path/.eslintrc.js +++ b/test/tests/custom typescript path/.eslintrc.js @@ -16,5 +16,5 @@ module.exports = { }, "plugins": [ "@typescript-eslint" - ] + ], }; diff --git a/test/tests/custom typescript path/expected.txt b/test/tests/custom typescript path/expected.txt index f053ebf79..ab8873da6 100644 --- a/test/tests/custom typescript path/expected.txt +++ b/test/tests/custom typescript path/expected.txt @@ -1 +1,20 @@ -module.exports = {}; +module.exports = { + "env": { + "browser": true, + "node": true + }, + "extends": [], + "rules": { + "@typescript-eslint/array-type": "error", + "@typescript-eslint/no-floating-promises": "error" + }, + "globals": {}, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ] +}; diff --git a/test/tests/rule notices/expected.txt b/test/tests/rule notices/expected.txt index 7be35b6b6..19c2be0ed 100644 --- a/test/tests/rule notices/expected.txt +++ b/test/tests/rule notices/expected.txt @@ -1,2 +1,22 @@ module.exports = { + "env": { + "browser": true, + "es6": true, + "node": true + }, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ], + "rules": { + "max-classes-per-file": [ + "error", + "exclude-class-expressions" + ], + "no-caller": "error" + } }; diff --git a/test/tests/standalone tslint.json/expected.txt b/test/tests/standalone tslint.json/expected.txt index f053ebf79..b6b6646c4 100644 --- a/test/tests/standalone tslint.json/expected.txt +++ b/test/tests/standalone tslint.json/expected.txt @@ -1 +1,21 @@ -module.exports = {}; +module.exports = { + "env": { + "browser": true, + "es6": true, + "node": true + }, + "extends": [], + "rules": { + "@typescript-eslint/array-type": "error", + "@typescript-eslint/no-floating-promises": "error" + }, + "globals": {}, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ] +}; diff --git a/test/tests/unknown rule/expected.txt b/test/tests/unknown rule/expected.txt index f053ebf79..3b1477b49 100644 --- a/test/tests/unknown rule/expected.txt +++ b/test/tests/unknown rule/expected.txt @@ -1 +1,26 @@ -module.exports = {}; +module.exports = { + "env": { + "browser": true, + "es6": true, + "node": true + }, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint", + "@typescript-eslint/tslint" + ], + "rules": { + "@typescript-eslint/tslint/config": [ + "error", + { + "rules": { + "this-definitely-does-not-exist": true + } + } + ] + } +}; From 5cecc231565c403388dff5832dc7e0b46b262823 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 6 Oct 2019 18:37:55 -0400 Subject: [PATCH 11/13] It's 'warn', not 'warning' --- .../custom eslint path/.eslintrc.custom.js | 3 ++- test/tests/custom eslint path/expected.txt | 3 ++- test/tests/custom eslint path/stderr.txt | 17 ----------------- test/tests/custom eslint path/stdout.txt | 2 ++ 4 files changed, 6 insertions(+), 19 deletions(-) diff --git a/test/tests/custom eslint path/.eslintrc.custom.js b/test/tests/custom eslint path/.eslintrc.custom.js index b6b6646c4..6e37da782 100644 --- a/test/tests/custom eslint path/.eslintrc.custom.js +++ b/test/tests/custom eslint path/.eslintrc.custom.js @@ -7,7 +7,8 @@ module.exports = { "extends": [], "rules": { "@typescript-eslint/array-type": "error", - "@typescript-eslint/no-floating-promises": "error" + "@typescript-eslint/no-floating-promises": "error", + "previously-existing-rule": "warn", }, "globals": {}, "parser": "@typescript-eslint/parser", diff --git a/test/tests/custom eslint path/expected.txt b/test/tests/custom eslint path/expected.txt index b6b6646c4..6e37da782 100644 --- a/test/tests/custom eslint path/expected.txt +++ b/test/tests/custom eslint path/expected.txt @@ -7,7 +7,8 @@ module.exports = { "extends": [], "rules": { "@typescript-eslint/array-type": "error", - "@typescript-eslint/no-floating-promises": "error" + "@typescript-eslint/no-floating-promises": "error", + "previously-existing-rule": "warn", }, "globals": {}, "parser": "@typescript-eslint/parser", diff --git a/test/tests/custom eslint path/stderr.txt b/test/tests/custom eslint path/stderr.txt index d314b18fa..e69de29bb 100644 --- a/test/tests/custom eslint path/stderr.txt +++ b/test/tests/custom eslint path/stderr.txt @@ -1,17 +0,0 @@ -❌ Could not start tslint-to-eslint: ❌ -Command failed: eslint --print-config "./.eslintrc.custom.js" -Error: .eslintrc.js: - Configuration for rule "previously-existing-rule" is invalid: - Severity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '"warning"'). - - at validateRuleOptions (C:\Code\tslint-to-eslint-config\node_modules\eslint\lib\shared\config-validator.js:138:19) - at C:\Code\tslint-to-eslint-config\node_modules\eslint\lib\shared\config-validator.js:193:9 - at Array.forEach () - at validateRules (C:\Code\tslint-to-eslint-config\node_modules\eslint\lib\shared\config-validator.js:190:30) - at validateConfigArray (C:\Code\tslint-to-eslint-config\node_modules\eslint\lib\shared\config-validator.js:337:9) - at CascadingConfigArrayFactory._finalizeConfigArray (C:\Code\tslint-to-eslint-config\node_modules\eslint\lib\cli-engine\cascading-config-array-factory.js:392:13) - at CascadingConfigArrayFactory.getConfigArrayForFile (C:\Code\tslint-to-eslint-config\node_modules\eslint\lib\cli-engine\cascading-config-array-factory.js:248:21) - at CLIEngine.getConfigForFile (C:\Code\tslint-to-eslint-config\node_modules\eslint\lib\cli-engine\cli-engine.js:916:14) - at Object.execute (C:\Code\tslint-to-eslint-config\node_modules\eslint\lib\cli.js:186:39) - at Object. (C:\Code\tslint-to-eslint-config\node_modules\eslint\bin\eslint.js:107:28) - diff --git a/test/tests/custom eslint path/stdout.txt b/test/tests/custom eslint path/stdout.txt index e69de29bb..e472c978c 100644 --- a/test/tests/custom eslint path/stdout.txt +++ b/test/tests/custom eslint path/stdout.txt @@ -0,0 +1,2 @@ +✨ 2 rules replaced with their ESLint equivalents. ✨ +✅ All is well! ✅ From 80ed44f31f741fc945131ecd86fd6c08fc633986 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 6 Oct 2019 18:41:12 -0400 Subject: [PATCH 12/13] For real it's 'warn' --- test/tests/custom eslint path/.eslintrc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tests/custom eslint path/.eslintrc.js b/test/tests/custom eslint path/.eslintrc.js index bb62eed85..6e37da782 100644 --- a/test/tests/custom eslint path/.eslintrc.js +++ b/test/tests/custom eslint path/.eslintrc.js @@ -8,7 +8,7 @@ module.exports = { "rules": { "@typescript-eslint/array-type": "error", "@typescript-eslint/no-floating-promises": "error", - "previously-existing-rule": "warning", + "previously-existing-rule": "warn", }, "globals": {}, "parser": "@typescript-eslint/parser", From 4e38985a1aaa08bbd95b45c1b36236dfc88db47e Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 6 Oct 2019 18:49:15 -0400 Subject: [PATCH 13/13] Also used --config in custom eslint path test --- test/tests/custom eslint path/.eslintrc.js | 22 ---------------------- test/tests/custom eslint path/test.ts | 2 +- 2 files changed, 1 insertion(+), 23 deletions(-) delete mode 100644 test/tests/custom eslint path/.eslintrc.js diff --git a/test/tests/custom eslint path/.eslintrc.js b/test/tests/custom eslint path/.eslintrc.js deleted file mode 100644 index 6e37da782..000000000 --- a/test/tests/custom eslint path/.eslintrc.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = { - "env": { - "browser": true, - "es6": true, - "node": true - }, - "extends": [], - "rules": { - "@typescript-eslint/array-type": "error", - "@typescript-eslint/no-floating-promises": "error", - "previously-existing-rule": "warn", - }, - "globals": {}, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint" - ] -}; diff --git a/test/tests/custom eslint path/test.ts b/test/tests/custom eslint path/test.ts index 299c46880..104d223e5 100644 --- a/test/tests/custom eslint path/test.ts +++ b/test/tests/custom eslint path/test.ts @@ -4,5 +4,5 @@ const eslint = "./.eslintrc.custom.js"; createTests(__dirname, { eslint, - extraArgs: ["--eslint", eslint], + extraArgs: ["--config", eslint, "--eslint", eslint], }); \ No newline at end of file