FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Lint md code blocks 3469 by ddonahue007 · Pull Request #3474 · patternfly/patternfly-react · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .json  (2) .lock  (1) .md  (7) .yml  (1) dotfile  (1) All 5 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
3 changes: 3 additions & 0 deletions .circleci/config.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ jobs:
- run:
name: TSLint
command: yarn lint:ts || true
- run:
name: MarkdownLint
command: yarn lint:md
- run:
name: "@patternfly/patternfly Versions Match"
command: yarn lint:versions
Expand Down
2 changes: 2 additions & 0 deletions .eslintignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/node_modules/**
**/dist/**
24 changes: 24 additions & 0 deletions .eslintrc_md.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"plugins": [
"markdown",
"react"
],

"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2018,
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
"eol-last": 1,
"no-console": 1,
"spaced-comment": 1,
"no-unused-vars": 0,
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"react/no-unknown-property": 1,
"react/jsx-no-undef": 1
}
}
4 changes: 4 additions & 0 deletions package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
"enzyme": "3.10.0",
"enzyme-adapter-react-16": "1.14.0",
"enzyme-to-json": "3.4.0",
"eslint": "5.6.0",
"eslint-plugin-markdown": "^1.0.1",
"eslint-plugin-react": "^7.17.0",
"fs-extra": "^6.0.1",
"glob": "^7.1.2",
"jest": "24.1.0",
Expand Down Expand Up @@ -88,6 +91,7 @@
"clean:build": "shx rm -rf .cache",
"commit": "git-cz",
"generate": "yarn plop",
"lint:md": "yarn eslint --ext md ./packages/patternfly-4 --config ./.eslintrc_md.json",
"lint:style": "stylelint \"**/sass/**/*.scss\" \"!**/dist/**/*.scss\"",
"lint:ts": "node --max-old-space-size=4096 node_modules/.bin/tslint --project ./tslint.config.json --config tslint.json",
"lint:versions": "node ./packages/patternfly-4/verifyCoreVersions.js",
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1111,6 +1111,7 @@ A react-router Link may be wrapped by DropdownItem or used directly within Dropd

```js noLive
/** Wrapped Link for DropdownItem list **/
<>

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@ddonahue007 Is it possible to make the eslint check our JSX to ensure we use <React.Fragment> instead of <>? That would fix some of our fullscreen examples.

<DropdownItem key="link">
<Link to={'/'}>Link</Link>
</DropdownItem>
Expand All @@ -1123,8 +1124,8 @@ A react-router Link may be wrapped by DropdownItem or used directly within Dropd
Expanded Dropdown
</DropdownToggle>
}
isOpen={isOpen}
>
isOpen={isOpen}>
<Link to={'/'}>Link</Link>
</Dropdown>
</>
```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Alert } from '@patternfly/react-core';

## Examples
```js title=Basic
import React {ReactFragment} from 'react';
import React, { ReactFragment } from 'react';
import { Drawer, DrawerPanelContent, DrawerContent } from '@patternfly/react-core/dist/esm/experimental';
import { Button } from '@patternfly/react-core';

Expand Down Expand Up @@ -48,7 +48,7 @@ class SimpleDrawer extends React.Component {
```

```js title=Basic-inline
import React {ReactFragment} from 'react';
import React, { ReactFragment } from 'react';
import { Drawer, DrawerPanelContent, DrawerContent } from '@patternfly/react-core/dist/esm/experimental';
import { Button } from '@patternfly/react-core';

Expand Down
2 changes: 1 addition & 1 deletion packages/patternfly-4/react-styles/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const styles = StyleSheet.parse(`
`);

const Button = ({
variant // primary | secondary,
variant, // primary | secondary
children,
}) => (
<button
Expand Down
2 changes: 1 addition & 1 deletion packages/patternfly-4/react-table/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import React from 'react';
import { Table, TableHeader, TableBody } from '@patternfly/react-table';

class SimpleTable extends React.Component {
static title = 'Simple Table';

constructor(props) {
super(props);
this.state = {
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import React from 'react';
import {
Table,
TableHeader,
TableBody
TableBody,
textCenter,
} from '@patternfly/react-table';

Expand Down
4 changes: 2 additions & 2 deletions packages/patternfly-4/react-tokens/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ import { global_BackgroundColor_100 } from '@patternfly/react-tokens';
```js
import { global_BackgroundColor_100 } from '@patternfly/react-tokens';

global_BackgroundColor_100.name === '--pf-global--BackgroundColor--100'; //true
global_BackgroundColor_100.name === '--pf-global--BackgroundColor--100'; // true
global_BackgroundColor_100.value === '#fff'; // true
global_BackgroundColor_100.var === 'var(--pf-global--BackgroundColor--100)'; //true
global_BackgroundColor_100.var === 'var(--pf-global--BackgroundColor--100)'; // true
```

[token-page]: https://patternfly-react.surge.sh/patternfly-4/tokens/Global%20CSS%20variables/
2 changes: 1 addition & 1 deletion packages/patternfly-4/react-topology/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import '@patternfly/react-core/dist/styles/base.css';

```javascript
import React from 'react';
... TBD
// TODO
```

## Contribution
Expand Down
90 changes: 89 additions & 1 deletion yarn.lock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -10162,6 +10162,11 @@ eslint-module-utils@^2.2.0, eslint-module-utils@^2.4.0:
debug "^2.6.8"
pkg-dir "^2.0.0"

eslint-plugin-eslint-plugin@^2.1.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-eslint-plugin/-/eslint-plugin-eslint-plugin-2.2.0.tgz#6cac90a8085f658e892b155dda130deac54cfa51"
integrity sha512-X5+NT9a2GuwWyb3sHJdEEe6aD/30Fhi3/9XCmYHe/OSnWKUhmKOxFTfFM1AXZfJXjAoX7811bnoLI3fZr5AX5Q==

eslint-plugin-flowtype@2.50.1:
version "2.50.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.50.1.tgz#36d4c961ac8b9e9e1dc091d3fba0537dad34ae8a"
Expand Down Expand Up @@ -10243,6 +10248,15 @@ eslint-plugin-jsx-a11y@^6.0.3, eslint-plugin-jsx-a11y@^6.2.3:
has "^1.0.3"
jsx-ast-utils "^2.2.1"

eslint-plugin-markdown@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-markdown/-/eslint-plugin-markdown-1.0.1.tgz#9705786310f84dad9cf800bea1eb5c4acafcc13a"
integrity sha512-nAUURNHJGPooBMZMP23FmTbh3LTdgoSqeFBv9FA3fYrJ+vDUJxrp6nKiQF4iDNAmnWQnmnrDvV61BmIF4X9QAQ==
dependencies:
object-assign "^4.0.1"
remark-parse "^5.0.0"
unified "^6.1.2"

eslint-plugin-node@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-6.0.1.tgz#bf19642298064379315d7a4b2a75937376fa05e4"
Expand Down Expand Up @@ -10295,6 +10309,22 @@ eslint-plugin-react@^7.16.0, eslint-plugin-react@^7.7.0:
prop-types "^15.7.2"
resolve "^1.12.0"

eslint-plugin-react@^7.17.0:
version "7.17.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.17.0.tgz#a31b3e134b76046abe3cd278e7482bd35a1d12d7"
integrity sha512-ODB7yg6lxhBVMeiH1c7E95FLD4E/TwmFjltiU+ethv7KPdCwgiFuOZg9zNRHyufStTDLl/dEFqI2Q1VPmCd78A==
dependencies:
array-includes "^3.0.3"
doctrine "^2.1.0"
eslint-plugin-eslint-plugin "^2.1.0"
has "^1.0.3"
jsx-ast-utils "^2.2.3"
object.entries "^1.1.0"
object.fromentries "^2.0.1"
object.values "^1.1.0"
prop-types "^15.7.2"
resolve "^1.13.1"

eslint-plugin-rulesdir@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-rulesdir/-/eslint-plugin-rulesdir-0.1.0.tgz#ad144d7e98464fda82963eff3fab331aecb2bf08"
Expand Down Expand Up @@ -13667,7 +13697,7 @@ is-boolean-object@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.0.0.tgz#98f8b28030684219a95f375cfbd88ce3405dff93"

is-buffer@^1.0.2, is-buffer@^1.1.5, is-buffer@~1.1.1:
is-buffer@^1.0.2, is-buffer@^1.1.4, is-buffer@^1.1.5, is-buffer@~1.1.1:
version "1.1.6"
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"

Expand Down Expand Up @@ -15276,6 +15306,14 @@ jsx-ast-utils@^2.0.1, jsx-ast-utils@^2.2.1:
array-includes "^3.0.3"
object.assign "^4.1.0"

jsx-ast-utils@^2.2.3:
version "2.2.3"
resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.2.3.tgz#8a9364e402448a3ce7f14d357738310d9248054f"
integrity sha512-EdIHFMm+1BPynpKOpdPqiOsvnIrInRGJD7bzPZdPkjitQEqpdpUuFpq4T0npZFKTiB3RhWFdGN+oqOJIdhDhQA==
dependencies:
array-includes "^3.0.3"
object.assign "^4.1.0"

jsx-to-string@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/jsx-to-string/-/jsx-to-string-1.4.0.tgz#66dc34d773dab9f40fe993cff9940e5da655b705"
Expand Down Expand Up @@ -21390,6 +21428,27 @@ remark-parse@7.0.1:
vfile-location "^2.0.0"
xtend "^4.0.1"

remark-parse@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-5.0.0.tgz#4c077f9e499044d1d5c13f80d7a98cf7b9285d95"
integrity sha512-b3iXszZLH1TLoyUzrATcTQUZrwNl1rE70rVdSruJFlDaJ9z5aMkhrG43Pp68OgfHndL/ADz6V69Zow8cTQu+JA==
dependencies:
collapse-white-space "^1.0.2"
is-alphabetical "^1.0.0"
is-decimal "^1.0.0"
is-whitespace-character "^1.0.0"
is-word-character "^1.0.0"
markdown-escapes "^1.0.0"
parse-entities "^1.1.0"
repeat-string "^1.5.4"
state-toggle "^1.0.0"
trim "0.0.1"
trim-trailing-lines "^1.0.0"
unherit "^1.0.4"
unist-util-remove-position "^1.0.0"
vfile-location "^2.0.0"
xtend "^4.0.1"

remark-parse@^6.0.0:
version "6.0.3"
resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-6.0.3.tgz#c99131052809da482108413f87b0ee7f52180a3a"
Expand Down Expand Up @@ -21656,6 +21715,13 @@ resolve@1.x, resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.11.0, r
dependencies:
path-parse "^1.0.6"

resolve@^1.13.1:
version "1.14.2"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.14.2.tgz#dbf31d0fa98b1f29aa5169783b9c290cb865fea2"
integrity sha512-EjlOBLBO1kxsUxsKjLt7TAECyKW6fOh1VRkykQkKGzcBbjjPIxBqGh0jf7GJ3k/f5mxMqW3htMD3WdTUVtW8HQ==
dependencies:
path-parse "^1.0.6"

responselike@1.0.2, responselike@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7"
Expand Down Expand Up @@ -24179,6 +24245,18 @@ unified@8.3.2:
trough "^1.0.0"
vfile "^4.0.0"

unified@^6.1.2:
version "6.2.0"
resolved "https://registry.yarnpkg.com/unified/-/unified-6.2.0.tgz#7fbd630f719126d67d40c644b7e3f617035f6dba"
integrity sha512-1k+KPhlVtqmG99RaTbAv/usu85fcSRu3wY8X+vnsEhIxNP5VbVIDiXnLqyKIG+UMdyTg0ZX9EI6k2AfjJkHPtA==
dependencies:
bail "^1.0.0"
extend "^3.0.0"
is-plain-obj "^1.1.0"
trough "^1.0.0"
vfile "^2.0.0"
x-is-string "^0.1.0"

unified@^7.0.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/unified/-/unified-7.1.0.tgz#5032f1c1ee3364bd09da12e27fdd4a7553c7be13"
Expand Down Expand Up @@ -24614,6 +24692,16 @@ vfile-message@^2.0.0:
"@types/unist" "^2.0.2"
unist-util-stringify-position "^2.0.0"

vfile@^2.0.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/vfile/-/vfile-2.3.0.tgz#e62d8e72b20e83c324bc6c67278ee272488bf84a"
integrity sha512-ASt4mBUHcTpMKD/l5Q+WJXNtshlWxOogYyGYYrg4lt/vuRjC1EFQtlAofL5VmtVNIZJzWYFJjzGWZ0Gw8pzW1w==
dependencies:
is-buffer "^1.1.4"
replace-ext "1.0.0"
unist-util-stringify-position "^1.0.0"
vfile-message "^1.0.0"

vfile@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/vfile/-/vfile-3.0.1.tgz#47331d2abe3282424f4a4bb6acd20a44c4121803"
Expand Down

Back | FazBrowse Home | New Git URL