JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4028
  • Score
    100M100P100Q128490F
  • License MIT

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

Package Exports

  • eslint-plugin-snakecasejs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-plugin-snakecasejs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ESLint Plugin snakecasejs

What does it do

This is to enforce a style of snake_case in your project, rather than just disabling camelcase.

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)
  • [✓] Whitelist array for methods or variables with camelCase syntax from other libraries/npm package.

Fast setup

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

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

For advanced configuration see INSTALL.md.

--fix

This eslint param fix simple rules of linter and with this plugin convert all camelCase variables or function name to snake_case. --fix support whitelist. Run this command in your project dir:

  • eslint ./ --cache --ignore-pattern .gitignore --fix

Whitelist

Ignore words, variables, methods, class name without snake_case syntax. Add rules: "snakecasejs/whitelist": [] with array of variables or method with camelCase that you can not convert to snake_case (external library naming convention).

Plugin ignore check on this words. Example: "snakecasejs/whitelist": ["externalPath","setNumber"]

License

MIT LICENSE

Copyright (c) 2018 Patryk Rzucidło (PTKDev)