From 2ab0092a8352cb885fbd3163eb52e5ce67a492fe Mon Sep 17 00:00:00 2001 From: Tyler Scott Williams Date: Sun, 12 Jan 2025 14:16:20 -0500 Subject: [PATCH] fix(boilerplate): simplify ESLint config (#2883 by @coolsoftwaretyler) * fix: drop eslint plugin n * fix: drop eslint standard as well * chore: remove duplicative script * ci: swap command in test * ci: revert * fix: update command name in new --- boilerplate/.eslintrc.js | 1 - boilerplate/package.json | 4 ---- src/commands/new.ts | 10 ++-------- src/tools/packager.ts | 2 +- 4 files changed, 3 insertions(+), 14 deletions(-) diff --git a/boilerplate/.eslintrc.js b/boilerplate/.eslintrc.js index 753cb6fd2..c3c2cb44d 100644 --- a/boilerplate/.eslintrc.js +++ b/boilerplate/.eslintrc.js @@ -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", diff --git a/boilerplate/package.json b/boilerplate/package.json index 68e1f3955..8e33252fb 100644 --- a/boilerplate/package.json +++ b/boilerplate/package.json @@ -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", @@ -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", diff --git a/src/commands/new.ts b/src/commands/new.ts index 5b864cb63..b380dae4e 100644 --- a/src/commands/new.ts +++ b/src/commands/new.ts @@ -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, "🧶") @@ -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 diff --git a/src/tools/packager.ts b/src/tools/packager.ts index 188dce9ff..15dcbd7ed 100644 --- a/src/tools/packager.ts +++ b/src/tools/packager.ts @@ -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 {