@wordpress/eslint-plugin 17.12.0 → 18.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,6 +25,12 @@ if ( isPackageInstalled( 'prettier' ) ) {
25
25
  const prettierConfig = { ...defaultPrettierConfig, ...localPrettierConfig };
26
26
  config.rules = {
27
27
  'prettier/prettier': [ 'error', prettierConfig ],
28
+ // Prettier _disables_ this rule, but we want it!
29
+ // See https://github.com/prettier/eslint-config-prettier?tab=readme-ov-file#curly
30
+ // > This rule requires certain options.
31
+ // > …
32
+ // > If you like this rule, it can be used just fine with Prettier as long as you don’t use the "multi-line" or "multi-or-nest" option.
33
+ curly: [ 'error', 'all' ],
28
34
  };
29
35
  }
30
36
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/eslint-plugin",
3
- "version": "17.12.0",
3
+ "version": "18.0.0",
4
4
  "description": "ESLint plugin for WordPress development.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -34,8 +34,8 @@
34
34
  "@babel/eslint-parser": "^7.16.0",
35
35
  "@typescript-eslint/eslint-plugin": "^6.4.1",
36
36
  "@typescript-eslint/parser": "^6.4.1",
37
- "@wordpress/babel-preset-default": "^7.39.0",
38
- "@wordpress/prettier-config": "^3.12.0",
37
+ "@wordpress/babel-preset-default": "^7.41.0",
38
+ "@wordpress/prettier-config": "^3.14.0",
39
39
  "cosmiconfig": "^7.0.0",
40
40
  "eslint-config-prettier": "^8.3.0",
41
41
  "eslint-plugin-import": "^2.25.2",
@@ -66,5 +66,5 @@
66
66
  "publishConfig": {
67
67
  "access": "public"
68
68
  },
69
- "gitHead": "ac2b13783c28f959770cf029a797a712f59e1958"
69
+ "gitHead": "581d8a5580dba8f600b7268d51eb554771ae482c"
70
70
  }
@@ -34,6 +34,23 @@ sprintf(
34
34
  // translators: %s: Color
35
35
  i18n.sprintf( i18n.__( 'Color: %s' ), color );`,
36
36
  },
37
+ {
38
+ code: `
39
+ sprintf(
40
+ /*
41
+ * translators: %s is the name of the city we couldn't locate.
42
+ * Replace the examples with cities related to your locale. Test that
43
+ * they match the expected location and have upcoming events before
44
+ * including them. If no cities related to your locale have events,
45
+ * then use cities related to your locale that would be recognizable
46
+ * to most users. Use only the city name itself, without any region
47
+ * or country. Use the endonym (native locale name) instead of the
48
+ * English name if possible.
49
+ */
50
+ __( 'We couldn’t locate %s. Please try another nearby city. For example: Kansas City; Springfield; Portland.' ),
51
+ templateParams.unknownCity
52
+ );`,
53
+ },
37
54
  ],
38
55
  invalid: [
39
56
  {
@@ -78,7 +78,7 @@ module.exports = {
78
78
  const {
79
79
  value: commentText,
80
80
  loc: {
81
- start: { line: commentLine },
81
+ end: { line: commentLine },
82
82
  },
83
83
  } = comment;
84
84