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

[WIP] add allow/deny list options to no-namespace rule #1916

Conversation

chimericdream
Copy link

@chimericdream chimericdream commented Oct 3, 2020

Closes #1903

This is a starting point for adding this option. Unfortunately, I cannot get the tests to run on my local machine, so I am looking for help getting this tested so it can be merged.

Edit: it's worth noting that this is based on PR #1679 from earlier this year, with the primary difference being that this version of the option checks the namespace identifier rather than the variable name.

@coveralls
Copy link

Coverage Status

Coverage decreased (-3.2%) to 94.737% when pulling 7b745bd on chimericdream:feature/no-namespace-options into a00727e on benmosher:master.

@coveralls
Copy link

coveralls commented Oct 3, 2020

Coverage Status

Coverage decreased (-3.1%) to 94.737% when pulling 4d8e743 on chimericdream:feature/no-namespace-options into 9fa6bc9 on benmosher:master.

type: 'object',
properties: {
allowList: {
type: 'array',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's make sure both of these arrays must have unique items.

Comment on lines 129 to 132
for (const identifier of identifiers) {
if (list.includes(identifier)) {
return mode === 'deny'
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (const identifier of identifiers) {
if (list.includes(identifier)) {
return mode === 'deny'
}
}
}
return mode === 'deny' && identifiers.some((identifier) => list.includes(identifier));
}

@ljharb ljharb assigned ljharb and unassigned ljharb Jan 26, 2021
@ljharb ljharb marked this pull request as draft January 26, 2021 14:58
@ljharb
Copy link
Member

ljharb commented Jan 26, 2021

I rebased this; tests are still failing so it still needs some work.

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

Successfully merging this pull request may close these issues.

[no-namespace] allow namespace imports for specific modules
3 participants