diff --git a/.changeset/calm-colts-sell.md b/.changeset/calm-colts-sell.md new file mode 100644 index 0000000..9e77c1b --- /dev/null +++ b/.changeset/calm-colts-sell.md @@ -0,0 +1,5 @@ +--- +"generator-single-spa": patch +--- + +fix generator util typescript project use @typescript-eslint/parser as eslint parser diff --git a/.changeset/flat-buttons-wonder.md b/.changeset/flat-buttons-wonder.md new file mode 100644 index 0000000..a51984f --- /dev/null +++ b/.changeset/flat-buttons-wonder.md @@ -0,0 +1,5 @@ +--- +"generator-single-spa": patch +--- + +fix generator typescript root-config project use @typescript-eslint/parser as eslint parser diff --git a/.changeset/ten-monkeys-chew.md b/.changeset/ten-monkeys-chew.md new file mode 100644 index 0000000..b99ab79 --- /dev/null +++ b/.changeset/ten-monkeys-chew.md @@ -0,0 +1,5 @@ +--- +"generator-single-spa": patch +--- + +fix generator react typescript application / parcel project use @typescript-eslint/parser as eslint parser diff --git a/packages/generator-single-spa/src/react/generator-single-spa-react.js b/packages/generator-single-spa/src/react/generator-single-spa-react.js index 372d4bc..a638380 100644 --- a/packages/generator-single-spa/src/react/generator-single-spa-react.js +++ b/packages/generator-single-spa/src/react/generator-single-spa-react.js @@ -86,8 +86,13 @@ 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); diff --git a/packages/generator-single-spa/src/react/templates/.eslintrc.ejs b/packages/generator-single-spa/src/react/templates/.eslintrc.ejs index 00d9bc6..aef3f2b 100644 --- a/packages/generator-single-spa/src/react/templates/.eslintrc.ejs +++ b/packages/generator-single-spa/src/react/templates/.eslintrc.ejs @@ -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"<% } %> } diff --git a/packages/generator-single-spa/src/react/templates/react.package.json b/packages/generator-single-spa/src/react/templates/react.package.json index 18e937f..28ac96e 100644 --- a/packages/generator-single-spa/src/react/templates/react.package.json +++ b/packages/generator-single-spa/src/react/templates/react.package.json @@ -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", diff --git a/packages/generator-single-spa/src/root-config/generator-root-config.js b/packages/generator-single-spa/src/root-config/generator-root-config.js index cf3b3dd..3b8bdbe 100644 --- a/packages/generator-single-spa/src/root-config/generator-root-config.js +++ b/packages/generator-single-spa/src/root-config/generator-root-config.js @@ -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); diff --git a/packages/generator-single-spa/src/root-config/templates/.eslintrc.ejs b/packages/generator-single-spa/src/root-config/templates/.eslintrc.ejs index 953305c..9d21f31 100644 --- a/packages/generator-single-spa/src/root-config/templates/.eslintrc.ejs +++ b/packages/generator-single-spa/src/root-config/templates/.eslintrc.ejs @@ -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"<% } %> } diff --git a/packages/generator-single-spa/src/root-config/templates/root-config.package.json b/packages/generator-single-spa/src/root-config/templates/root-config.package.json index 819f453..25a5d63 100644 --- a/packages/generator-single-spa/src/root-config/templates/root-config.package.json +++ b/packages/generator-single-spa/src/root-config/templates/root-config.package.json @@ -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", diff --git a/packages/generator-single-spa/src/util-module/generator-single-spa-util-module.js b/packages/generator-single-spa/src/util-module/generator-single-spa-util-module.js index 09a1a4f..b5e3c1e 100644 --- a/packages/generator-single-spa/src/util-module/generator-single-spa-util-module.js +++ b/packages/generator-single-spa/src/util-module/generator-single-spa-util-module.js @@ -80,8 +80,13 @@ module.exports = class SingleSpaUtilModuleGenerator 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}-${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); diff --git a/packages/generator-single-spa/src/util-module/templates/.eslintrc.ejs b/packages/generator-single-spa/src/util-module/templates/.eslintrc.ejs index 660a640..c4c656e 100644 --- a/packages/generator-single-spa/src/util-module/templates/.eslintrc.ejs +++ b/packages/generator-single-spa/src/util-module/templates/.eslintrc.ejs @@ -3,5 +3,5 @@ <%if (typescript) { %>"ts-important-stuff",<%} else { %>"important-stuff",<% } %> "plugin:prettier/recommended" ], - "parser": "@babel/eslint-parser" + "parser": <%if (typescript) { %>"@typescript-eslint/parser"<%} else { %>"@babel/eslint-parser"<% } %> } diff --git a/packages/generator-single-spa/src/util-module/templates/util-module.package.json b/packages/generator-single-spa/src/util-module/templates/util-module.package.json index 53e59ee..641f155 100644 --- a/packages/generator-single-spa/src/util-module/templates/util-module.package.json +++ b/packages/generator-single-spa/src/util-module/templates/util-module.package.json @@ -20,6 +20,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", "babel-jest": "^27.0.6", "concurrently": "^6.2.1", "cross-env": "^7.0.3",