Skip to content

Commit

Permalink
fix: use @typescript-eslint/parser when react typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
pmjhonwang committed Mar 2, 2022
1 parent c24c654 commit 5327435
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/ten-monkeys-chew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"generator-single-spa": patch
---

fix generator react typescript application / parcel project use @typescript-eslint/parser as eslint parser
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,12 @@ module.exports = class SingleSpaReactGenerator extends PnpmGenerator {
delete packageJson.devDependencies["webpack-config-single-spa"];
// Will be replaced by webpack-config-single-spa-react-ts
delete packageJson.devDependencies["webpack-config-single-spa-ts"];

// Will be replaced by @typescript-eslint/parser
delete packageJson.devDependencies["@babel/eslint-parser"];
packageJson.types = `dist/${this.options.orgName}-${this.options.projectName}.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
Expand Up @@ -3,5 +3,5 @@
<%if (typescript) { %>"ts-react-important-stuff",<%} else { %>"react-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 @@ -23,6 +23,7 @@
"@babel/runtime": "^7.15.3",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.0.0",
"@typescript-eslint/parser": "^5.13.0",
"babel-jest": "^27.0.6",
"concurrently": "^6.2.1",
"cross-env": "^7.0.3",
Expand Down

0 comments on commit 5327435

Please # to comment.