Open bartvandenende-wm opened 5 months ago
I know it's slightly more work to keep the typescript interface and the schema in sync, but I'm not crazy about removing the interface from typescript and having it be generated, as that adds extra complexity when understanding how the project works (and we have so few contributors as it is).
that's OK, note there is probably still opportunity to unify the TS types of BsLintConfig['rules']
and BsLintRules
but that is outside the scope of this PR.
Let's eliminate the src/generated concept and just maintain the schema and typescript interfaces separately. If you wanted, you could add a validation step that fails the build if the schema and interface are out of sync (which prevents us from releasing when they're out of sync).
I added a test to validate both the BsLintConfig
and json-schema against a fixture, to be able to load it from the test file from TS though I had to move the schema in the src
folder.
Summary
feat: add json schema for bslint.json and generate types from it
Details
bslint.schema.json
given the current supported properties and types supported by bslintjson2ts
to auto generate the types from the schema to prevent duplicate maintenance.~solves https://github.com/rokucommunity/bslint/issues/104
How it was tested
npm run build
andnpm run test
in this project