xojs/xo

Use tsconfig/bases/strictest

devinrhode2 opened this issue · 2 comments

If we wanted to be maximally opinionated, use: https://github.com/tsconfig/bases/blob/main/bases/node16-strictest-esm.combined.json

I personally do not like unit testing (yet), so XO with the "strictest" base tsconfig I think would be amazing!

If we wanted to be slightly less opinionated, we can just use the "strictest" config here: https://github.com/tsconfig/bases/blob/main/bases/strictest.json

I believe we already have the strictest config:

xo/lib/constants.js

Lines 121 to 131 in f952701

const TSCONFIG_DEFAULTS = {
compilerOptions: {
target: 'es2018',
newLine: 'lf',
strict: true,
noImplicitReturns: true,
noUnusedLocals: true,
noUnusedParameters: true,
noFallthroughCasesInSwitch: true,
},
};

Not all compiler properties apply to the TS ESlint plugin.

Interesting. How can XO know what compiler settings have any effect on the TS ESLint plugin? The project could export an object type 💡

This gets me thinking,
What if instead of having ANY defaults here, we just fail and tell the user to add their own tsconfig