The code was previously unlinted and had a few unused variables, loose comparators, and uses of var that could easily be let. Running the linter and Prettier over the code will make it easier to keep consistent.
How
Installed Prettier, ESLint, and eslint-config-universe. Added eslintConfig and prettier to package.json to configure them. For now, we use the "shared/core" and "shared/prettier" ESLint configurations in order to exclude the TypeScript configuration, since this library doesn't use TS.
I also moved the source code under src so that the linter could easily target that one directory. This will also make it easier to set up TypeScript if we do that one day.
Also added a linter check to CI.
Test Plan
Ran npm test to make sure the local tests in this repo pass. Also used an example project from https://github.com/iddan/expo-2d-context-test.git with the expo-2d-context dependency pointed at my local repo to ensure it works in a real Expo app via Expo CLI and Expo Go.
Why
The code was previously unlinted and had a few unused variables, loose comparators, and uses of
var
that could easily belet
. Running the linter and Prettier over the code will make it easier to keep consistent.How
Installed Prettier, ESLint, and eslint-config-universe. Added eslintConfig and prettier to package.json to configure them. For now, we use the "shared/core" and "shared/prettier" ESLint configurations in order to exclude the TypeScript configuration, since this library doesn't use TS.
I also moved the source code under
src
so that the linter could easily target that one directory. This will also make it easier to set up TypeScript if we do that one day.Also added a linter check to CI.
Test Plan
Ran
npm test
to make sure the local tests in this repo pass. Also used an example project from https://github.com/iddan/expo-2d-context-test.git with theexpo-2d-context
dependency pointed at my local repo to ensure it works in a real Expo app via Expo CLI and Expo Go.Verify that CI passes.