Skip to content

Commit

Permalink
fix(boilerplate): simplify ESLint config (#2883 by @coolsoftwaretyler)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
coolsoftwaretyler authored Jan 12, 2025
1 parent debbcc8 commit 2ab0092
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 14 deletions.
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

0 comments on commit 2ab0092

Please sign in to comment.