Following the long discussion in #1475, I think it would be nice to write a little roadmap to improve code consistency.
eslint{, } need no escape and neither do [, ] when used inside character class. Rule no-useless-escape.quotes.;.// @ts-ignore and fix the errors. These are trickier so I will wait until we merge #1543. See PR #1545.tslint.: when giving explicit type. Rule @typescript-eslint/type-annotation-spacing.eslint rules we want to enforcetype over interface. See here.src/lib."@typescript-eslint/no-parameter-properties": "off"..plist syntax files to .tmLanguage.json. I find .json files much easier to edit and maintain and they allow for more elaborate constructions not available in the .plist (say .xml) format. The vscode-tmlanguage extension can be used as a conversion tool.Such changes may induce a lot of modifications and tend to blur file history. So, I want to make sure there is no objection before making any change. I will try to update this post with any further discussion.
The Done ticks refer to the developments in branch format.
I prefer type to interface. To my understanding, the difference is little. However, the declaration merging of interface might become a trouble-maker. See link.
We can use prefer-arrow-callback as an alternative to only-arrow-functions.
I prefer
prefer-arrow-callback: [ "error", { "allowUnboundThis": false } ]
This setting
prohibits the use of function expressions as callbacks or function arguments entirely, without exception.
I want to add@typescript-eslint/ban-ts-ignore. See link.
We had better exclude src/lib/**/*.ts using .eslintignore.
I have posted separated comments to enable them to be hidden if resolved.
Some remaining errors, eslint is complaining about.
@typescript-eslint/no-explicit-any. Fixing this often requires some extra code and is sometimes virtually impossible as in Promise<any> or { [string]: any}.@typescript-eslint/no-parameter-properties.What about stylistic rules?
I cannot find a strong reason to enforce @typescript-eslint/no-parameter-properties.
I think enforcing @typescript-eslint/no-explicit-any would reduce a number of bugs. But I am not sure it is feasible.
We can refer to the migration process by TypeScript team here. In it, both the options are turned off at present.
I agree with you on enforcing @typescript-eslint/no-explicit-any but I am struggling a bit in particular when extending classes from the vscode API. I do not think we can change the signature...
To eliminate the warning, warning File ignored because of a matching ignore pattern, we have to call eslint with ., not with a glob pattern, src/**/*.ts. See eslint/eslint/issues/5623.
By adding the following entries to .eslintignore,
diff --git a/.eslintignore b/.eslintignore
index 5e8f5ff..e959428 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1 +1,6 @@
src/lib/**/*.ts
+dev/**/*.js
+resources/**/*.js
+out
+node_modules
+viewer
we have to call eslint with the --ext option,
./node_modules/.bin/eslint --ext .ts .
The extension will be able to be specified in a config file in the future release. See https://github.com/eslint/rfcs/tree/master/designs/2019-additional-lint-targets