Answer the question
In order to leave comments, you need to log in
How do I set up Eslint and TypeScript to work in different environments within the same project?
There is a project on electron . It has several different directories, with code that should work in different environments and according to different rules:
- Backend - TypeScript for NodeJs with access to Electron specific APIs.
- Front - TypeScript + Vue for the browser
- Shared - TypeScript that runs in both NodeJs and browsers
- Assembly scripts - JavaScript for NodeJs
It turns out that for each of these folders you need to configure eslint and typescript. Some of the parameters are common to the entire project, and some are specific to each part of it. How to organize such environments? I see two options, but I don't really like both:
Answer the question
In order to leave comments, you need to log in
I do not really understand why you do not like the second option.
In the root of each environment, put configs extended from the initial ones.
Both ESLint and TSconfig have an extends field .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question