dspace-angular icon indicating copy to clipboard operation
dspace-angular copied to clipboard

Decorated class properties are now over-indented by ESLint

Open ybnd opened this issue 1 year ago • 2 comments

Describe the bug Apparently the indent rule in ESLint doesn't play well with decorated properties in TypeScript: they are indented with 4 spaces, e.g. here.

This doesn't cause any real problems but is a bit of an eyesore.

There is a potential workaround, but it disables indentation checks for all properties and won't be auto-fixable. The ESLint rule itself is deprecated though (because it's a style rule and not a lint rule). They suggest to use this rule instead.

Expected behavior Decorated properties should be indented with 2 spaces just like any other properties.

Related work #2343

ybnd avatar Apr 17 '24 13:04 ybnd

There are a few other style rules used in DSpace Angular that have been deprecated in base ESLint & are now community-supported in @stylistic/eslint-plugins:

  • indent
  • comma-dangle
  • object-curly-spacing
  • eol-last
  • brace-style
  • keyword-spacing

Some of these include TypeScript-specific bugfixes now, but this doesn't address the over-indentation problem.

ybnd avatar Apr 18 '24 11:04 ybnd

Labeled as low priority since I applied the workaround in #2865 and it's unlikely that we'll have a better solution save for moving to Prettier.

ybnd avatar Apr 18 '24 11:04 ybnd