Skip to content

Commit 043c9c8

Browse files
committed
[Release] v1.2.1
1 parent ffade11 commit 043c9c8

File tree

10 files changed

+26
-22
lines changed

10 files changed

+26
-22
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
######################################################################################
22
# License: MIT - http://opensource.org/licenses/MIT #
3-
# Author: Patryk Rzucidlo (@ptkdev) <support@ptkdev.io> https://ptkdev.it #
3+
# Author: Patryk Rzucidło (@ptkdev) <support@ptkdev.io> https://ptkdev.it #
44
# Original: octocat - https://github.com/octocat #
55
# Latest version: https://github.com/ptkdev/dotfiles #
66
######################################################################################

AUTHORS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Patryk Rzucidlo (@ptkdev) support@ptkdev.io
1+
# Patryk Rzucidło (@ptkdev) support@ptkdev.io
22
[![https://ptkdev.it](https://ptkdev.it/img/ptkdev_patryk_rzucidlo_avatar_150.png)](https://ptkdev.it)
33

44
`Lead Developer - May 27, 2018`

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# v1.2.0 (October 08, 2018)
22

3-
* Feature: eslint --fix param, auto replace camelCase to snake_case
3+
* Feature: eslint --fix parameter, auto replace camelCase to snake_case
44

55

66
# v1.1.0 (October 01, 2018)

INSTALL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#### Setup
2-
1. Install eslint: `npm install eslint --save`
2+
1. Install eslint: `npm install eslint --save-dev`
33
2. Install snakecasejs plugin: `npm install eslint-plugin-snakecasejs --save-dev`
44
3. Create `.eslintrc.json` file with:
55
```

ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ much detail as possible.
3333
2. ...
3434
3. ...
3535

36-
### Screenshots (Optional)
36+
### Screenshot (Optional)
3737

3838
If the error is graphical in nature it is helpful to provide a screenshot.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Copyright (c) 2018 Patryk Rzucidło
55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
77
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
to use, copy, modify, merge, publish, distribute, sub-license, and/or sell
99
copies of the Software, and to permit persons to whom the Software is
1010
furnished to do so, subject to the following conditions:
1111

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22

33
# ESLint Plugin snakecasejs
44

5-
[![](https://img.shields.io/badge/license-MIT-brightgreen.svg)](#) [![](https://img.shields.io/badge/powered%20by-eslint-46aef7.svg)](https://www.npmjs.com/package/eslint) [![](https://img.shields.io/badge/version-v1.2.0-lightgrey.svg)](https://github.com/ptkdev/eslint-plugin-snakecasejs/releases) [![](https://img.shields.io/badge/chat%20on-slack-orange.svg)](http://slack.ptkdev.io) [![](https://img.shields.io/badge/chat%20on-discord-7289da.svg)](http://discord.ptkdev.io) [![](https://img.shields.io/badge/blog-medium-2AE176.svg)](http://blog.ptkdev.io) [![](https://img.shields.io/badge/twitter-ptkdevio-2AA3EF.svg)](https://twitter.com/ptkdevio)
5+
[![](https://img.shields.io/badge/license-MIT-brightgreen.svg)](#) [![](https://img.shields.io/badge/powered%20by-eslint-46aef7.svg)](https://www.npmjs.com/package/eslint) [![](https://img.shields.io/badge/version-v1.2.1-lightgrey.svg)](https://github.com/ptkdev/eslint-plugin-snakecasejs/releases) [![](https://img.shields.io/badge/chat%20on-slack-orange.svg)](http://slack.ptkdev.io) [![](https://img.shields.io/badge/chat%20on-discord-7289da.svg)](http://discord.ptkdev.io) [![](https://img.shields.io/badge/blog-medium-2AE176.svg)](http://blog.ptkdev.io) [![](https://img.shields.io/badge/twitter-ptkdevio-2AA3EF.svg)](https://twitter.com/ptkdevio)
66

77
[![](https://img.shields.io/badge/donate-patreon-F87668.svg)](http://patreon.ptkdev.io) [![](https://img.shields.io/badge/donate-paypal-46AFE0.svg)](http://paypal.ptkdev.io) [![](https://img.shields.io/badge/buy%20me-coffee-4B788C.svg)](http://coffee.ptkdev.io) [![](https://img.shields.io/badge/help-support@ptkdev.io-fbbc05.svg)](mailto:support@ptkdev.io)
88

99
## What does it do
10-
This is to enforce a style of snake_case in your project, rather than just disabling camelcase.
10+
This is to enforce a style of snake_case in your project, rather than just disabling camelCase.
1111

1212
## Features
1313
* [] Easy to use
1414
* [] MIT License
1515
* [] Compatible with latest version of ESLint
1616
* [] Compatible with CamelCase (Class name or similar)
1717
* [] Compatible with --fix (convert automatically camelCase to snake_case)
18-
* [] Whitelist array for methods or variables with camelCase syntax from other libraries/npm package.
18+
* [] White list array for methods or variables with camelCase syntax from other libraries/npm package.
1919

2020
## Fast setup
21-
1. Install eslint: `npm install eslint --save`
21+
1. Install eslint: `npm install eslint --save-dev`
2222
2. Install snakecasejs plugin: `npm install eslint-plugin-snakecasejs --save-dev`
2323
3. Create `.eslintrc.json` file with:
2424
```
@@ -41,10 +41,13 @@ NOTE: switch `error` to `warn` if you don't need snake_case as mandatory rules.
4141
For advanced configuration see [INSTALL.md](https://github.com/ptkdev/eslint-plugin-snakecasejs/blob/master/INSTALL.md).
4242

4343
## --fix
44-
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:
44+
This eslint parameter fix simple rules of linter and with this plugin convert all camelCase variables or function name to snake_case.
45+
Fix command support whitelist. Run this command in your project directory:
4546
- `eslint ./ --cache --ignore-pattern .gitignore --fix`
4647

47-
## Whitelist
48+
**WARNING:** You need install eslint globally for this feature: `npm install eslint -g`
49+
50+
## White list
4851
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).
4952

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

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "eslint-plugin-snakecasejs",
33
"description": "Eslint plugin to enforce a style of snake_case in your project, rather than just disabling camelCase.",
4-
"version": "1.2.0-3",
4+
"version": "1.2.1",
55
"main": "plugin.js",
6-
"author": "Patryk Rzucidlo [@ptkdev] <support@ptkdev.io> (https://ptkdev.it)",
6+
"author": "Patryk Rzucidło [@ptkdev] <support@ptkdev.io> (https://ptkdev.it)",
77
"author_original": "David Buchan-Swanson <david.buchanswanson@gmail.com>",
88
"license": "MIT",
99
"homepage": "https://ptkdev.io",
@@ -43,6 +43,7 @@
4343
"node": ">=7.6.0"
4444
},
4545
"devDependencies": {
46-
"pre-commit": "^1.2.2"
46+
"eslint": "latest",
47+
"pre-commit": "latest"
4748
}
4849
}

plugin.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
22
* ESLint: snakecasejs
33
* =====================
4-
* This is to enforce a style of snake_case in your project, rather than just disabling camelcase.
4+
* This is to enforce a style of snake_case in your project, rather than just disabling camelCase.
55
*
6-
* @author: Patryk Rzucidlo [@ptkdev] <support@ptkdev.io> (https://ptkdev.it)
6+
* @author: Patryk Rzucidło [@ptkdev] <support@ptkdev.io> (https://ptkdev.it)
77
* @original: David Buchan-Swanson <david.buchanswanson@gmail.com>
88
* @license: This code and contributions have 'MIT License'
99
*
@@ -18,7 +18,7 @@ try {
1818
/**
1919
* Whitelist exist?
2020
* =====================
21-
* Set empry array if whitelist is undefined in eslintrc
21+
* Set empty array if whitelist is undefined in eslintrc
2222
*
2323
*/
2424
if (typeof eslintrc.rules["snakecasejs/whitelist"] == "undefined") {
@@ -28,7 +28,7 @@ if (typeof eslintrc.rules["snakecasejs/whitelist"] == "undefined") {
2828
/**
2929
* Detect var and function
3030
* =====================
31-
* Filter code, find funcrions name and variables
31+
* Filter code, find functions name and variables
3232
*
3333
*/
3434
function filter(node) {
@@ -72,7 +72,7 @@ module.exports = {
7272
identifier: node.name,
7373
},
7474

75-
// --fix eslint param: detect camelCase and convert in snake_case
75+
// --fix eslint parameter: detect camelCase and convert in snake_case
7676
fix(fixer) {
7777
return fixer.replaceText(node, node.name.split(/(?=[A-Z])/).join("_").toLowerCase());
7878
}

test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
22
* snakecasejs
33
* =====================
4-
* This is to enforce a style of snake_case in your project, rather than just disabling camelcase.
4+
* This is to enforce a style of snake_case in your project, rather than just disabling camelCase.
55
*
6-
* @author: Patryk Rzucidlo [@ptkdev] <support@ptkdev.io> (https://ptkdev.it)
6+
* @author: Patryk Rzucidło [@ptkdev] <support@ptkdev.io> (https://ptkdev.it)
77
* @original: David Buchan-Swanson <david.buchanswanson@gmail.com>
88
* @license: This code and contributions have 'MIT License'
99
*

0 commit comments

Comments
 (0)