Skip to content

Commit 54590cf

Browse files
author
Josh Goldberg
authored
Always included typescript-eslint parser (#25)
Fixes #12.
1 parent 1f8f414 commit 54590cf

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

src/creation/createNewConfiguration.test.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { createNewConfiguration } from "./createNewConfiguration";
33
import { ConfigConversionResults } from "../rules/convertRules";
44

55
describe("createNewConfiguration", () => {
6-
it("writes only formatted rules when there are no missing rules", async () => {
6+
it("excludes the tslint plugin when there are no missing rules", async () => {
77
// Arrange
88
const conversionResults: ConfigConversionResults = {
99
...emptyConversionResults,
@@ -17,7 +17,17 @@ describe("createNewConfiguration", () => {
1717
// Assert
1818
expect(writeFile).toHaveBeenLastCalledWith(
1919
".eslintrc.json",
20-
JSON.stringify({ rules: {} }, undefined, 4),
20+
JSON.stringify(
21+
{
22+
parser: "@typescript-eslint/parser",
23+
parserOptions: {
24+
project: "tsconfig.json",
25+
},
26+
rules: {},
27+
},
28+
undefined,
29+
4,
30+
),
2131
);
2232
});
2333

@@ -44,11 +54,11 @@ describe("createNewConfiguration", () => {
4454
".eslintrc.json",
4555
JSON.stringify(
4656
{
47-
plugins: ["@typescript-eslint/tslint"],
4857
parser: "@typescript-eslint/parser",
4958
parserOptions: {
5059
project: "tsconfig.json",
5160
},
61+
plugins: ["@typescript-eslint/tslint"],
5262
rules: {
5363
"@typescript-eslint/tslint/config": [
5464
"error",

src/creation/createNewConfiguration.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ export const createNewConfiguration = async (
88
writeFile: WriteFile,
99
) => {
1010
const output = {
11+
parser: "@typescript-eslint/parser",
12+
parserOptions: {
13+
project: "tsconfig.json",
14+
},
1115
...(conversionResults.missing.length && {
1216
plugins: ["@typescript-eslint/tslint"],
13-
parser: "@typescript-eslint/parser",
14-
parserOptions: {
15-
project: "tsconfig.json",
16-
},
1717
}),
1818
rules: formatConvertedRules(conversionResults),
1919
};

0 commit comments

Comments
 (0)