phetsims / chipper

Tools for developing and building PhET interactive simulations.
MIT License
11 stars 14 forks source link

Updates to linting once typescript-eslint supports Typescript 5.7 #1483

Open zepumph opened 2 weeks ago

zepumph commented 2 weeks ago

Over in https://github.com/phetsims/chipper/issues/1451, we ended up hacking around a lack of support in typescript-eslint. We are using the unstable_config_lookup_from_file, but typescript-eslint doesn't support it well. Typescript 5.7 will support looking up tsconfig.json t

Support issue: https://github.com/typescript-eslint/typescript-eslint/issues/10115

Once we have good support, we are going to be able to use more than one eslint.config.mjs file per repo. This will greatly reduce the complexity of flag config files in repos that lint browser and node code.

  1. aqua and chipper are the only repos using this feature at this time.
  2. Add an eslint.mjs file at each level to specify what linting config is needed (aqua/js/grunt/ will use node, but aqua/js/report will use a browser config).
  3. Delete all the "getXConfiguration()" functions in common eslint config files, and only support exporting default with an spread super config (...rootEslintConfig).
  4. We don't think that this will involve any changes to our "sub-directory" tsconfig files. We don't think lint and webstorm know how to start at a file, and then navigate through a reference path at the root tsconfig to find the right config via a project reference. Let's give that test one more check in 5.7, just to make sure that we need this complexity, but we don't expect any changes.
zepumph commented 3 days ago

It isn't clear that this ISN'T supported by typescript eslint 8.10 (which supports typescript 5.6). I think we should upgrade to 8.11 (current as of last week), and see if the behavior of muiltiple eslint.config.mjs files up the hierarchy resolves correctly.