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
- Install eslint:
npm install eslint --save - Install snakecasejs plugin:
npm install eslint-plugin-snakecasejs --save-dev - Create
.eslintrc.jsonfile with:
{
"plugins": [
"snakecasejs"
],
"rules":
{
"snakecasejs/snakecasejs": "error",
"snakecasejs/whitelist": []
}
}- If it works add a star ⭐ at this project ❤️
- 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)
