chore: switch to estree
compatible ast tooling
Can we just use single quotes everywhere?
The Drizzle adder creates the drizzle.config.ts
below currently:
if (!process.env.DATABASE_URL) throw new Error('DATABASE_URL is not set');
export default defineConfig({
schema: "./src/lib/server/db/schema.ts",
dbCredentials: {
url: process.env.DATABASE_URL
},
verbose: true,
strict: true,
dialect: "sqlite"
});
We now default to tabs and single quotes in new files
We have guessIndentString
, but it's only used for JSON. Can we use guessIndentString
for JS/TS as well? Barring that, can we set the formatting for existing files to match the default for new files?
Closes #44 Closes #118 Relates #100
This basically duplicates #100 at this point. See #100 for up and downsides of this approach.
I was initially intending to get rid of a lot more dependencies (like the dependencies for handling html) and use svelte-ast-print
instead, but this was opening too many issues at the same time. That's why I opted to "only" switch to acorn
and esrap
here, the rest can be done later.
Relevant PR's / issues
Benefits
svelte
ecosystemrecast
esrap
Downsides
TSEstree
as no good public alternative exists, that matches acorn
s output. We do have @typescript-eslint/types
but that was just the one with the smallest pain points. Still exploring other options.Latest commit: c850286
The changes in this PR will be included in the next version bump.
Name | Type |
---|---|
sv | Minor |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
npm i https://pkg.pr.new/sveltejs/cli/sv@380
npm i https://pkg.pr.new/sveltejs/cli/svelte-migrate@380
commit: c850286
updated PR description to be more accurate.
We are getting close... 🎉 Tests are finally green. Only thing left is to write some code to properly detect quotes
and indentation
and pass it to esrap
correctly. Then we should be good to go.