Repository: typescript-eslint/tslint-to-eslint-config (ts)

Issue:
Comment on the futility of directly copying configs in generated ESLint configs
### 🚀 Feature Request

Now that this has been out in the wild before, a vague feeling of mine that auto-generated configs are inferior to starting from scratch has become a firm belief. I now recommend to people the following system:

1. Start from scratch with typescript-eslint's recommended and recommend-requiring-type-checking rulesets
2. Add a section to your config's 'rules' listing containing all rules you disabled because you don't want them
3. Add a section to your config's 'rules' listing containing all rules that have any new errors, then file a ticket/issue/whatever-your-JIRA-equivalent-uses to enable each of them
4. Repeat for any community rulesets you find that appeal to you - e.g. React-specific ESLint rules.

_(see also #2 for recommending best practices around Prettier)_

#### Existing Behavior

Generated configs and documentation contain no such comments, and so are implied to be best practice.

#### Change Proposal

Two things:

1. Recommend this approach in the README.md
2. Add comments on top of generated ESLint configs that mention them as auto-generated and inferior


Pull request:
Added usage and base configuration FAQs
## PR Checklist

-   [x] Addresses an existing issue: fixes #301
-   [x] That issue was marked as [`status: accepting prs`](https://github.com/typescript-eslint/tslint-to-eslint-config/labels/status%3A%20accepting%20prs)

## Overview

Roughly per the issue, adds recommendations and links to docs in two places:

* A new `docs/FAQs.md` emphatically linked to in the README.md
* A block comment at the beginning of the generated config file

### Notes

FYI @adidahiya @bradzacher @JamesHenry - I wouldn't feel comfortable speaking on behave of either maintenance team without checking in 😄. Does this phrasing look good to you? 

Patch:
diff --git a/.circleci/config.yml b/.circleci/config.yml
index fea9e85..563197f 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -9,7 +9,7 @@ references:
 jobs:
     build:
         docker:
-            - image: circleci/node:8
+            - image: circleci/node:10
 
         working_directory: ~/repo
 
diff --git a/README.md b/README.md
index c8a89e4..47b400b 100644
--- a/README.md
+++ b/README.md
@@ -4,13 +4,13 @@
 ![Coverage: 100%](https://img.shields.io/badge/coverage-100%25-orange.svg)
 ![TypeScript: Strict](https://img.shields.io/badge/typescript-strict-yellow.svg)
 [![NPM version](https://badge.fury.io/js/tslint-to-eslint-config.svg)](http://badge.fury.io/js/tslint-to-eslint-config)
-[![Circle CI](https://img.shields.io/circleci/build/github/typescript-eslint/tslint-to-eslint-config.svg)](https://circleci.com/gh/typescript-eslint/tslint-to-eslint-config)	
+[![Circle CI](https://img.shields.io/circleci/build/github/typescript-eslint/tslint-to-eslint-config.svg)](https://circleci.com/gh/typescript-eslint/tslint-to-eslint-config)
 [![Join the chat at https://gitter.im/tslint-to-eslint-config/community](https://img.shields.io/badge/chat-gitter-informational.svg)](https://gitter.im/tslint-to-eslint-config/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
 [![Code Style: Prettier](https://img.shields.io/badge/speed-blazingly_fast-blueviolet.svg)](https://prettier.io)
 
 Converts your TSLint configuration to the closest reasonable ESLint equivalent.
 
-👉 Did you know [TSLint is being deprecated this year](https://github.com/palantir/tslint/issues/4534)?
+👉 Did you know [TSLint is deprecated](https://github.com/palantir/tslint/issues/4534)?
 Hooray!
 Use `tslint-to-eslint-config` to expedite migrating your project onto ESLint.
 
@@ -32,7 +32,11 @@ The `tslint-to-eslint-config` command reads in any existing linter, TypeScript,
 For any TSLint rules with corresponding ESLint equivalents, those equivalents will be used in the new configuration.
 TSLint rules without ESLint equivalents will be wrapped with [eslint-plugin-tslint](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin-tslint).
 
-> Requires Node 8+ (LTS)
+> Requires Node 10+ (LTS) and TSLint 5.18+
+
+### FAQs
+
+We **strongly** advise reading [docs/FAQs.md](./docs/FAQs.md) before planning your conversion from ESLint to TSLint.
 
 ### CLI Flags
 
diff --git a/docs/FAQs.md b/docs/FAQs.md
new file mode 100644
index 0000000..9249dea
--- /dev/null
+++ b/docs/FAQs.md
@@ -0,0 +1,41 @@
+# Frequently Asked Questions
+
+## Should I Migrate from TSLint to ESLint?
+
+**Yes**.
+
+[TSLint is deprecated](https://medium.com/palantir/tslint-in-2019-1a144c2317a9) and will [only receive patches](https://github.com/palantir/tslint/issues/4534) for security vulnerabilities and breaking TypeScript changes.
+Even if it still works on your project, it will become less useful over time as TypeScript evolves.
+
+## Should I Use `tslint-to-eslint-config`?
+
+`tslint-to-eslint-config` is recommended for use if you require near-identical behavior in transitioning from TSLint to ESLint.
+This is most reasonable when your project is large enough that fixing for different linter rules would be a significant time investment.
+
+However, after -or even better, _before_- you're migrated to ESLint, we recommend you take this opportunity to re-evaluate your core lint rules.
+TSLint's recommendations were solidified several core TypeScript versions ago and don't always reflect the latest and greatest standards and lint rules.
+
+Our recommended TSLint-to-ESLint configuration migration approach is:
+
+1. Run `tslint-to-eslint-config` on your project
+2. [Disable complaints on a line-, file-, or rule basis](https://eslint.org/docs/user-guide/configuring) for any rules you do not want to enable and/or are now giving complaints
+3. Switch your configuration to extend from [typescript-eslint's `recommended` and `recommend-requiring-type-checking` rulesets](https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/README.md)
+4. Repeat step 2
+5. Add any [community plugins](https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/README.md#plugins) relevant to your project, then repeat step 2
+
+> 😉 Consider filing granular tickets to track investigating re-enabling disabled lint rules to make sure the work doesn't get forgotten.
+
+## Should I Use Prettier?
+
+**Yes!**
+
+Formatting responsibilities, such as indentation and line wrapping, are exceedingly difficult to get implement in **linters**, and as such are practically impossible to get correct in them.
+**Formatters** such as [Prettier](https://prettier.io) do a [much better job](https://prettier.io/docs/en/why-prettier.html) of formatting your code.
+See [this issue](https://github.com/typescript-eslint/typescript-eslint/issues/1824) for more explanation.
+
+The maintenance teams at both TSLint and typescript-eslint recommend using a formatter such as Prettier to format your code instead of a linter.
+
+Please do it. Now. Please stop using code style rules. Please use prettier. Code style rules are hard to write and maintain. Rules like indent are thousands of he comes he comes do not fi​ght he com̡e̶s, ̕h̵i​s un̨ho͞ly radiańcé destro҉ying all enli̍̈́̂̈́ghtenment, spaces and brackets lea͠ki̧n͘g fr̶ǫm ̡yo​͟ur eye͢s̸ ̛l̕ik͏e liq​uid pain, the song of indentation calculation will exti​nguish the voices of mor​tal man from the sp​here I can see it can you see ̲͚̖͔̙î̩́t̲͎̩̱͔́̋̀ it is beautiful t​he final snuffing of the lie​s of Man ALL IS LOŚ͖̩͇̗̪̏̈́T ALL I​S LOST the pon̷y he comes he c̶̮omes he comes the ich​or permeates all MY FACE MY FACE ᵒh god no NO NOO̼O​O NΘ stop the an​*̶͑̾̾​̅ͫ͏̙̤g͇̫͛͆̾ͫ̑͆l͖͉̗̩̳̟̍ͫͥͨe̠̅s ͎a̧͈͖r̽̾̈́͒͑e n​ot rè̑ͧ̌aͨl̘̝̙̃ͤ͂̾̆ ZA̡͊͠͝LGΌ ISͮ̂҉̯͈͕̹̘̱ TO͇̹̺ͅƝ̴ȳ̳ TH̘Ë͖́̉ ͠P̯͍̭O̚​N̐Y̡ H̸̡̪̯ͨ͊̽̅̾̎Ȩ̬̩̾͛ͪ̈́̀́͘ ̶̧̨̱̹̭̯ͧ̾ͬC̷̙̲̝͖ͭ̏ͥͮ͟Oͮ͏̮̪̝͍M̲̖͊̒ͪͩͬ̚̚͜Ȇ̴̟̟͙̞ͩ͌͝S̨̥̫͎̭ͯ̿̔̀ͅ.
+
+> 🙏 [eslint-plugin-prettier](https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/README.md#usage-with-prettier) is an excellent ESLint plugin that disables formatting rules from your configuration.
+> Please use it. 🙏
diff --git a/package-lock.json b/package-lock.json
index 1facfd7..fdb7a1d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9053,9 +9053,9 @@
             "dev": true
         },
         "typescript": {
-            "version": "3.7.4",
-            "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.4.tgz",
-            "integrity": "sha512-A25xv5XCtarLwXpcDNZzCGvW2D1S3/bACratYBx2sax8PefsFhlYmkQicKHvpYflFS8if4zne5zT5kpJ7pzuvw=="
+            "version": "3.8.3",
+            "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz",
+            "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w=="
         },
         "uglify-js": {
             "version": "3.7.2",
diff --git a/package.json b/package.json
index 04bbf7a..d7d9e61 100644
--- a/package.json
+++ b/package.json
@@ -7,19 +7,19 @@
     },
     "description": "Converts your TSLint configuration to the closest reasonable ESLint equivalent.",
     "engines": {
-        "node": ">=8.0.0"
+        "node": ">=10.0.0"
     },
     "dependencies": {
         "chalk": "3.0.0",
         "commander": "4.0.1",
-        "strip-json-comments": "^3.0.1",
+        "strip-json-comments": "3.0.1",
         "tslint": "5.20.1",
-        "typescript": "3.7.4"
+        "typescript": "3.8.3"
     },
     "devDependencies": {
         "@babel/core": "7.7.7",
-        "@babel/plugin-proposal-nullish-coalescing-operator": "^7.7.4",
-        "@babel/plugin-proposal-optional-chaining": "^7.7.5",
+        "@babel/plugin-proposal-nullish-coalescing-operator": "7.7.4",
+        "@babel/plugin-proposal-optional-chaining": "7.7.5",
         "@babel/preset-env": "7.7.7",
         "@babel/preset-typescript": "7.7.7",
         "@types/jest": "24.0.24",
diff --git a/src/creation/formatting/formatters/faqs.ts b/src/creation/formatting/formatters/faqs.ts
new file mode 100644
index 0000000..87efec0
--- /dev/null
+++ b/src/creation/formatting/formatters/faqs.ts
@@ -0,0 +1,14 @@
+export const faqs = `/*
+👋 Hi! This file was autogenerated by tslint-to-eslint-config.
+https://github.com/typescript-eslint/tslint-to-eslint-config
+
+It represents the closest reasonable ESLint configuration to this
+project's original TSLint configuration.
+
+We recommend eventually switching this configuration to extend from
+the recommended rulesets in typescript-eslint. 
+https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md
+
+Happy linting! 💖
+*/
+`;
diff --git a/src/creation/formatting/formatters/formatJsOutput.ts b/src/creation/formatting/formatters/formatJsOutput.ts
index 23bc78f..d9095be 100644
--- a/src/creation/formatting/formatters/formatJsOutput.ts
+++ b/src/creation/formatting/formatters/formatJsOutput.ts
@@ -1,7 +1,12 @@
 import { EOL } from "os";
 
+import { faqs } from "./faqs";
 import { withKeysSorted } from "./withKeysSorted";
 
 export const formatJsOutput = (configuration: any) => {
-    return `module.exports = ${JSON.stringify(withKeysSorted(configuration), undefined, 4)};${EOL}`;
+    return `${faqs}module.exports = ${JSON.stringify(
+        withKeysSorted(configuration),
+        undefined,
+        4,
+    )};${EOL}`;
 };
diff --git a/src/creation/formatting/formatters/formatJsonOutput.ts b/src/creation/formatting/formatters/formatJsonOutput.ts
index 16298f1..069269a 100644
--- a/src/creation/formatting/formatters/formatJsonOutput.ts
+++ b/src/creation/formatting/formatters/formatJsonOutput.ts
@@ -1,7 +1,8 @@
 import { EOL } from "os";
 
+import { faqs } from "./faqs";
 import { withKeysSorted } from "./withKeysSorted";
 
 export const formatJsonOutput = (configuration: any) => {
-    return `${JSON.stringify(withKeysSorted(configuration), undefined, 4)}${EOL}`;
+    return `${faqs}${JSON.stringify(withKeysSorted(configuration), undefined, 4)}${EOL}`;
 };
diff --git a/src/rules/converters/ban-types.ts b/src/rules/converters/ban-types.ts
index b3b2886..7c5e200 100644
--- a/src/rules/converters/ban-types.ts
+++ b/src/rules/converters/ban-types.ts
@@ -1,10 +1,33 @@
 import { RuleConverter } from "../converter";
 
-export const convertBanTypes: RuleConverter = () => {
+export const convertBanTypes: RuleConverter = tslintRule => {
+    type ConvertBanTypeArgument = {
+        message: string;
+    };
+
+    const bannedTypes: Record<string, ConvertBanTypeArgument | null> = {};
+
+    for (const rule of tslintRule.ruleArguments) {
+        if (!Array.isArray(rule)) {
+            break;
+        }
+
+        const [bannedType, message] = rule;
+        if (!bannedType) {
+            break;
+        }
+
+        bannedTypes[bannedType] = message ? { message } : null;
+    }
+
+    const ruleArguments =
+        Object.keys(bannedTypes).length === 0 ? undefined : [{ types: bannedTypes }];
+
     return {
         rules: [
             {
                 ruleName: "@typescript-eslint/ban-types",
+                ...{ ruleArguments },
             },
         ],
     };
diff --git a/tsconfig.json b/tsconfig.json
index f6315f0..33494aa 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -4,7 +4,7 @@
         "declaration": true,
         "esModuleInterop": true,
         "incremental": true,
-        "lib": ["es2017"],
+        "lib": [],
         "module": "commonjs",
         "noFallthroughCasesInSwitch": true,
         "noImplicitAny": true,
@@ -19,7 +19,7 @@
         "strictFunctionTypes": true,
         "strictNullChecks": true,
         "strictPropertyInitialization": true,
-        "target": "es2015"
+        "target": "es2018"
     },
     "exclude": ["test/tests/**/*"],
     "include": ["src/**/*"]


Test patch:
diff --git a/src/creation/formatting/formatOutput.test.ts b/src/creation/formatting/formatOutput.test.ts
index 422c161..9a6a239 100644
--- a/src/creation/formatting/formatOutput.test.ts
+++ b/src/creation/formatting/formatOutput.test.ts
@@ -1,5 +1,6 @@
 import { EOL } from "os";
 
+import { faqs } from "./formatters/faqs";
 import { formatOutput } from "./formatOutput";
 
 describe("formatOutput", () => {
@@ -13,7 +14,7 @@ describe("formatOutput", () => {
 
         // Assert
         expect(output).toBe(
-            `module.exports = ${JSON.stringify(configuration, undefined, 4)};${EOL}`,
+            `${faqs}module.exports = ${JSON.stringify(configuration, undefined, 4)};${EOL}`,
         );
     });
 
@@ -26,7 +27,7 @@ describe("formatOutput", () => {
         const output = formatOutput(outputPath, configuration);
 
         // Assert
-        expect(output).toBe(`${JSON.stringify(configuration, undefined, 4)}${EOL}`);
+        expect(output).toBe(`${faqs}${JSON.stringify(configuration, undefined, 4)}${EOL}`);
     });
 
     it("formats output as JSON for an unknown dot file path", () => {
@@ -38,7 +39,7 @@ describe("formatOutput", () => {
         const output = formatOutput(outputPath, configuration);
 
         // Assert
-        expect(output).toBe(`${JSON.stringify(configuration, undefined, 4)}${EOL}`);
+        expect(output).toBe(`${faqs}${JSON.stringify(configuration, undefined, 4)}${EOL}`);
     });
 
     it("formats output as JSON for an unknown raw file path", () => {
@@ -50,6 +51,6 @@ describe("formatOutput", () => {
         const output = formatOutput(outputPath, configuration);
 
         // Assert
-        expect(output).toBe(`${JSON.stringify(configuration, undefined, 4)}${EOL}`);
+        expect(output).toBe(`${faqs}${JSON.stringify(configuration, undefined, 4)}${EOL}`);
     });
 });
diff --git a/src/rules/converters/tests/ban-types.test.ts b/src/rules/converters/tests/ban-types.test.ts
index a5b08b8..832d76e 100644
--- a/src/rules/converters/tests/ban-types.test.ts
+++ b/src/rules/converters/tests/ban-types.test.ts
@@ -14,4 +14,73 @@ describe(convertBanTypes, () => {
             ],
         });
     });
+
+    test("conversion with arguments", () => {
+        const result = convertBanTypes({
+            ruleArguments: [
+                ["Object", "Use {} instead."],
+                ["String"],
+                ["Number"],
+                ["Boolean", "Use 'boolean' instead."],
+                [], // empty array: this should be ignored
+            ],
+        });
+
+        expect(result).toEqual({
+            rules: [
+                {
+                    ruleName: "@typescript-eslint/ban-types",
+                    ruleArguments: [
+                        {
+                            types: {
+                                Object: {
+                                    message: "Use {} instead.",
+                                },
+                                String: null,
+                                Number: null,
+                                Boolean: {
+                                    message: "Use 'boolean' instead.",
+                                },
+                            },
+                        },
+                    ],
+                },
+            ],
+        });
+    });
+
+    test("conversion with duplicated arguments", () => {
+        const result = convertBanTypes({
+            ruleArguments: [["Object", "Use {} instead."], ["Object"]],
+        });
+
+        expect(result).toEqual({
+            rules: [
+                {
+                    ruleName: "@typescript-eslint/ban-types",
+                    ruleArguments: [
+                        {
+                            types: {
+                                Object: null,
+                            },
+                        },
+                    ],
+                },
+            ],
+        });
+    });
+
+    test("conversion with duplicated arguments", () => {
+        const result = convertBanTypes({
+            ruleArguments: ["!!!this-is-not-array!!!"],
+        });
+
+        expect(result).toEqual({
+            rules: [
+                {
+                    ruleName: "@typescript-eslint/ban-types",
+                },
+            ],
+        });
+    });
 });