Skip to content

feature/valalint#1025

Merged
bert-e merged 3 commits intodevelopment/1.0from
feature/CUI-2-valalint
Mar 5, 2026
Merged

feature/valalint#1025
bert-e merged 3 commits intodevelopment/1.0from
feature/CUI-2-valalint

Conversation

@damiengillesscality
Copy link
Copy Markdown
Contributor

@damiengillesscality damiengillesscality commented Mar 4, 2026

Resolves https://scality.atlassian.net/browse/CUI-2 by implementing an EsLint rule plugin that check for capitalisation issues.
It can be used easily by configuring projects like this:

import valalint from '@scality/core-ui/eslint-plugin';

export default [
  {
    files: ['**/*.{js,jsx,ts,tsx}'],
    ignores: ['src/gen/**'],
    ...valalint.configs['flat/recommended'],
  },
];

The rule is also tested using the existing jest setup. I updated a few import in the test files that where still using CommonJs notation to be able to use type: module in package.json.

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented Mar 4, 2026

Hello damiengillesscality,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented Mar 4, 2026

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

@MonPote
Copy link
Copy Markdown
Contributor

MonPote commented Mar 4, 2026

@damiengillesscality I'm trying to use it in metalk8s.

I have this :

-> % npm run lint

> metalk8s-platform-ui@0.1.0 lint
> eslint .


Oops! Something went wrong! :(

ESLint: 10.0.2

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@typescript-eslint/parser' imported from /Users/patrickear/Scality/metalk8s/ui/node_modules/@scality/core-ui/src/lib/valalint/index.js
    at packageResolve (node:internal/modules/esm/resolve:873:9)
    at moduleResolve (node:internal/modules/esm/resolve:946:18)
    at defaultResolve (node:internal/modules/esm/resolve:1188:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:642:12)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:591:25)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:574:38)
    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:236:38)
    at ModuleJob._link (node:internal/modules/esm/module_job:130:49)
patrickear@Patricks-MacBook-Pro [19:01:00] [~/Scality/metalk8s/ui] [imp

I guess we need to have @typescript-eslint/parser in our devDeps. Do you think it's necessary to have it in core-ui peerDeps ?

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented Mar 5, 2026

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

@damiengillesscality
Copy link
Copy Markdown
Contributor Author

I think the solution is to move @typescript-eslint/parser from devDeps to deps. This wont change our front end build size and core ui will be installed with the tools to use the linting rules. I've made a commit to do that let me know if it is fine for you.

@damiengillesscality I'm trying to use it in metalk8s.

I have this :

-> % npm run lint

> metalk8s-platform-ui@0.1.0 lint
> eslint .


Oops! Something went wrong! :(

ESLint: 10.0.2

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@typescript-eslint/parser' imported from /Users/patrickear/Scality/metalk8s/ui/node_modules/@scality/core-ui/src/lib/valalint/index.js
    at packageResolve (node:internal/modules/esm/resolve:873:9)
    at moduleResolve (node:internal/modules/esm/resolve:946:18)
    at defaultResolve (node:internal/modules/esm/resolve:1188:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:642:12)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:591:25)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:574:38)
    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:236:38)
    at ModuleJob._link (node:internal/modules/esm/module_job:130:49)
patrickear@Patricks-MacBook-Pro [19:01:00] [~/Scality/metalk8s/ui] [imp

I guess we need to have @typescript-eslint/parser in our devDeps. Do you think it's necessary to have it in core-ui peerDeps ?

@MonPote
Copy link
Copy Markdown
Contributor

MonPote commented Mar 5, 2026

I think the solution is to move @typescript-eslint/parser from devDeps to deps. This wont change our front end build size and core ui will be installed with the tools to use the linting rules. I've made a commit to do that let me know if it is fine for you.

@damiengillesscality I'm trying to use it in metalk8s.
I have this :

-> % npm run lint

> metalk8s-platform-ui@0.1.0 lint
> eslint .


Oops! Something went wrong! :(

ESLint: 10.0.2

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@typescript-eslint/parser' imported from /Users/patrickear/Scality/metalk8s/ui/node_modules/@scality/core-ui/src/lib/valalint/index.js
    at packageResolve (node:internal/modules/esm/resolve:873:9)
    at moduleResolve (node:internal/modules/esm/resolve:946:18)
    at defaultResolve (node:internal/modules/esm/resolve:1188:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:642:12)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:591:25)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:574:38)
    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:236:38)
    at ModuleJob._link (node:internal/modules/esm/module_job:130:49)
patrickear@Patricks-MacBook-Pro [19:01:00] [~/Scality/metalk8s/ui] [imp

I guess we need to have @typescript-eslint/parser in our devDeps. Do you think it's necessary to have it in core-ui peerDeps ?

Yes I was thinking about that too, i was not sure about the impact to our UIs.
It works now ^^

@MonPote
Copy link
Copy Markdown
Contributor

MonPote commented Mar 5, 2026

@damiengillesscality Can you check why it show a warning for this case ?

      <Text variant="Smaller" style={{ fontStyle: 'italic', color: '#666' }}>
        No nodes found {quantileName === 'Q90' ? 'above' : 'below'} threshold
      </Text>

@damiengillesscality
Copy link
Copy Markdown
Contributor Author

<Text variant="Smaller" style={{ fontStyle: 'italic', color: '#666' }}>
        No nodes found {quantileName === 'Q90' ? 'above' : 'below'} threshold
      </Text>

Their was a bug, this created multiple jsx text element and it treated them each as sentence. So it expected a capitalized letter on threshold. this is fixed.

Copy link
Copy Markdown
Contributor

@MonPote MonPote left a comment

Choose a reason for hiding this comment

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

LGTM

@damiengillesscality
Copy link
Copy Markdown
Contributor Author

/approve

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented Mar 5, 2026

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/1.0

Please check the status of the associated issue CUI-2.

Goodbye damiengillesscality.

The following options are set: approve

@bert-e bert-e merged commit a528e0a into development/1.0 Mar 5, 2026
4 checks passed
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