Skip to content

Commit 67b4d66

Browse files
committed
Merge branch 'master' into feature/opt-in-flag-convert-disable-comments
2 parents 8cb8c06 + 88b5a61 commit 67b4d66

File tree

79 files changed

+3055
-1097
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+3055
-1097
lines changed

.eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,13 @@ module.exports = {
2626
"@typescript-eslint/no-parameter-properties": "off",
2727
"@typescript-eslint/no-type-alias": "off",
2828
"@typescript-eslint/no-unnecessary-condition": "off",
29+
"@typescript-eslint/no-untyped-public-signature": "off",
2930
"@typescript-eslint/no-use-before-define": "off",
3031
"@typescript-eslint/require-await": "off",
32+
"@typescript-eslint/restrict-template-expressions": "off",
33+
"@typescript-eslint/return-await": "off",
3134
"@typescript-eslint/strict-boolean-expressions": "off",
3235
"@typescript-eslint/typedef": "off",
36+
"no-else-return": "error",
3337
},
3438
};

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[![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)
99
[![Code Style: Prettier](https://img.shields.io/badge/speed-blazingly_fast-blueviolet.svg)](https://prettier.io)
1010

11-
Converts your TSLint configuration to the closest possible ESLint equivalent.
11+
Converts your TSLint configuration to the closest reasonable ESLint equivalent.
1212

1313
👉 Did you know [TSLint is being deprecated this year](https://github.com/palantir/tslint/issues/4534)?
1414
Hooray!
@@ -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

babel.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
module.exports = {
22
presets: [["@babel/preset-env", { targets: { node: "current" } }], "@babel/preset-typescript"],
3+
plugins: [
4+
"@babel/plugin-proposal-nullish-coalescing-operator",
5+
"@babel/plugin-proposal-optional-chaining",
6+
],
37
};

bin/tslint-to-eslint-config

100644100755
File mode changed.

docs/Architecture.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@
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

1314
1. Existing configurations are read from disk
1415
2. TSLint rules are converted into their ESLint configurations
15-
3. ESLint configurations are simplified based on extended ESLint presets
16+
3. ESLint configurations are simplified based on extended ESLint and TSLint presets
1617
4. The simplified configuration is written to the output config file
1718
5. A summary of the results is printed to the user's console
1819

@@ -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.

jest.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ module.exports = {
44
"!./src/**/*.d.ts",
55
"!./src/**/*.stubs.ts",
66
"!./src/adapters/*.ts",
7-
"!./src/rules/converters.ts",
7+
"!./src/rules/rulesConverters.ts",
8+
"!./src/editorSettings/editorSettingsConverters.ts",
89
"!./src/rules/mergers.ts",
910
"!./src/cli/main.ts",
1011
],

0 commit comments

Comments
 (0)