diff --git a/README.md b/README.md index 2811f3f32..621cbe988 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ TSLint rules without ESLint equivalents will be wrapped with [eslint-plugin-tsli Each of these flags is optional: - **[`config`](#config)**: Path to print the generated ESLint configuration file to. +- **[`editor`](#editor)**: Path to an editor configuration file to convert linter settings within. - **[`eslint`](#eslint)**: Path to an ESLint configuration file to read settings from. - **[`package`](#package)**: Path to a package.json file to read dependencies from. - **[`tslint`](#tslint)**: Path to a TSLint configuration file to read settings from. @@ -59,6 +60,17 @@ The file extension of this path will be used to determine the format of the crea - `.js` file paths will be written `module.exports = ...` JavaScript - Other file paths will default to JSON +#### `editor` + +```shell +npx tslint-to-eslint-config --editor ./path/to/.vscode/settings.json +``` + +_Default: `.vscode/settings.json`_ + +Path to an editor configuration file to convert settings settings within. +Any VS Code style editor settings for TSLint will be converted to their ESLint equivalents. + #### `eslint` ```shell diff --git a/docs/Architecture.md b/docs/Architecture.md index 610fa0834..00ddfe402 100644 --- a/docs/Architecture.md +++ b/docs/Architecture.md @@ -4,9 +4,10 @@ 1. CLI usage starts in `bin/tslint-to-eslint-config`, which immediately calls `src/cli/main.ts`. 2. CLI settings are parsed and read in `src/cli/runCli.ts`. -3. Application logic is run by `src/conversion/convertConfig.ts`. +3. Linter configuration conversion is run by `src/conversion/convertConfig.ts`. +4. Editor configuration conversion is run by `src/conversion/convertEditorConfig.ts`. -## Configuration Conversion +## Linter Configuration Conversion Within `src/conversion/convertConfig.ts`, the following steps occur: @@ -46,3 +47,8 @@ It's possible that one ESLint rule will be output by multiple converters. These are located in `src/rules/mergers/`, and keyed under their names by the map in `src/rules/mergers.ts`. For example, `@typescript-eslint/ban-types` spreads both arguments' `types` members into one large `types` object. + +## Editor Configuration Conversion + +Editor lint configurations are converted by `src/editorSettings/convertEditorSettings.ts`. +Any setting that matches a known built-in TSLint setting will be replaced with the ESLint equivalent.