npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

eslint-plugin-snakecasejs

v2.2.0

Published

ESLint Plugin to enforce a style of snake_case in your project, rather than just disabling camelCase.

Downloads

31,404

Readme

ESLint Plugin: snakecasejs

🐍 ESLint Plugin: snakecasejs

ESLint Plugin to enforce a style of snake_case in your project, rather than just disabling camelCase.

🎁 Support: Donate

This project is free, open source and I try to provide excellent free 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!

📎 Menu

💡 Features

  • [✔️] 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.

🚀 Fast setup

  1. Install eslint: npm install eslint --save-dev
  2. Install snakecasejs plugin: npm install eslint-plugin-snakecasejs --save-dev
  3. Create .eslintrc.json file with:
{
    "plugins": [
        "snakecasejs"
    ],
    "settings":
    {
        "snakecasejs/filter": ["ClassDeclaration", "NewExpression"],
        "snakecasejs/whitelist": ["externalPath", "setNumber"]
    },
    "rules":
    {
        "snakecasejs/snakecasejs": "error"
    }
}
  1. If it works add a star 🌟 at this project ❤️
  2. If you want to help me: donate on paypal/ko-fi or become a backer on patreon.

NOTE: switch error to warn if you don't need snake_case as mandatory rule.

🔧 --fix

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

📋 White list

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"]

🚬 Filter

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.

📚 Documentation

Run npm run docs

👑 Sponsors

Support this project by becoming a sponsor. 🙏 Become a sponsor on patreon or become top3 sponsor on ko-fi. Your logo will show up here with a link to your website.

🦄 Backers

Thank you to all our backers! 🙏 Become a backer on patreon.

❤️ Contributing

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 and package.json file.

Thanks goes to these wonderful people (emoji key):

💰 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!

📲 Tools

💫 License

  • Code and Contributions have MIT License
  • Images and logos have CC BY-NC 4.0 License (Freepik Premium License)
  • Documentations and Translations have CC BY 4.0 License
Copyleft (c) 2018-2019 Patryk Rzucidło (@PTKDev) <[email protected]>