Skip to content

Add eslint-plugin-markdown for JavaScript code samples in documentation #134

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

Merged
merged 1 commit into from
Jun 18, 2021

Conversation

bmish
Copy link
Member

@bmish bmish commented Jun 17, 2021

This applies our JavaScript linting to the JavaScript code samples in the markdown documentation files. Goal is to generally improve the quality, reliability, and consistency of our documentation.

  • Autofixes styling/formatting/whitespace
  • Fixes and prevents syntax errors

@bmish bmish force-pushed the eslint-plugin-markdown branch 2 times, most recently from 1d67970 to cddad8c Compare June 17, 2021 16:56
@@ -13,51 +13,45 @@ This rule aims to ensure that if any invalid test cases have output assertions,
Examples of **incorrect** code for this rule:

```js
/* eslint eslint-plugin/consistent-output: error */

Copy link
Contributor

Choose a reason for hiding this comment

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

why removing the inline config?

Copy link
Member Author

Choose a reason for hiding this comment

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

I just added the inline configs back. I thought it seemed redundant and not all of the rule doc examples use it. But we can leave as-is for now.

.eslintrc.js Outdated
plugins: ['markdown'],
parserOptions: {
sourceType: 'module',
},
Copy link
Contributor

Choose a reason for hiding this comment

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

sourceType should be "scripts".

Copy link
Member Author

@bmish bmish Jun 17, 2021

Choose a reason for hiding this comment

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

Update: I removed this config so it would default to script.

@bmish bmish force-pushed the eslint-plugin-markdown branch from cddad8c to 161026d Compare June 17, 2021 17:55
…entation

This applies our JavaScript linting to the JavaScript code samples in the markdown documentation files.

* Autofixes styling/formatting/whitespace
* Fixes and prevents syntax errors
@bmish bmish force-pushed the eslint-plugin-markdown branch from 161026d to 6dcb7b5 Compare June 17, 2021 17:59
@aladdin-add aladdin-add merged commit 15ffada into eslint-community:master Jun 18, 2021
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.

2 participants