Skip to content

Commit

Permalink
chore(deps): update dependency eslint to v7 (#42614)
Browse files Browse the repository at this point in the history
* chore(deps): update dependency eslint to v7

* Adapt i18n rules to eslint 7


Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Sergio Cinos <sergio.cinos@gmail.com>
  • Loading branch information
3 people committed May 28, 2020
1 parent 22331a1 commit 4bd1eb4
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 24 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -268,7 +268,7 @@
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.1",
"enzyme-to-json": "^3.4.3",
"eslint": "^6.8.0",
"eslint": "^7.0.0",
"eslint-config-prettier": "^6.9.0",
"eslint-config-wpcalypso": "^5.0.0",
"eslint-plugin-import": "^2.20.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-wpcalypso/package.json
Expand Up @@ -24,7 +24,7 @@
"directory": "packages/eslint-config-wpcalypso"
},
"peerDependencies": {
"eslint": "^6.0.0",
"eslint": "^7.0.0",
"eslint-plugin-jsdoc": "^18.0.0",
"eslint-plugin-wpcalypso": "^3.4.1 || ^4.0.0"
},
Expand Down
16 changes: 7 additions & 9 deletions packages/eslint-plugin-wpcalypso/lib/rules/i18n-ellipsis.js
Expand Up @@ -24,17 +24,15 @@ function replaceThreeDotsWithEllipsis( string ) {
return string.replace( /\.\.\./g, '…' );
}

function makeFixerFunction( arg ) {
function makeFixerFunction( arg, context ) {
return ( fixer ) => {
switch ( arg.type ) {
case 'TemplateLiteral':
return arg.quasis.reduce( ( fixes, quasi ) => {
if ( 'TemplateElement' === quasi.type && containsThreeDots( quasi.value.raw ) ) {
const nodeContent = context.getSourceCode().getText( quasi );
if ( 'TemplateElement' === quasi.type && containsThreeDots( nodeContent ) ) {
fixes.push(
fixer.replaceTextRange(
[ quasi.start, quasi.end ],
replaceThreeDotsWithEllipsis( quasi.value.raw )
)
fixer.replaceTextRange( quasi.range, replaceThreeDotsWithEllipsis( nodeContent ) )
);
}
return fixes;
Expand All @@ -45,8 +43,8 @@ function makeFixerFunction( arg ) {

case 'BinaryExpression':
return [
...makeFixerFunction( arg.left )( fixer ),
...makeFixerFunction( arg.right )( fixer ),
...makeFixerFunction( arg.left, context )( fixer ),
...makeFixerFunction( arg.right, context )( fixer ),
];
}
};
Expand Down Expand Up @@ -81,7 +79,7 @@ const rule = ( module.exports = function ( context ) {
context.report( {
node: arg,
message: rule.ERROR_MESSAGE,
fix: makeFixerFunction( arg ),
fix: makeFixerFunction( arg, context ),
} );
}
} );
Expand Down
Expand Up @@ -184,6 +184,7 @@ new RuleTester( config ).run( 'i18n-ellipsis', rule, {
{
code: "_x( '...', 'ellipsis' );",
errors: [ { message: rule.ERROR_MESSAGE } ],
output: "_x( '…', 'ellipsis' );",
},
{
code: "_n( '...', '...s', 1 );",
Expand Down
Expand Up @@ -53,7 +53,6 @@ new RuleTester( config ).run( 'i18n-no-collapsible-whitespace', rule, {
errors: [
{
message: NO_NEWLINES,
problem: ' (\\n)',
},
],
},
Expand Down
145 changes: 133 additions & 12 deletions yarn.lock
Expand Up @@ -5288,6 +5288,11 @@ acorn-jsx@^5.0.1, acorn-jsx@^5.1.0:
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.1.0.tgz#294adb71b57398b0680015f0a38c563ee1db5384"
integrity sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw==

acorn-jsx@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.2.0.tgz#4c66069173d6fdd68ed85239fc256226182b2ebe"
integrity sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==

acorn-node@^1.2.0, acorn-node@^1.3.0, acorn-node@^1.5.2, acorn-node@^1.6.1:
version "1.8.2"
resolved "https://registry.yarnpkg.com/acorn-node/-/acorn-node-1.8.2.tgz#114c95d64539e53dede23de8b9d96df7c7ae2af8"
Expand Down Expand Up @@ -8785,6 +8790,15 @@ cross-spawn@^7.0.0:
shebang-command "^2.0.0"
which "^2.0.1"

cross-spawn@^7.0.2:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
dependencies:
path-key "^3.1.0"
shebang-command "^2.0.0"
which "^2.0.1"

cryptiles@0.2.x:
version "0.2.2"
resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-0.2.2.tgz#ed91ff1f17ad13d3748288594f8a48a0d26f325c"
Expand Down Expand Up @@ -10753,6 +10767,13 @@ eslint-utils@^1.4.3:
dependencies:
eslint-visitor-keys "^1.1.0"

eslint-utils@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.0.0.tgz#7be1cc70f27a72a76cd14aa698bcabed6890e1cd"
integrity sha512-0HCPuJv+7Wv1bACm8y5/ECVfYdfsAm9xmVb7saeFlxjPYALefjhbYoCkBjPdPzGH8wWyTpAez82Fh3VKYEZ8OA==
dependencies:
eslint-visitor-keys "^1.1.0"

eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2"
Expand Down Expand Up @@ -10801,6 +10822,48 @@ eslint@^6.8.0:
text-table "^0.2.0"
v8-compile-cache "^2.0.3"

eslint@^7.0.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.1.0.tgz#d9a1df25e5b7859b0a3d86bb05f0940ab676a851"
integrity sha512-DfS3b8iHMK5z/YLSme8K5cge168I8j8o1uiVmFCgnnjxZQbCGyraF8bMl7Ju4yfBmCuxD7shOF7eqGkcuIHfsA==
dependencies:
"@babel/code-frame" "^7.0.0"
ajv "^6.10.0"
chalk "^4.0.0"
cross-spawn "^7.0.2"
debug "^4.0.1"
doctrine "^3.0.0"
eslint-scope "^5.0.0"
eslint-utils "^2.0.0"
eslint-visitor-keys "^1.1.0"
espree "^7.0.0"
esquery "^1.2.0"
esutils "^2.0.2"
file-entry-cache "^5.0.1"
functional-red-black-tree "^1.0.1"
glob-parent "^5.0.0"
globals "^12.1.0"
ignore "^4.0.6"
import-fresh "^3.0.0"
imurmurhash "^0.1.4"
inquirer "^7.0.0"
is-glob "^4.0.0"
js-yaml "^3.13.1"
json-stable-stringify-without-jsonify "^1.0.1"
levn "^0.4.1"
lodash "^4.17.14"
minimatch "^3.0.4"
natural-compare "^1.4.0"
optionator "^0.9.1"
progress "^2.0.0"
regexpp "^3.1.0"
semver "^7.2.1"
strip-ansi "^6.0.0"
strip-json-comments "^3.1.0"
table "^5.2.3"
text-table "^0.2.0"
v8-compile-cache "^2.0.3"

esm@^3.2.10:
version "3.2.10"
resolved "https://registry.yarnpkg.com/esm/-/esm-3.2.10.tgz#fea61120e0d89b87897756f506f169c2fb0ca78e"
Expand All @@ -10815,6 +10878,15 @@ espree@^6.1.2:
acorn-jsx "^5.1.0"
eslint-visitor-keys "^1.1.0"

espree@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/espree/-/espree-7.0.0.tgz#8a7a60f218e69f120a842dc24c5a88aa7748a74e"
integrity sha512-/r2XEx5Mw4pgKdyb7GNLQNsu++asx/dltf/CI8RFi9oGHxmQFgvLbc5Op4U6i8Oaj+kdslhJtVlEZeAqH5qOTw==
dependencies:
acorn "^7.1.1"
acorn-jsx "^5.2.0"
eslint-visitor-keys "^1.1.0"

esprima@^2.0:
version "2.7.3"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581"
Expand All @@ -10837,6 +10909,13 @@ esquery@^1.0.1:
dependencies:
estraverse "^4.0.0"

esquery@^1.2.0:
version "1.3.1"
resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.3.1.tgz#b78b5828aa8e214e29fb74c4d5b752e1c033da57"
integrity sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==
dependencies:
estraverse "^5.1.0"

esrecurse@^4.1.0:
version "4.2.1"
resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf"
Expand All @@ -10849,6 +10928,11 @@ estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0:
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d"
integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==

estraverse@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.1.0.tgz#374309d39fd935ae500e7b92e8a6b4c720e59642"
integrity sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw==

estree-walker@^0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.6.1.tgz#53049143f40c6eb918b23671d1fe3219f3a1b362"
Expand Down Expand Up @@ -11252,7 +11336,7 @@ fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0:
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633"
integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==

fast-levenshtein@~2.0.6:
fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6:
version "2.0.6"
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=
Expand Down Expand Up @@ -15983,6 +16067,14 @@ levn@^0.3.0, levn@~0.3.0:
prelude-ls "~1.1.2"
type-check "~0.3.2"

levn@^0.4.1:
version "0.4.1"
resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade"
integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==
dependencies:
prelude-ls "^1.2.1"
type-check "~0.4.0"

lie@~3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/lie/-/lie-3.3.0.tgz#dcf82dee545f46074daf200c7c1c5a08e0f40f6a"
Expand Down Expand Up @@ -18316,6 +18408,18 @@ optionator@^0.8.1, optionator@^0.8.3:
type-check "~0.3.2"
word-wrap "~1.2.3"

optionator@^0.9.1:
version "0.9.1"
resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499"
integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==
dependencies:
deep-is "^0.1.3"
fast-levenshtein "^2.0.6"
levn "^0.4.1"
prelude-ls "^1.2.1"
type-check "^0.4.0"
word-wrap "^1.2.3"

original@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/original/-/original-1.0.2.tgz#e442a61cffe1c5fd20a65f3261c26663b303f25f"
Expand Down Expand Up @@ -19920,6 +20024,11 @@ postcss@^7.0.18:
source-map "^0.6.1"
supports-color "^6.1.0"

prelude-ls@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==

prelude-ls@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
Expand Down Expand Up @@ -21512,6 +21621,11 @@ regexpp@^3.0.0:
resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.0.0.tgz#dd63982ee3300e67b41c1956f850aa680d9d330e"
integrity sha512-Z+hNr7RAVWxznLPuA7DIh8UNX1j9CDrUQxskw9IrBE1Dxue2lyXT+shqEIeLUjrokxIP8CMy1WkjgG3rTsd5/g==

regexpp@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2"
integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==

regexpu-core@^4.5.4, regexpu-core@^4.6.0:
version "4.7.0"
resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.7.0.tgz#fcbf458c50431b0bb7b45d6967b8192d91f3d938"
Expand Down Expand Up @@ -24657,6 +24771,13 @@ twemoji@^12.1.4:
twemoji-parser "12.1.1"
universalify "^0.1.2"

type-check@^0.4.0, type-check@~0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1"
integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==
dependencies:
prelude-ls "^1.2.1"

type-check@~0.3.2:
version "0.3.2"
resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72"
Expand Down Expand Up @@ -25981,7 +26102,7 @@ windows-release@^3.1.0:
dependencies:
execa "^1.0.0"

word-wrap@~1.2.3:
word-wrap@^1.2.3, word-wrap@~1.2.3:
version "1.2.3"
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c"
integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==
Expand Down Expand Up @@ -26509,10 +26630,10 @@ yargs@^14.2, yargs@^14.2.2:
y18n "^4.0.0"
yargs-parser "^15.0.0"

yargs@^15.0.0, yargs@^15.3.1:
version "15.3.1"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.3.1.tgz#9505b472763963e54afe60148ad27a330818e98b"
integrity sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==
yargs@^15.0.0, yargs@^15.1.0:
version "15.3.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.3.0.tgz#403af6edc75b3ae04bf66c94202228ba119f0976"
integrity sha512-g/QCnmjgOl1YJjGsnUg2SatC7NUYEiLXJqxNOQU9qSpjzGtGXda9b+OKccr1kLTy8BN9yqEyqfq5lxlwdc13TA==
dependencies:
cliui "^6.0.0"
decamelize "^1.2.0"
Expand All @@ -26524,12 +26645,12 @@ yargs@^15.0.0, yargs@^15.3.1:
string-width "^4.2.0"
which-module "^2.0.0"
y18n "^4.0.0"
yargs-parser "^18.1.1"
yargs-parser "^18.1.0"

yargs@^15.1.0:
version "15.3.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.3.0.tgz#403af6edc75b3ae04bf66c94202228ba119f0976"
integrity sha512-g/QCnmjgOl1YJjGsnUg2SatC7NUYEiLXJqxNOQU9qSpjzGtGXda9b+OKccr1kLTy8BN9yqEyqfq5lxlwdc13TA==
yargs@^15.3.1:
version "15.3.1"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.3.1.tgz#9505b472763963e54afe60148ad27a330818e98b"
integrity sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==
dependencies:
cliui "^6.0.0"
decamelize "^1.2.0"
Expand All @@ -26541,7 +26662,7 @@ yargs@^15.1.0:
string-width "^4.2.0"
which-module "^2.0.0"
y18n "^4.0.0"
yargs-parser "^18.1.0"
yargs-parser "^18.1.1"

yargs@^3.15.0:
version "3.32.0"
Expand Down

0 comments on commit 4bd1eb4

Please sign in to comment.