Skip to content

Commit f9aec3b

Browse files
author
Josh Goldberg
authored
Added README.md and architecture docs for --editor (#288)
1 parent 204edfe commit f9aec3b

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ TSLint rules without ESLint equivalents will be wrapped with [eslint-plugin-tsli
3939
Each of these flags is optional:
4040

4141
- **[`config`](#config)**: Path to print the generated ESLint configuration file to.
42+
- **[`editor`](#editor)**: Path to an editor configuration file to convert linter settings within.
4243
- **[`eslint`](#eslint)**: Path to an ESLint configuration file to read settings from.
4344
- **[`package`](#package)**: Path to a package.json file to read dependencies from.
4445
- **[`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
5960
- `.js` file paths will be written `module.exports = ...` JavaScript
6061
- Other file paths will default to JSON
6162

63+
#### `editor`
64+
65+
```shell
66+
npx tslint-to-eslint-config --editor ./path/to/.vscode/settings.json
67+
```
68+
69+
_Default: `.vscode/settings.json`_
70+
71+
Path to an editor configuration file to convert settings settings within.
72+
Any VS Code style editor settings for TSLint will be converted to their ESLint equivalents.
73+
6274
#### `eslint`
6375

6476
```shell

docs/Architecture.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
1. CLI usage starts in `bin/tslint-to-eslint-config`, which immediately calls `src/cli/main.ts`.
66
2. CLI settings are parsed and read in `src/cli/runCli.ts`.
7-
3. Application logic is run by `src/conversion/convertConfig.ts`.
7+
3. Linter configuration conversion is run by `src/conversion/convertConfig.ts`.
8+
4. Editor configuration conversion is run by `src/conversion/convertEditorConfig.ts`.
89

9-
## Configuration Conversion
10+
## Linter Configuration Conversion
1011

1112
Within `src/conversion/convertConfig.ts`, the following steps occur:
1213

@@ -46,3 +47,8 @@ It's possible that one ESLint rule will be output by multiple converters.
4647
These are located in `src/rules/mergers/`, and keyed under their names by the map in `src/rules/mergers.ts`.
4748

4849
For example, `@typescript-eslint/ban-types` spreads both arguments' `types` members into one large `types` object.
50+
51+
## Editor Configuration Conversion
52+
53+
Editor lint configurations are converted by `src/editorSettings/convertEditorSettings.ts`.
54+
Any setting that matches a known built-in TSLint setting will be replaced with the ESLint equivalent.

0 commit comments

Comments
 (0)