shootismoke / mobile-app

See your city's air pollution measured in daily cigarettes. iOS/Android.
https://shootismoke.app
GNU General Public License v3.0
484 stars 119 forks source link

Clean up all `@typescript-eslint/no-unsafe-*` linting issues #619

Open amaury1093 opened 4 years ago

amaury1093 commented 4 years ago

I turned off these 3 rules:

    rules: {
        '@typescript-eslint/no-unsafe-assignment': 'off',
        '@typescript-eslint/no-unsafe-call': 'off',
        '@typescript-eslint/no-unsafe-member-access': 'off',
    },

because there were too many instances in the codebase. It would be nice to clean them up.

steveny9911 commented 4 years ago

@amaurymartiny Hihi, could I take a stab at this?

amaury1093 commented 4 years ago

yes, please go ahead! Thanks 🙏

steveny9911 commented 4 years ago

I'm going through some no-unsafe-assignment; not sure how I should handle some remaining ones

1️⃣

// shoot-i-smoke/App/localization/index.ts (line 24 - 27)

i18n.translations = {
    en,
    'en-US': enUS,
};

^ not sure how I should handle this

2️⃣

// shoot-i-smoke/e2e/init.ts (line 20)

const config = require('../package.json').detox;

^ this seems ok as recommended by the doc and some googling; should I just flag eslint to ignore this line?

3️⃣ scripts/generateAppJson.js should probably get just get eslint ignored

amaury1093 commented 4 years ago

Thanks! Yes, you can add some eslint-disable for now. Ideally, when you have an initial version of your changes, could you push your code and create a PR? I'll then pull down your branch, fiddle a bit on my side if I can figure out the no-unsafe-assignments (especially the 1st one).

steveny9911 commented 4 years ago

I opened a work in progress pull request; feel free to look it over.

steveny9911 commented 4 years ago

I have started looking at no-unsafe-call 1️⃣ shoot-i-smoke\App\stores\util\hawk.ts Seems like there's just no typescript support, I'll take a look at https://www.npmjs.com/package/@types/hapi__hawk/v/8.0.0 not sure if this could work

2️⃣ shoot-i-smoke\e2e\init.ts and shoot-i-smoke\e2e\locationDenied.spec.ts Error around jasmine and reloadApp(); doesn't seem like there's any typescript support as well

3️⃣ scripts/generateAppJson.js could probably get just get eslint ignored

amaury1093 commented 4 years ago
  1. Yes, definitely give @types/hapi__hawk a try! 2 & 3. Okay to just add eslint-ignore in those files

Thanks for this work @steveny9911 💪

BatDroid commented 4 years ago

anything is left here to be done by someone else (me) ?

amaury1093 commented 4 years ago

I didn't hear back from @steveny9911, so I think you can go for it @BatDroid!

The items '@typescript-eslint/no-unsafe-call': 'off', and '@typescript-eslint/no-unsafe-member-access': 'off', are still up for grabs.

BatDroid commented 3 years ago

I'm new here. when i try to run the project on ios, it loads and when it reaches to 100% it crashes the whole expo app without any proper report in flipper.