Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: simplify ESLint config to improve dependency management #2883

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion boilerplate/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// https://docs.expo.dev/guides/using-eslint/
module.exports = {
extends: [
"standard",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-native/all",
Expand Down
4 changes: 0 additions & 4 deletions boilerplate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"main": "App.tsx",
"scripts": {
"compile": "tsc --noEmit -p . --pretty",
"format": "eslint . --fix",
"lint": "eslint . --fix",
"lint:check": "eslint .",
"patch": "patch-package",
Expand Down Expand Up @@ -76,10 +75,7 @@
"eslint": "^8.57.0",
"eslint-config-expo": "~8.0.1",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-n": "^17.10.2",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-promise": "^7.1.0",
"eslint-plugin-react-native": "^4.1.0",
"eslint-plugin-reactotron": "^0.1.2",
"jest": "^29.2.1",
Expand Down
10 changes: 2 additions & 8 deletions src/commands/new.ts
Original file line number Diff line number Diff line change
Expand Up @@ -750,18 +750,12 @@ module.exports = {
// do base install
const installCmd = packager.installCmd({ packagerName })
await system.run(installCmd, { onProgress: log })
// If they chose npm and also Expo Router, we need to run npm install ajv@^8 --legacy-peer-deps.
// see https://github.com/infinitered/ignite/issues/2840
if (packagerName === "npm" && experimentalExpoRouter) {
await system.run(`npm install ajv@^8 --legacy-peer-deps`, { onProgress: log })
}
// now that expo is installed, we can run their install --fix for best Expo SDK compatibility
// for right now, we don't do this in CI because it returns a non-zero exit code
// see https://docs.expo.dev/more/expo-cli/#version-validation
if (process.env.CI !== "true") {
const forwardOptions = packagerName === "npm" ? " -- --legacy-peer-deps" : ""
log("Running `npx expo install --fix...`")
await system.run(`npx expo install --fix${forwardOptions}`, { onProgress: log })
await system.run(`npx expo install --fix`, { onProgress: log })
}

stopSpinner(unboxingMessage, "🧶")
Expand Down Expand Up @@ -897,7 +891,7 @@ module.exports = {
startSpinner(formattingMessage)
if (installDeps === true) {
// Make sure all our modifications are formatted nicely
await packager.run("format", { ...packagerOptions })
await packager.run("lint", { ...packagerOptions })
} else {
// if our linting configuration is not installed, try format
// using prettier to make sure it's reasonably close, but this will skip
Expand Down
2 changes: 1 addition & 1 deletion src/tools/packager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function installCmd(options: PackageRunOptions) {
} else if (options.packagerName === "yarn") {
return `yarn install${silent}`
} else if (options.packagerName === "npm") {
return `npm install${silent} --legacy-peer-deps`
return `npm install${silent}`
} else if (options.packagerName === "bun") {
return `bun install${silent}`
} else {
Expand Down