Skip to content

Commit

Permalink
fix: use @typescript-eslint/parser when root-config typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
pmjhonwang committed Mar 2, 2022
1 parent 2c38b0d commit 09217a8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/flat-buttons-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"generator-single-spa": patch
---

fix generator typescript root-config project use @typescript-eslint/parser as eslint parser
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,13 @@ module.exports = class SingleSpaRootConfigGenerator extends PnpmGenerator {
delete packageJson.devDependencies["eslint-config-important-stuff"];
// Will be replaced by webpack-config-single-spa-ts
delete packageJson.devDependencies["webpack-config-single-spa"];
// Will be replaced by @typescript-eslint/parser
delete packageJson.devDependencies["@babel/eslint-parser"];

packageJson.types = `dist/${this.options.orgName}-root-config.d.ts`;
} else {
// Will be replaced by @babel/eslint-parser
delete packageJson.devDependencies["@typescript-eslint/parser"];
}

this.fs.extendJSON(this.destinationPath("package.json"), packageJson);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": ["<% if (typescript) { %>ts-<% } %>important-stuff", "plugin:prettier/recommended"],
"parser": "@babel/eslint-parser"
"parser": <%if (typescript) { %>"@typescript-eslint/parser"<%} else { %>"@babel/eslint-parser"<% } %>
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@babel/plugin-transform-runtime": "^7.15.0",
"@babel/preset-env": "^7.15.0",
"@babel/runtime": "^7.15.3",
"@typescript-eslint/parser": "^5.13.0",
"concurrently": "^6.2.1",
"cross-env": "^7.0.3",
"eslint": "^7.32.0",
Expand Down

0 comments on commit 09217a8

Please sign in to comment.