Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork4
✏️ ESLint Plugin: enforce snake_case syntax on variables and function names
License
ptkdev/eslint-plugin-snakecasejs
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
ESLint Plugin to enforce a style of snake_case in your project, rather than just disabling camelCase.
This project isfree,open source and I try to provide excellentfree support. Why donate? I work on this project several hours in my spare time and try to keep it up to date and working.THANK YOU!
- 💡Features
- 🚀How to use
- 🧩 Configs:
- 📚Documentation
- ❤️Contributing
- 🐛Known Bugs
- 🍻 Community:
- [✔️] Easy to use
- [✔️] MIT License
- [✔️] Compatible with latest version of ESLint
- [✔️] Compatible with CamelCase (Class name or similar)
- [✔️] Compatible with --fix (convert automatically camelCase to snake_case)
- [✔️] White list array for methods or variables with camelCase syntax from other libraries/npm package.
- Install eslint:
npm install eslint --save-dev
- Install snakecasejs plugin:
npm install eslint-plugin-snakecasejs --save-dev
- Create
.eslintrc.json
file with:
{"plugins": ["snakecasejs" ],"settings": {"snakecasejs/filter": ["ClassDeclaration","NewExpression"],"snakecasejs/whitelist": ["externalPath","setNumber"] },"rules": {"snakecasejs/snakecasejs":"error" }}
- If it works add a star 🌟 at this project ❤️
- If you want to help me:donate onpaypal/ko-fi or become abacker on patreon.
NOTE: switcherror
towarn
if you don't need snake_case as mandatory rule.
This eslint parameter fix simple rules of linter and with this plugin convert all camelCase variables or function name to snake_case.Fix command support whitelist. Run this command in your project directory:
eslint ./ --cache --ignore-pattern .gitignore --fix
WARNING: You need install eslint globally for this feature:npm install eslint -g
Ignore variables, methods, etc... without snake_case syntax. Add to settings:"snakecasejs/whitelist": ["NewPageClass"]
with array of variables with camelCase that you can not convert to snake_case (example: for external library naming convention).
Plugin ignore check on this variables/methods. Example:"snakecasejs/whitelist": ["externalPath","setNumber"]
Ignore global checks for class declarations, all methods, etc... Add to settings:"snakecasejs/filter": []
with array of eslint expression or declaration, default value:["ClassDeclaration", "NewExpression"]
for better compatibility with camel case class.
Runnpm run docs
Support this project by becoming a sponsor. 🙏 Become a sponsor onpatreon or become top3 sponsor onko-fi. Your logo will show up here with a link to your website.
Thank you to all our backers! 🙏 Become a backer onpatreon.
I 💟 contributions! I will happily accept your pull request! Translations, grammatical corrections (GrammarNazi you are welcome! Yes my English is bad, sorry), etc... Do not be afraid, if the code is not perfect we will work together 👯 and remember to insert your name in.all-contributorsrc
andpackage.json
file.
Thanks goes to these wonderful people (emoji key):
Patryk Rzucidło 💻 | David Buchan-Swanson 💻 | Tomasz Domański 💻 |
💰 In the future, if the donations allow it, I would like to share some of the success with those who helped me the most. For me open source is share of code, share development knowledges and share donations!
- Code and Contributions haveMIT License
- Images and logos haveCC BY-NC 4.0 License (Freepik Premium License)
- Documentations and Translations haveCC BY 4.0 License
Copyleft (c) 2018-2019Patryk Rzucidło (@PTKDev) <support@ptkdev.io>
About
✏️ ESLint Plugin: enforce snake_case syntax on variables and function names
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Languages
- JavaScript100.0%