quick-lint / quick-lint-js

quick-lint-js finds bugs in JavaScript programs
https://quick-lint-js.com
GNU General Public License v3.0
1.55k stars 192 forks source link

refactor: rename import_alias -> namespace_alias #1138

Closed strager closed 8 months ago

SamInverted commented 11 months ago

Does this mean anything named with import_alias should be renamed to namespace_alias?

strager commented 11 months ago

Anything related to the following syntax is a namespace alias (despite the fact that the keyword import is used):

import ns = otherns;

Anything related to the following syntax is an import alias (thus shouldn't be renamed):

import m = require('mod');

(I forgot about the second case when I filed this issue.)

This task would involve going through each instance of import_alias or import alias in the code, figuring out whether it's an import alias or a namespace alias, and renaming when it's a namespace aliases.

cmstoddard commented 10 months ago

@strager close this?

strager commented 10 months ago

@cmstoddard No, this issue is still present.

UnfairBots commented 10 months ago

Hello, I have a few questions:

strager commented 10 months ago

I found some files in test folder, which has some function name like ...import_alias... but verifies namespace alias, does it mean to change function name to ...namespace_alias...?

Yes.

In both cases import alias and namespace alias you mentioned, the same error message display (TypeScript import aliases are not allowed in JavaScript- E0274), do we also need to have a new message to match with namespace alias case?

I wasn't thinking about this, but it'd be nice to have different messages for the different cases, yes.