Flatten Deno.Json

/icons/calendar.svg

Last update

Dec 1, 2024

This codemod helps developers migrate their deno.json configuration files to the new flattened schema format, making them easier to read and write. It automates the transformation of nested properties to their new top-level structure as outlined in recent Deno updates.

Before

{
"lint": {
"files": {
"exclude": ["gen.ts"]
}
},
"fmt": {
"options": {
"lineWidth": 80,
"useTabs": false
}
}
}

After

{
"lint": {
"exclude": ["gen.ts"]
},
"fmt": {
"lineWidth": 80,
"useTabs": false
}
}

The codemod handles the following transformations on the config file

BeforeAfter
bench.files.includebench.include
bench.files.excludebench.exclude
fmt.files.includefmt.include
fmt.files.excludefmt.exclude
fmt.options.useTabsfmt.useTabs
fmt.options.lineWidthfmt.lineWidth
fmt.options.indentWidthfmt.indentWidth
fmt.options.singleQuotefmt.singleQuote
fmt.options.proseWrapfmt.proseWrap
fmt.options.semiColonsfmt.semiColons
lint.files.includelint.include
lint.files.excludelint.exclude
test.files.includetest.include
test.files.excludetest.exclude

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now