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

webui: Integrate eslint-config-yscope and refactor accordingly. #351

Merged
merged 81 commits into from
Apr 16, 2024

Conversation

junhaoliao
Copy link
Member

@junhaoliao junhaoliao commented Apr 8, 2024

References

Internal discussions concluded that eslint-config-yscope shall be integrated to aid development process.

Description

  1. Add eslint-config-yscope.
  2. Configure @babel/plugin-transform-react-jsx to avoid explicit React imports; Remove .jsx extensions from import statements.
  3. Upgrade React to version 18.2.0 and replace deprecated import("react-dom").render() with ReactDOM.createRoot(...).render().
  4. Correct destructed param docs.
  5. Import React Bootstrap elements as needed since the library's "Tree-shaking doesn't work reliably enough".
  6. Remove component-level SCSS imports from App.scss.
  7. Use font Roboto Mono for search result table row texts.
  8. Rename Source Sans Pro with Source Sans 3 and upgrade the fetching fonts.googleapis to v2.
  9. Add meteortesting:mocha to .meteor/packages to avoid related dependencies determined "unused" and got removed when meteor starts.
  10. Reformat / Refactor components.

Validation performed

  1. Built and tested WebUI in the clp-package.
  2. Followed instructions in components/webui/README.md to install Node.js dependencies for running the linter.
  3. Made a "trailling space" violation in server/main.js. Ran newly added linting scripts in package.json:
    1. npm run lint:check:

      $ npm run lint:check
      
      > lint:check
      > eslint client imports server tests launcher.js
      
      
      /home/junhao/workspace/clp/components/webui/server/main.js
        3:9  error  Trailing spaces not allowed  @stylistic/js/no-trailing-spaces
      
      ✖ 1 problem (1 error, 0 warnings)
        1 error and 0 warnings potentially fixable with the `--fix` option.
      
    2. npm run lint:fix:

      $ npm run lint:fix
      
      > lint:fix
      > eslint --fix client imports server tests launcher.js
      
      
    3. npm run lint (alias of npm run lint:check):

      $ npm run lint
      
      > lint
      > npm run lint:check
      
      
      > lint:check
      > eslint client imports server tests launcher.js
      
      

Copy link
Member

@kirkrodrigues kirkrodrigues left a comment

Choose a reason for hiding this comment

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

A few more small changes.

Copy link
Member

@kirkrodrigues kirkrodrigues left a comment

Choose a reason for hiding this comment

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

How about:

webui: Integrate eslint-config-yscope and refactor accordingly. (#351)

@junhaoliao junhaoliao changed the title webui: Integrate eslint-config-yscope and refactor. webui: Integrate eslint-config-yscope and refactor accordingly. Apr 16, 2024
@junhaoliao junhaoliao merged commit 2b55f93 into y-scope:main Apr 16, 2024
1 check passed
@junhaoliao junhaoliao deleted the eslint branch April 16, 2024 04:24
@junhaoliao junhaoliao changed the title webui: Integrate eslint-config-yscope and refactor accordingly. webui: Integrate eslint-config-yscope and refactor accordingly. Apr 16, 2024
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.

3 participants