screepers / screeps-server-mockup

Private server package for unit tests
MIT License
55 stars 13 forks source link

ESLint for Typescript branch #19

Closed brisberg closed 4 years ago

brisberg commented 4 years ago

NOTE: Branch includes publish-options, so it should not be merged or possibly reviewed until #18 is merged.

Updated ESLint to use the Airbnb typescript base, and the typescript parser so that it can lint .ts files.

Updated the package.json commands to run on the TS files.

Removed a couple of rules which don't work with this project:

Fixed all existing lint errors in the TS.

Also regenerated yarn.lock, which contributed to the large diff.

--

Note: the airbnb eslint config can be installed without supporting React / TSX tooling. However, this leaves some unresolved peer dependencies which are actually optional. On a fresh yarn install you will see this in the console:

[3/4] 🔗  Linking dependencies...
warning "eslint-config-airbnb-typescript > eslint-config-airbnb@18.0.1" has unmet peer dependency "eslint-plugin-jsx-a11y@^6.2.3".
warning "eslint-config-airbnb-typescript > eslint-config-airbnb@18.0.1" has unmet peer dependency "eslint-plugin-react@^7.14.3".
warning "eslint-config-airbnb-typescript > eslint-config-airbnb@18.0.1" has unmet peer dependency "eslint-plugin-react-hooks@^1.7.0".

We can install these deps to remove these warnings, but the packages will not do anything except bloat the install. Your call.

Install procedures: https://www.npmjs.com/package/eslint-config-airbnb-typescript

pyrodogg commented 4 years ago

I think it's fine leaving the peers off. They're not necessary, and if the warning is only thrown on initial install it hopefully shouldn't be too confusing to users.