-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
[Feature Request] Get functions/methods from 3rd parties #6
Comments
Use white-list |
Hi,
Thank you for your response. How is it possible to white list all the
external functions of all 3rd party packages?
…On Sat, Jun 19, 2021, 11:06 Patryk Rzucidło ***@***.***> wrote:
Use white-list
<https://github.com/ptkdev/eslint-plugin-snakecasejs#-white-list>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABC2LIR437T24WCXWWGVJKDTTRFWRANCNFSM46W67LPA>
.
|
Hi @levz0r ! .eslintrc.json {
"plugins": [
"snakecasejs"
],
"settings":
{
"snakecasejs/whitelist": ["readFileSync", "exampleFunc", "otherFunc"]
},
"rules":
{
"snakecasejs/snakecasejs": "error"
}
} |
So if I get it right then I should add all the functions of all the 3rd
parties I'm using in my project? Are you serious?
…On Mon, Jun 21, 2021 at 2:53 PM Patryk Rzucidło ***@***.***> wrote:
Hi @levz0r <https://github.com/levz0r> !
You need read documentation of 3rd party packages, create an array,
example ["readFileSync", "exampleFunc", "otherFunc"] and creare whitelist
<https://github.com/ptkdev/eslint-plugin-snakecasejs#-white-list> in
eslint dotfile. You can fork this repo and add this list in plugin.js
<https://github.com/ptkdev/eslint-plugin-snakecasejs/blob/b469a0ed2206a20cb30982d184b247b977af9cba/plugin.js#L52>
and send me pull request.
*.eslintrc.json*
{
"plugins": [
"snakecasejs"
],
"settings":
{
"snakecasejs/whitelist": ["readFileSync", "exampleFunc", "otherFunc"]
},
"rules":
{
"snakecasejs/snakecasejs": "error"
}
}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABC2LITRSRNAIR5BOAI4VMDTT4R4TANCNFSM46W67LPA>
.
|
@levz0r don't exist a way in javascript to get all methods/function from 3rd parties. I write all methods/functions manually in this plugin. If you find way to get v8 methods/functions or get it from 3rd parties you are welcome with PR. If you want add missing methods/functions in plugin.js and send PR you are welcome. |
@ptkdev is there a way to namespace the white list? for example, it is ok to ignore fs.readFileSync but if we whitelist What information do you get from eslint? is there anything we can use there? edit: another example is passportjs it has a function |
Can't you just exclusively lint the function and variable names that are declared in the user's code? Right now this is linting everything, even when I do anything like:
gets linted to:
which is clearly broken, as that module does not export a function by that name. |
on top of that, even |
Versions
Expected Behavior
The plugin should not warn when functions are not snake case in a 3rd party packages.
Actual Behavior
The plugin warns when functions are not snake case in a 3rd party packages.
Steps to Reproduce
Screenshots (Optional)
The text was updated successfully, but these errors were encountered: