Skip to content

docs: Added eslint markdown plugin and fixed all critical errors#414

Merged
pweglik merged 3 commits intomainfrom
@pw/fix-formatting-in-docs
Jun 24, 2025
Merged

docs: Added eslint markdown plugin and fixed all critical errors#414
pweglik merged 3 commits intomainfrom
@pw/fix-formatting-in-docs

Conversation

@pweglik
Copy link
Copy Markdown
Contributor

@pweglik pweglik commented Jun 23, 2025

Description

Added eslint markdown plugin to format code blocks in docs using our eslint config.
I corrected critical errors (mostly "...") so blocks are correctly formatted.
It also generates a lot of new warnings (no-unused-vars) - we can safely ignore most of them, but when you produce new piece of docs you should monitor them, if they can be safely ignored, or did you misspell the variable you declared before that. We cannot enable no-undef-vars because it produces too many warnings (every JSX tag etc.), so we have to rely on those no-unused-vars warnings:

Screenshot 2025-06-23 at 12 56 40

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (improves or adds clarity to existing documentation)

Related issues

Checklist

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes generate no new warnings - they do

Additional notes

Comment thread .eslintrc.js
'react-hooks/rules-of-hooks': 'off',
'react/jsx-no-undef': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'camelcase': 'warn',
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

to tylko dlatego, że wywalało sie jakieś jedno randomo miejsce w TextEmbeddingsModule.md, nie chce mi się rozkminiać dlaczego więc errcor -> warning chwilowo

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you write wich line caused the error?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is super weird - I'm not really sure why is it bothered by All_MINILM_L6_V2_TOKENIZER but not by ALL_MINILM_L6_V2. Super weird so I decided not to spend time on it
Screenshot 2025-06-24 at 10 30 16

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can use // eslint-disable-next-line camelcase for only this line

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It will be visible in docs then. I'd say we don't want

import {
  TextEmbeddingsModule,
  ALL_MINILM_L6_V2,
  // eslint-disable-next-line
  All_MINILM_L6_V2_TOKENIZER,
} from 'react-native-executorch';

// Loading the model
await TextEmbeddingsModule.load(ALL_MINILM_L6_V2, All_MINILM_L6_V2_TOKENIZER);

// Running the model
const embedding = await TextEmbeddingsModule.forward('Hello World!');

in our docs right?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

yep, not the cleanest look, especially since it is not an error present in the code itself


```typescript
modelSource: 'file::///var/mobile/.../llama3_2.pte',
modelSource: 'file::///var/mobile/.../llama3_2.pte';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this doesn't seem correct, maybe add some more code around this to make this correct

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've added useExecutorchModule so it feels more natural


// Rest of your code...
const mySpanishAudio = ...;
const mySpanishAudio = 'https://some-audio-url.com/spanish-file.mp3';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

either do this way or '...' like below to keep it consistent

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

@pweglik pweglik requested a review from mkopcins June 24, 2025 08:40
@pweglik pweglik merged commit 0787eca into main Jun 24, 2025
3 checks passed
@pweglik pweglik deleted the @pw/fix-formatting-in-docs branch June 24, 2025 08:46
mkopcins pushed a commit that referenced this pull request Oct 15, 2025
## Description

Added eslint markdown plugin to format code blocks in docs using our
eslint config.
I corrected critical errors (mostly "...") so blocks are correctly
formatted.
It also generates a lot of new warnings (`no-unused-vars`) - we can
safely ignore most of them, but when you produce new piece of docs you
should monitor them, if they can be safely ignored, or did you misspell
the variable you declared before that. We cannot enable `no-undef-vars`
because it produces too many warnings (every JSX tag etc.), so we have
to rely on those `no-unused-vars` warnings:


<img width="999" alt="Screenshot 2025-06-23 at 12 56 40"
src="https://github.com/user-attachments/assets/c2335831-b48d-433c-8077-5dfcb2b29c16"
/>

### Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [x] Documentation update (improves or adds clarity to existing
documentation)

### Related issues

<!-- Link related issues here using #issue-number -->

### Checklist

- [x] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [x] I have updated the documentation accordingly
- [ ] My changes generate no new warnings - they do

### Additional notes

<!-- Include any additional information, assumptions, or context that
reviewers might need to understand this PR. -->
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