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

no-useless-path-segments does not work with require statements #1127

Closed
1pete opened this issue Jun 29, 2018 · 0 comments · Fixed by #1128
Closed

no-useless-path-segments does not work with require statements #1127

1pete opened this issue Jun 29, 2018 · 0 comments · Fixed by #1128

Comments

@1pete
Copy link
Contributor

1pete commented Jun 29, 2018

from rule's doc, it is described that it works with both import and require statements, but it actually work only with import statements

Given the following folder structure:

my-project
├── app.js
└── pages
    ├── about.js
    ├── contact.js
    └── index.js

tested code

/**
 *  in my-project/app.js
 */
require('./../pages/about.js');

Expectation: example pattern should be considered problem.
Actual: it's not.

You may also resolve this issue by amend the doc, but I hope you don't do it this way. 😛

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

Successfully merging a pull request may close this issue.

1 participant