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

Update wordpress/eslint-plugin #18624

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ module.exports = {
react: {
version: 'detect', // React version. "detect" automatically picks the version you have installed.
},
jest: {
version: 'detect',
},
},
plugins: [ 'jsx-a11y', 'lodash', 'jsdoc' ],
plugins: [ 'jsx-a11y', 'lodash', 'jsdoc', '@wordpress/eslint-plugin' ],
rules: {
// REST API objects include underscores
camelcase: 0,
Expand Down Expand Up @@ -104,6 +107,9 @@ module.exports = {
'react/no-string-refs': 0,
'jsx-a11y/anchor-is-valid': 0,

// Adding @wordpress rules
'@wordpress/no-unsafe-wp-apis': [ 'error' ],

// JSDoc plugin overrides
'jsdoc/check-alignment': 1, // Recommended
'jsdoc/check-examples': 1,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"**/terser-webpack-plugin/serialize-javascript": "^5.0.0"
},
"devDependencies": {
"@wordpress/eslint-plugin": "7.4.0",
"@wordpress/eslint-plugin": "8.0.1",
"babel-eslint": "10.1.0",
"commander": "6.2.1",
"concurrently": "5.3.0",
Expand Down
5 changes: 5 additions & 0 deletions projects/plugins/jetpack/changelog/update-wordpress-eslint
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: compat
Comment: Update to modern version of wordpress-eslint. Just linting.


Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WordPress dependencies
*/
// eslint-disable-next-line wpcalypso/import-docblock
import { InnerBlocks, __experimentalBlock as Block } from '@wordpress/block-editor';
import { InnerBlocks, useBlockProps as Block } from '@wordpress/block-editor';
import { compose } from '@wordpress/compose';
import { withDispatch, withSelect } from '@wordpress/data';
import { useEffect } from '@wordpress/element';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import classnames from 'classnames';
import { __ } from '@wordpress/i18n';
import { useCallback } from '@wordpress/element';
import { PanelBody, RangeControl } from '@wordpress/components';
import { InspectorControls, RichText, __experimentalBlock as Block } from '@wordpress/block-editor';
import { InspectorControls, RichText, useBlockProps as Block } from '@wordpress/block-editor';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
MediaUpload,
MediaUploadCheck,
RichText,
__experimentalBlock as Block,
useBlockProps as Block,
} from '@wordpress/block-editor';
import { Component, createRef, Fragment } from '@wordpress/element';
import { __, _x, sprintf } from '@wordpress/i18n';
Expand Down
3 changes: 3 additions & 0 deletions projects/plugins/jetpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
"@babel/preset-react": "7.12.10",
"@babel/preset-typescript": "7.12.7",
"@size-limit/preset-app": "4.10.0",
"@slack/web-api": "6.1.0",
"@testing-library/jest-dom": "5.11.9",
"@testing-library/preact": "2.0.1",
"@testing-library/react": "11.2.3",
Expand All @@ -171,6 +172,7 @@
"chalk": "4.1.0",
"commander": "6.2.1",
"concurrently": "5.3.0",
"config": "3.3.6",
"css-loader": "5.1.1",
"enzyme": "3.11.0",
"eslint": "7.21.0",
Expand All @@ -189,6 +191,7 @@
"jest": "26.6.3",
"lodash": "4.17.21",
"markdown-spellcheck": "1.3.1",
"mkdirp": "1.0.4",
"mocha": "8.2.1",
"mockery": "2.1.0",
"nock": "13.0.7",
Expand Down
2 changes: 1 addition & 1 deletion projects/plugins/jetpack/tests/e2e/lib/pages/wpcom/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Internal dependencies
*/
import Page from '../page';
import getRedirectUrl from 'lib/jp-redirect';
import getRedirectUrl from '../../../../../_inc/client/lib/jp-redirect';

export default class HomePage extends Page {
constructor( page ) {
Expand Down
Loading