Chaz Watkins
Chaz Watkins3mo ago

Use ES Lint, Jest, Prettier configs with deno

I'm using some published ES Lint, Prettier, Jest configs for Salesforce LWCs provided by Salesforce. Is there a way to leverage these configs with deno lint, deno format, deno test commands? I don't see config options for this in the documentation.
7 Replies
bartlomieju
bartlomieju3mo ago
You might be able to use some of the options from prettier but for other too I don't think there's a way to do it
Chaz Watkins
Chaz WatkinsOP3mo ago
Is there a way to extend for a framework? I saw there were some unstable support for Vue and Svelte
bartlomieju
bartlomieju3mo ago
Could you please elaborate what do you mean? When working with Vue or Svelte you might have to use --unstable-sloppy-imports feature
Chaz Watkins
Chaz WatkinsOP3mo ago
Thanks for the responses and guidance. I had noticed the deno fmt --unstable-component flag and thought it could be extended. But, after reviewing the demo fmt code, I see it's simply looking at the file extensions for those frameworks and calling format_html since those frameworks name their HTML templates with custom extensions. LWC doesn't do this; it only has .html and js/ts files. So, the formatter should work for LWC. However, for linting, LWC has many ES Lint rules for various functionalities that the framework provides. Is there currently a way to add your own rules to deno lint? If not, are there any plans for this in the future?
bartlomieju
bartlomieju3mo ago
It's currently not possible but it's on the roadmap to provide a plugin system
Chaz Watkins
Chaz WatkinsOP3mo ago
Awesome. Deno looks great. You guys have done a phenomenal job. I’m looking forward to the extensibility. Thanks for the help and information.
bartlomieju
bartlomieju3mo ago
Thank you so much :deno_thankyou:

Did you find this page helpful?