johnfn / ts2gd

💥 Compile TypeScript to GDScript for Godot
210 stars 14 forks source link

Adding Eslint #67

Closed ksjogo closed 2 years ago

ksjogo commented 2 years ago

With a growing amount of contributors and increasing activity, it might be good to standardize the code style a bit more and try to catch issues earlier, thus this PR adds eslint to the codebase and runs it before commits. The PR is split in two commits, the first one is adding the config and might be quicker to review standalone. The second one is running eslint --fix over the codebase, largely only changing import order and some whitespaces. The following set of the default eslint rules is currently disabled:

    "prefer-const": "off",
    "@typescript-eslint/no-empty-function": "off",
    "@typescript-eslint/no-explicit-any": "off",
    "@typescript-eslint/no-unused-vars": "off",
    "@typescript-eslint/no-non-null-assertion": "off",

As the codebase wasis using all these. We could look it enabling these rules in the future.

johnfn commented 2 years ago

This LGTM! We can bikeshed the eslintrc later if necessary :)