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 lint breaking when deleting a side #2017

Merged
merged 4 commits into from
Mar 17, 2021
Merged

Fix lint breaking when deleting a side #2017

merged 4 commits into from
Mar 17, 2021

Conversation

mellow-fellow
Copy link
Contributor

@mellow-fellow mellow-fellow commented Mar 17, 2021

Fixes #2016

@github-actions
Copy link

github-actions bot commented Mar 17, 2021

📦 PR Packages

Click to Show Package Download Links

https://rw-pr-redwoodjs-com.s3.amazonaws.com/2017/create-redwood-app-0.27.1-3eb4ade.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2017/redwoodjs-api-0.27.1-3eb4ade.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2017/redwoodjs-api-server-0.27.1-3eb4ade.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2017/redwoodjs-auth-0.27.1-3eb4ade.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2017/redwoodjs-cli-0.27.1-3eb4ade.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2017/redwoodjs-core-0.27.1-3eb4ade.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2017/redwoodjs-dev-server-0.27.1-3eb4ade.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2017/redwoodjs-eslint-config-0.27.1-3eb4ade.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2017/redwoodjs-eslint-plugin-redwood-0.27.1-3eb4ade.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2017/redwoodjs-forms-0.27.1-3eb4ade.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2017/redwoodjs-internal-0.27.1-3eb4ade.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2017/redwoodjs-prerender-0.27.1-3eb4ade.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2017/redwoodjs-router-0.27.1-3eb4ade.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2017/redwoodjs-structure-0.27.1-3eb4ade.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2017/redwoodjs-testing-0.27.1-3eb4ade.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2017/redwoodjs-web-0.27.1-3eb4ade.tgz

Install this PR by running yarn rw upgrade --pr 2017:0.27.1-3eb4ade

Comment on lines 29 to 39
const options = []

if (fix) {
options.push('--fix')
}
if (webExists) {
options.push('web/src')
}
if (apiExists) {
options.push('api/src')
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this:

another way of writing this would be:

Suggested change
const options = []
if (fix) {
options.push('--fix')
}
if (webExists) {
options.push('web/src')
}
if (apiExists) {
options.push('api/src')
}
[
fix && '--fix',
webExists && 'web/src',
apiExists && 'api/src',
].filter(Boolean)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback. I've made those changes.

@Tobbe Tobbe linked an issue Mar 17, 2021 that may be closed by this pull request
Comment on lines 26 to 40
const paths = getPaths()
const webExists = fs.existsSync(paths.web.src)
const apiExists = fs.existsSync(paths.api.src)

execa(
'yarn eslint',
[fix && '--fix', webExists && 'web/src', apiExists && 'api/src'].filter(
Boolean
),
{
cwd: paths.base,
shell: true,
stdio: 'inherit',
}
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const paths = getPaths()
const webExists = fs.existsSync(paths.web.src)
const apiExists = fs.existsSync(paths.api.src)
execa(
'yarn eslint',
[fix && '--fix', webExists && 'web/src', apiExists && 'api/src'].filter(
Boolean
),
{
cwd: paths.base,
shell: true,
stdio: 'inherit',
}
)
execa(
'yarn eslint',
[
fix && '--fix',
fs.existsSync(getPaths().web.src) && 'web/src',
fs.existsSync(getPaths().api.src) && 'api/src',
].filter(Boolean),
{
cwd: getPaths().base,
shell: true,
stdio: 'inherit',
}
)

This is silly, but because doing it this way makes prettier keep the array elements on separate lines, I like this more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problemo

@peterp peterp merged commit 8a76282 into redwoodjs:main Mar 17, 2021
@peterp peterp added this to the next release milestone Mar 17, 2021
dac09 added a commit to dac09/redwood that referenced this pull request Mar 22, 2021
…r-rwt-link

* 'main' of github.com:redwoodjs/redwood: (26 commits)
  Router: Fix auth (redwoodjs#2038)
  Steps towards a11y for Redwood Router (redwoodjs#1817)
  Router: <Set wrap={}> (redwoodjs#1898)
  Pass event and context into getCurrentUser (redwoodjs#1908)
  Implement Redwood API side Logger (redwoodjs#1937)
  Fixed path on windows to allow for pages under subdirectories (redwoodjs#2022)
  Add experimental ESBuild for api side (redwoodjs#1948)
  Upgrade to Prisma 2.19.0 (Prisma Migrate GA) (redwoodjs#2021)
  Fix lint breaking when deleting a side (redwoodjs#2017)
  Refactor: Converted Prisma.ts to js (redwoodjs#1958)
  Fix issue with verify email redirect using Auth0 (redwoodjs#1990)
  add GitHub Action CodeQL Analysis (redwoodjs#1951)
  fix: correct var name for grabbing user config (redwoodjs#2002)
  Create functions to fs calls (redwoodjs#2007)
  Return signup Output (redwoodjs#1992)
  Add makeExecSchema options (redwoodjs#1964)
  upgrade gotrue-js to 0.9.29 (redwoodjs#2011)
  Azure Active Directory Auth: Adding try-catch block on callback to capture empty key (redwoodjs#2010)
  withCellHOC: Fix TS error (redwoodjs#1967)
  Update error message in tasks/publish-local to point to tasks/run-local-npm when Verdaccio isn't running (redwoodjs#2004)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linting breaks when disabling side
3 participants