webksde / ddev-vscode-devcontainer-drupal-template

Drupal DDEV based development container with attached Visual Studio Code
23 stars 3 forks source link

Use legacy eslint for Drupal 9? #112

Closed JPustkuchen closed 1 year ago

JPustkuchen commented 1 year ago

Currently eslint turns nearly every JS file in Drupal 9 red, as ES6 isn't yet allowed directly. With Drupal 10 ES6 will be the new standard, as old browsers are dropped.

To fix this in Drupal 9, we'd have to use

{
  "extends": "./core/.eslintrc.legacy.json"
}

instead of the default

{
  "extends": "./core/.eslintrc.json"
}

in .eslintrc.json in the project folder.

I guess it's okay to do this manually, when ever it's needed or is there an easy way to override it automatically using DDEV? For Drupal 9 the legacy variant would be the correct one.

For Drupal 10 we don't need to do this.

joshsedl commented 1 year ago

Fixed in https://github.com/webksde/ddev-vscode-devcontainer-drupal-template/commit/77f565e568a352ad61275cb8cd0ce0ce697359e1