I successfully configured a VS code project to adhere to the airbnb and typescript configuration, resulting in the expected behavior of typescript code linting.
To locate the .eslintrc.js file:
const path = require('path');
module.exports = {
root: true,
env: {
browser: true,
jquery: true
},
extends: [
'airbnb/base',
'plugin:@typescript-eslint/recommended',
],
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 2018,
sourceType: 'module',
},
settings: {
'import/resolver': {
alias: {
map: [
['@', path.resolve(__dirname, 'src')],
],
extensions: [
'.js', '.js', '.json',
],
},
},
},
rules: { // List of linting rules...
};
Although eslint also applies to the typescript compiled .js files, I prefer it not to. I experimented with the tsc compiler and prettier plugin for compiling according to airbnb rules, which seemed most desirable. Alternatively, I consider disabling eslint for the js files. While I have successfully configured a project to work with typescript, I struggle with handling the linting of compiled .js files and how to compile multiple files simultaneously in a project.
In addition to my specific query, any insights on the typescript workflow are welcome. I assume one compiles all tsc files and designates the corresponding tsc compiled .js file as the app entry point, but unsure if this is correct.
Many thanks in advance.