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

Does plugin consider nested object destructuring when analyzing require statements? #11

Open
WarioNeila86 opened this issue Dec 27, 2021 · 1 comment

Comments

@WarioNeila86
Copy link

WarioNeila86 commented Dec 27, 2021

Hi, thanks for this plugin!

I've started experimenting a bit with it and I've found out that it seems to ignore require statements that are using nested object destructuring.

Check this example:

const {C: {nestedProperty}} = require('./c.js');
const {A} = require('./a.js');
const {B} = require('./b.js');
const a = new A();
const b = new B();
const c = new nestedProperty();

It doesn't really matter where you put the line with nestedProperty, ESLint do not throw any errors. Hence I'm wondering if this might be an issue or just the expected behaviour.

I would expect it to complain cause nestedProperty is using small caps for the first letter, so it should be placed after {B}.

I'm using default config with 'require-sort/require-sort': 'error' in my .eslintrc.js file.

Thanks again.

@WarioNeila86 WarioNeila86 changed the title Does plugin consider object destructuring when analyzing require statements? Does plugin consider nested object destructuring when analyzing require statements? Dec 27, 2021
@zcuric
Copy link
Owner

zcuric commented Sep 13, 2022

@WarioNeila86 thanks for feedback!

When I developed this I think I did not implement the check for nested object restructuring. I'll take a look soon (TM).

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