Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@typescript-eslint/no-unsafe-call on every method call #1421

Closed
seia-soto opened this issue Oct 15, 2022 · 3 comments
Closed

@typescript-eslint/no-unsafe-call on every method call #1421

seia-soto opened this issue Oct 15, 2022 · 3 comments

Comments

@seia-soto
Copy link

seia-soto commented Oct 15, 2022

I understand that the Eris want a nice backward compatibility and respect for it. However, it's breaking on modern development environment with ESLint instead on conventional development environment. Here is a brief listing of my environment:

{
  ...,
  "devDependencies": {
    "@types/node": "^18.11.0",
    "@typescript-eslint/eslint-plugin": ">=5.31.0",
    "@typescript-eslint/parser": ">=5.31.0",
    "eslint": ">=8.0.0",
    "eslint-config-xo": "^0.42.0",
    "eslint-config-xo-typescript": "^0.53.0",
    "ts-node": "^10.9.1",
    "tslib": "^2.4.0",
    "typescript": ">=4.4"
  },
  "dependencies": {
    "eris": "^0.17.1",
    "erlpack": "github:abalabahaha/erlpack",
    "zlib-sync": "0.1"
  }
}

I see @typescript-eslint/no-unsafe-call error on every call. However, I couldn't find that any direct and simple solution except for disabling the rule on the entire project. Can we have some an appropriate solution to this?

import erisFactory from 'eris';

(async () => {
	// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
	const bot = erisFactory(process.env.DISCORD_TOKEN, {
		rest: {
			latencyThreshold: 5 * 1000,
		},
		intents: [],
	});

	// eslint-disable-next-line @typescript-eslint/no-unsafe-call
	bot.once('ready', stream => {
		console.log(stream);
	});
})();

You can create a duplicated environment using the following git repository: https://github.com/seia-soto/eris-issue-4021

@eritbh
Copy link
Contributor

eritbh commented Oct 15, 2022

Can't reproduce the issue on a fresh clone of your repo. This is probably an issue with your TS environment; Eris does provide typings for its functions, so the error you're reporting doesn't make sense.
index.ts ln 4 col 2: Unused eslint-disable directive (no problems were reported from '@typescript-eslint/no-unsafe-assignment' or '@typescript-eslint/no-unsafe-call').

@seia-soto
Copy link
Author

Oh, it should be. I checked this morning after a night, and can't reproduce either. Thanks for double-checking.

@seia-soto
Copy link
Author

Seems like a temporal error on my machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants