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

Add a lint to ban specific built-in functions #422

Closed
nex3 opened this issue Nov 22, 2019 · 4 comments · Fixed by #844
Closed

Add a lint to ban specific built-in functions #422

nex3 opened this issue Nov 22, 2019 · 4 comments · Fixed by #844
Labels
New rule 👌 Ready to be created as a new rule

Comments

@nex3
Copy link
Contributor

nex3 commented Nov 22, 2019

The random() function exists primarily for Sass demos to produce cool effects—it's pretty much always a bad idea to use in real stylesheets. We should add an (off-by-default) lint to forbid this function, whether from the global namespace or from sass:math.

cc @rambleraptor

@nex3
Copy link
Contributor Author

nex3 commented Nov 22, 2019

Maybe a more general way to do this would be to have a lint that just takes a list of banned functions.

@kristerkari
Copy link
Collaborator

@nex3
Copy link
Contributor Author

nex3 commented Nov 26, 2019

No, that rule isn't aware of Sass's module syntax.

@kristerkari
Copy link
Collaborator

No, that rule isn't aware of Sass's module syntax.

I see.

Maybe a more general way to do this would be to have a lint that just takes a list of banned functions.

This seems like a good option to add in addition to the function-blacklist rule.

@nex3 nex3 changed the title Add a lint to ban the random() function Add a lint to ban specific built-in functions Nov 27, 2019
@kristerkari kristerkari added New rule 👌 Ready to be created as a new rule PR made 🚀 A Pull Request has been created. and removed PR made 🚀 A Pull Request has been created. labels Jan 28, 2020
pamelalozano16 added a commit to pamelalozano16/stylelint-scss that referenced this issue Aug 3, 2023
pamelalozano16 added a commit to pamelalozano16/stylelint-scss that referenced this issue Aug 3, 2023
pamelalozano16 added a commit to pamelalozano16/stylelint-scss that referenced this issue Aug 3, 2023
pamelalozano16 added a commit to pamelalozano16/stylelint-scss that referenced this issue Aug 4, 2023
pamelalozano16 added a commit to pamelalozano16/stylelint-scss that referenced this issue Aug 4, 2023
pamelalozano16 added a commit to pamelalozano16/stylelint-scss that referenced this issue Aug 7, 2023
pamelalozano16 added a commit to pamelalozano16/stylelint-scss that referenced this issue Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New rule 👌 Ready to be created as a new rule
Development

Successfully merging a pull request may close this issue.

2 participants