Skip to content

8.2.4: Use type information for better linting (#328)

Compare
Choose a tag to compare
@tvr-buildatron tvr-buildatron released this 18 Mar 11:12

๐Ÿ“บ What

Title.

๐Ÿ›  How

Configure ESLint to provide typescript-eslint with type information. This enables us to adopt better linting rules. For example: switch-exhaustiveness-check would have blocked the changes to Chronicle that broke the debug view from going out.

It was easiest to adopt the new ESLint "flat config" schema to achieve this. This meant some compatibility code is in place.

More on linting with types: https://typescript-eslint.io/getting-started/typed-linting/
Switch exhaustiveness check: https://typescript-eslint.io/rules/switch-exhaustiveness-check/