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

feat(spec): eslint with custom rules APIC-387 #304

Merged
merged 10 commits into from
Apr 1, 2022
Merged

Conversation

millotp
Copy link
Collaborator

@millotp millotp commented Mar 29, 2022

🧭 What and Why

🎟 JIRA Ticket: APIC-387

Create custom package for eslint rules, only for yaml for now but can work with other parsers too.
You need to run yarn build:eslint to make it work, I don't know how to include it in the yarn install process.

Changes included:

  • Create custom package
  • Add description-dot rule to check for dot at the end of descriptions.

🧪 Test

yarn workspace eslint test

@millotp millotp requested a review from a team March 29, 2022 08:19
@millotp millotp self-assigned this Mar 29, 2022
@millotp millotp requested review from eunjae-lee and shortcuts and removed request for a team March 29, 2022 08:19
@netlify
Copy link

netlify bot commented Mar 29, 2022

Deploy Preview for api-clients-automation canceled.

Name Link
🔨 Latest commit a2cff83
🔍 Latest deploy log https://app.netlify.com/sites/api-clients-automation/deploys/62470374f6fbc400084c6e32

@algolia-bot
Copy link
Collaborator

algolia-bot commented Mar 29, 2022

✗ The generated branch has been deleted.

If the PR has been merged, you can check the generated code on the generated/main branch.

@shortcuts
Copy link
Member

You need to run yarn build:eslint to make it work, I don't know how to include it in the yarn install process.

Isn't postinstall still available on yarn berry? Or there might be a plugin for it

Have you also tried the custom rules solution of our current tooling? It seems to require less setup https://redocly.com/docs/cli/resources/custom-rules/

@millotp
Copy link
Collaborator Author

millotp commented Mar 29, 2022

postinstall could work but I need to run yarn install after building to register the change, it can lead to infinite loop.
I can't find if redocly linter works with typescript, it only look like js in the doc

@millotp millotp changed the title feat(specs): eslint with custom rules APIC-387 feat(spec): eslint with custom rules APIC-387 Mar 31, 2022
@@ -66,6 +66,9 @@ jobs:
- name: Test scripts
run: yarn scripts:test

- name: Test custom eslint plugin
run: yarn workspace eslint test
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be yarn workspace eslint-plugin-automation-custom test?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep I forgot to change it, thanks !

@millotp millotp marked this pull request as draft April 1, 2022 08:38
@millotp millotp marked this pull request as ready for review April 1, 2022 09:48
@millotp millotp requested a review from eunjae-lee April 1, 2022 09:48
if (
typeof value.value !== 'string' ||
value.value.trim().endsWith('.') ||
!value.value.trim().includes(' ')
Copy link
Contributor

Choose a reason for hiding this comment

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

what does it mean?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've added a comment for clarity

@@ -747,7 +747,7 @@ components:
type: integer
description: >-
The number of hits selected and sorted by the relevant sort
algorithm
algorithm.
Copy link
Contributor

Choose a reason for hiding this comment

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

cool to see it's working correctly with multi-line description

@millotp millotp enabled auto-merge (squash) April 1, 2022 13:55
@millotp millotp merged commit e625c88 into main Apr 1, 2022
@millotp millotp deleted the feat/eslint-yml branch April 1, 2022 14:01
algolia-bot added a commit to algolia/algoliasearch-client-javascript that referenced this pull request Apr 1, 2022
algolia-bot added a commit to algolia/algoliasearch-client-java that referenced this pull request Apr 1, 2022
algolia-bot added a commit to algolia/algoliasearch-client-php that referenced this pull request Apr 1, 2022
shortcuts pushed a commit that referenced this pull request Apr 22, 2022
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.

4 participants