wikimedia / wikipediapreview-wordpress

WordPress plugin for Wikipedia Preview
MIT License
7 stars 8 forks source link

Support new version of WP and update dependencies #101

Closed hueitan closed 10 months ago

hueitan commented 11 months ago
stephanebisson commented 10 months ago

Most (or all) js files in this PR remove spaces insides parenthesis, which goes against WMF standards. I'm wondering why this is happening now. Have wordpress standards changed? Should we include eslint-wikimedia preset?

medied commented 10 months ago

Most (or all) js files in this PR remove spaces insides parenthesis, which goes against WMF standards. I'm wondering why this is happening now. Have wordpress standards changed? Should we include eslint-wikimedia preset?

That's a good question. I couldn't find the exact pinpoint in a changelog where the change is reflected, but it looks like @wordpress/eslint-plugin/recommended does remove spacing by default so I suppose Wordpress standards did change. However there is also a @wordpress/eslint-plugin/recommended-with-formatting that does preserve the spacing, after testing locally:

...
  35:3   error  There must be a space before this paren  space-in-parens
  36:14  error  There must be a space after this paren   space-in-parens
  36:15  error  There must be a space after this paren   space-in-parens
  36:24  error  There must be a space before this paren  space-in-parens
  38:15  error  There must be a space after this paren   space-in-parens
  38:23  error  There must be a space before this paren  space-in-parens
  39:13  error  There must be a space after this paren   space-in-parens
  39:27  error  There must be a space before this paren  space-in-parens
  39:37  error  There must be a space after this paren   space-in-parens
  39:55  error  There must be a space before this paren  space-in-parens
  42:3   error  There must be a space before this paren  space-in-parens
  43:2   error  There must be a space before this paren  space-in-parens
  43:3   error  There must be a space after this paren   space-in-parens
  43:39  error  There must be a space before this paren  space-in-parens

✖ 838 problems (834 errors, 4 warnings)
  831 errors and 0 warnings potentially fixable with the `--fix` option.

More info here: https://developer.wordpress.org/block-editor/reference-guides/packages/packages-eslint-plugin/#usage and here https://wordpress.org/support/topic/eslint-pluginwordpress-eslint-plugin-not-settings-spaces/

I think I'm leaning towards keeping the spaces just to simplify this PR. Thoughts?

stephanebisson commented 10 months ago

[...] I think I'm leaning towards keeping the spaces just to simplify this PR. Thoughts?

I agree and I prefer to stay closer to WMF standards than Wordpress standards when they conflict.