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

Bug: Issue with the rule n/file-extension-in-import on migrating from [email protected] to [email protected] #405

Open
1 task
govind-srinidhi opened this issue Jan 8, 2025 · 0 comments
Labels

Comments

@govind-srinidhi
Copy link

Environment

Node version: 20.12.2
npm version: 10.2.3
ESLint version: 9.16.0
eslint-plugin-n version: 17.10.2
Operating System: Mac

What rule do you want to report?

n/file-extension-in-import

Link to Minimal Reproducible Example

https://eslint-online-playground.netlify.app/#eNp9Uk1vnDAQ/SuWL+yuwJvtoVXJNZVyaqtKPZUcLJilpsZGtkkTIf57xh8QNhvlBJ558+bNm5moNfWxs4WzhegHbRxzlpa0UvFFJjIYodw9SKnJTM5G9yRjxxAs/vpodnsFFtdI4WGVOo+qdkKrCPzthLS7PZkqRTZ9dvvXt9jtsXCmeRC6kEWR8BS6XnL6ikhYa2W1BCZ1u8vuRbYQOYuZs2hZZ7VCmgCuaK37QUgwPwZPZitaRhqfU/pbL5wPOTOCj85Xorzyj3TFyd6TFlxc1IGViGarRORL7sbMTzm2Qn3XDUSLq1RRDCFRqIoGp5OIBs58lI788W3TPGcc05YYoofD8cAmZ/POzhV9yGNectWOvIXkxOoD7oQbuzq0iROymPpLa3cnTEnSNfXgOGuEUbyHRB+IjO6gdtHPNY6mhk8KxIm2fVR55cJliRnDaGsBru7oxy3gyYGyKLtAj6I2v070AIzRpqI5Yrn8z59x8zmZMlxlVpJMwSOYLMdL7jbvebEqKPbNH25xdwOv/6Fvbw7LPQ/ge1W01w3qQ/6YaODxDgZQDahawOXFxTFj2Vd2+sxuUtlrcrNxjzp9Yacb9mkD841tbcSQeCR3YPH/HUCx7bfg1jufXwBhKF5k

What did you expect to happen?

The rule n/file-extension-in-import is expected to throw lint errors when the extensions are not included in the imports. However when we configure the rule as below:

 "n/file-extension-in-import": ["error", "always", {'.ts': 'never', '.js': 'never'}],

Then it's expected to not throw the lint errors when the imported files are missing for ts and js imports. This used to work well in [email protected], but seems like there's a bug in 17.x

Screenshot 2025-01-08 at 13 48 46

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

No response

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

No branches or pull requests

1 participant