openems icon indicating copy to clipboard operation
openems copied to clipboard

migrate .eslintrc to eslint.config.mjs

Open miettal opened this issue 1 year ago • 4 comments

ESlint is planning dropping .eslintrc format support in next major release. This PR change eslint configuration format from .eslintrc to eslint.config.mjs (flat config).

eslintrc removed in ESLint v10.0.0 When ESLint v10.0.0 is released (end of 2024 or early 2025 in all likelihood), the eslintrc configuration system will be completely removed. https://eslint.org/blog/2023/10/flat-config-rollout-plans/

actually in this commits I did ..

  1. execute official migration command npx @eslint/migrate-config .eslintrc.json. see *1
  2. change code style formatting to minimize diff.
  3. add global package to use global package in flat config. see *2

There are no functional changes, just migration.

(*1) https://eslint.org/docs/latest/use/configure/migration-guide (*2) https://github.com/eslint/eslint/pull/18356

miettal avatar Jun 20 '24 15:06 miettal

it seems ci was failed. I'll address it.

miettal avatar Jun 21 '24 00:06 miettal

Perhaps, this error caused by @angular-eslint/builder is not support esmodule-based flat config(eslint.config.mjs). there is a possibility of resolving this by upgrading @angular-eslint/builder but @angular-eslint/builder versioning based on angular major release versioning. Current angular version 16 and @angular-eslint/builder==16.3.1 is latest in majer version 16.

Currently, we don't face the dropping .eslintrc problem yet, so we can wait next major release of eslint. I think better to keep this PR until anguler and @angular-eslint/builder situation is changed.

https://github.com/angular-eslint/angular-eslint/issues/1280

miettal avatar Jun 21 '24 00:06 miettal

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #2675      +/-   ##
=============================================
+ Coverage      56.70%   56.70%   +0.01%     
- Complexity      9567     9569       +2     
=============================================
  Files           2262     2262              
  Lines          96553    96553              
  Branches        7122     7122              
=============================================
+ Hits           54740    54742       +2     
  Misses         39781    39781              
+ Partials        2032     2030       -2     

codecov[bot] avatar Sep 02 '24 07:09 codecov[bot]

I rebased this PR, but it still has this problem.

Perhaps, this error caused by @angular-eslint/builder is not support esmodule-based flat config(eslint.config.mjs).

miettal avatar Sep 02 '24 07:09 miettal

I rebased this PR. it seems good.

miettal avatar Jan 03 '25 12:01 miettal