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

[Docs] Fix code syntax highlighting #3563

Merged

Conversation

nbsp1221
Copy link
Contributor

@nbsp1221 nbsp1221 commented Apr 22, 2023

I fixed the issue with code syntax highlighting that caused a red background line to appear.

Before
image

After
image

@ljharb
Copy link
Member

ljharb commented Apr 23, 2023

These are meant to be json, though, not js

@nbsp1221
Copy link
Contributor Author

These are meant to be json, though, not js

Yes, you're right. It's just a trick.

The original format is JSON, but there were syntax elements such as ..., <enabled>, which are not compatible with JSON and caused the highlighting to break. Therefor, like other examples, I used js.

```js
...
"react/boolean-prop-naming": [<enabled>, {
"propTypeNames": Array<string>,
"rule": <string>,
"message": <string>,
"validateNested": <boolean>
}]
...
```

@nbsp1221 nbsp1221 force-pushed the docs/fix-code-syntax-highlighting branch from 66958f4 to bf97220 Compare April 27, 2023 15:11
@nbsp1221
Copy link
Contributor Author

nbsp1221 commented Apr 27, 2023

@ljharb

I found json5. It seems that by using it, I can fix code syntax highlighting while retaining the fact these are meant to be JSON.

@ljharb ljharb force-pushed the docs/fix-code-syntax-highlighting branch from bf97220 to 13f5c19 Compare May 3, 2023 05:17
@codecov
Copy link

codecov bot commented May 3, 2023

Codecov Report

Merging #3563 (13f5c19) into master (f2d8d26) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #3563   +/-   ##
=======================================
  Coverage   97.62%   97.62%           
=======================================
  Files         132      132           
  Lines        9295     9295           
  Branches     3400     3400           
=======================================
  Hits         9074     9074           
  Misses        221      221           

@ljharb ljharb merged commit 13f5c19 into jsx-eslint:master May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants