Skip to content

Fix linting of TypeScript files

Erwan Rouchet requested to merge vue-typescript-eslint into master

Closes #1164 (closed)

This updates .eslintrc.js to match the default linting settings that Vue CLI defines when installing both TypeScript and ESLint at once in an initial project. We added TypeScript after the project was initially created and Vue CLI handles this type of update pretty poorly, so we did not have a good linting configuration for TypeScript.

This causes TypeScript to run on JS files too, which adds a limited amount of additional linting there, and applies some extra automatic fixes. The new linting rules are not happy when we do something like while (true), so I had to rewrite a few loops, and they automatically fix some if, .some(), .find() and .indexOf() so that every condition results in a boolean; if (….length) becomes if (….length > 0) for example.

Due to some misconfiguration during my attempts to fix the linting, I now know that there are at least 1500 more linting errors that are waiting for us to switch everything to TypeScript!

Merge request reports

Loading