You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
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:
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.
The text was updated successfully, but these errors were encountered: