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

Run format scripts on workspaces directory #81

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

bryceosterhaus
Copy link

@bryceosterhaus bryceosterhaus commented Jan 24, 2023

Hey @allen-ziegenfus!

I added support for running our lint and format scripts via npx.

The two commands I run are

npx liferay-npm-scripts lint:fix --experimental-standalone

And then followed by

npx liferay-npm-scripts format --experimental-standalone

The first script will also generate error messages for items that we can't auto-fix. Some of the warnings you can probably ignore, such as @liferay/portal/no-global-fetch since workspaces doesn't have access to frontend-js-web.

I wasn't able to get this working in our ant format-source tasks, so I think the best way to do this is just manually run it for now.

Let me know if you have any issues.

Here is the output of eslint non-fixable errors

/Users/bryceosterhaus/repos/liferay-portal/workspaces/sample-default-workspace/client-extensions/fox-remote-app/src/common/services/liferay/api.js
  6:9  error  Direct usage of the `fetch` API is discouraged in favour of our wrapped version that takes care of the necessary security configuration; import fetch from frontend-js-web instead  @liferay/portal/no-global-fetch

/Users/bryceosterhaus/repos/liferay-portal/workspaces/sample-default-workspace/client-extensions/fox-remote-app/src/common/services/liferay/liferay.js
  7:29  error  'serviceName' is defined but never used. Allowed unused args must match /^_/u.  no-unused-vars
  10:20  error  'options' is defined but never used. Allowed unused args must match /^_/u.  no-unused-vars
  13:30  error  'userAgentApplicationId' is defined but never used. Allowed unused args must match /^_/u.  no-unused-vars
  16:16  error  'options' is assigned a value but never used.  no-unused-vars

/Users/bryceosterhaus/repos/liferay-portal/workspaces/sample-default-workspace/client-extensions/fox-remote-app/src/index.js
  45:3  error  Direct use of ReactDOM.render is discouraged; instead, use the <react:component /> JSP taglib, or do: import {render} from 'frontend-js-react-web';  @liferay/portal/no-react-dom-render
  54:4  error  Expected catch() or return  promise/catch-or-return

/Users/bryceosterhaus/repos/liferay-portal/workspaces/sample-minimal-workspace/client-extensions/fox-remote-app/src/common/services/liferay/api.js
  6:9  error  Direct usage of the `fetch` API is discouraged in favour of our wrapped version that takes care of the necessary security configuration; import fetch from frontend-js-web instead  @liferay/portal/no-global-fetch

/Users/bryceosterhaus/repos/liferay-portal/workspaces/sample-minimal-workspace/client-extensions/fox-remote-app/src/common/services/liferay/liferay.js
  7:29  error  'serviceName' is defined but never used. Allowed unused args must match /^_/u.  no-unused-vars
  10:20  error  'options' is defined but never used. Allowed unused args must match /^_/u.  no-unused-vars
  13:30  error  'userAgentApplicationId' is defined but never used. Allowed unused args must match /^_/u.  no-unused-vars
  16:16  error  'options' is assigned a value but never used.  no-unused-vars

/Users/bryceosterhaus/repos/liferay-portal/workspaces/sample-minimal-workspace/client-extensions/fox-remote-app/src/index.js
  45:3  error  Direct use of ReactDOM.render is discouraged; instead, use the <react:component /> JSP taglib, or do: import {render} from 'frontend-js-react-web';  @liferay/portal/no-react-dom-render
  54:4  error  Expected catch() or return  promise/catch-or-return

/Users/bryceosterhaus/repos/liferay-portal/workspaces/sample-default-workspace/client-extensions/fox-remote-app/src/common/styles/index.scss
  1:1  error  Unexpected unknown type selector "fox-remote-app" (selector-type-no-unknown)  selector-type-no-unknown

/Users/bryceosterhaus/repos/liferay-portal/workspaces/sample-minimal-workspace/client-extensions/fox-remote-app/src/common/styles/index.scss
  1:1  error  Unexpected unknown type selector "fox-remote-app" (selector-type-no-unknown)  selector-type-no-unknown

✖ 16 problems (16 errors, 0 warnings)

@liferay-continuous-integration
Copy link
Collaborator

To conserve resources, the PR Tester does not automatically run for every pull.

If your code changes were already tested in another pull, reference that pull in this pull so the test results can be analyzed.

If your pull was never tested, comment "ci:test" to run the PR Tester for this pull.

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.

2 participants