Skip to content

Commit

Permalink
Update packages used by eslint plugin to remove warnings (#14077)
Browse files Browse the repository at this point in the history
* Update packages used by eslint plugin to remove warnings

* Manually modify package-lock.json

Props @gziolo.

* Specify React version in eslint-plugin-react settings

* Fix react/jsx-no-target lint errors
  • Loading branch information
swissspidy authored and youknowriad committed Mar 20, 2019
1 parent 212f8b1 commit 8a571b2
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 57 deletions.
122 changes: 70 additions & 52 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/block-library/src/categories/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class CategoriesEdit extends Component {

return (
<li key={ category.id }>
<a href={ category.link } target="_blank">{ this.renderCategoryName( category ) }</a>
<a href={ category.link } target="_blank" rel="noreferrer noopener">{ this.renderCategoryName( category ) }</a>
{ showPostCounts &&
<span className="wp-block-categories__post-count">
{ ' ' }({ category.count })
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/latest-posts/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class LatestPostsEdit extends Component {
const titleTrimmed = post.title.rendered.trim();
return (
<li key={ i }>
<a href={ post.link } target="_blank">
<a href={ post.link } target="_blank" rel="noreferrer noopener">
{ titleTrimmed ? (
<RawHTML>
{ titleTrimmed }
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/external-link/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function ExternalLink( { href, children, className, rel = '', ...addition
] ) ).join( ' ' );
const classes = classnames( 'components-external-link', className );
return (
<a { ...additionalProps } className={ classes } href={ href } target="_blank" rel={ rel } ref={ ref }>
<a { ...additionalProps } className={ classes } href={ href } target="_blank" rel={ rel } ref={ ref }> { /* eslint-disable-line react/jsx-no-target-blank */ }
{ children }
<span className="screen-reader-text">
{
Expand Down
5 changes: 5 additions & 0 deletions packages/eslint-plugin/configs/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,9 @@ module.exports = {
},
],
},
settings: {
react: {
version: '16.6',
},
},
};
4 changes: 2 additions & 2 deletions packages/eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
},
"dependencies": {
"babel-eslint": "^8.0.3",
"eslint-plugin-jsx-a11y": "6.0.2",
"eslint-plugin-react": "7.7.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"requireindex": "^1.2.0"
},
"publishConfig": {
Expand Down

0 comments on commit 8a571b2

Please sign in to comment.