Skip to content

Commit c3c1b72

Browse files
committed
[Release] v2.1.0
1 parent 3416b15 commit c3c1b72

File tree

4 files changed

+62
-65
lines changed

4 files changed

+62
-65
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [Unreleased]
1+
# v2.1.0 (December 04, 2019)
22
* Update: get settings from context rather that two levels up eslintrc.
33

44

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# 🐍 ESLint Plugin: snakecasejs
44

5-
[![](https://img.shields.io/badge/version-v2.0.3-lightgrey.svg)](https://github.com/ptkdev/eslint-plugin-snakecasejs/releases) [![](https://img.shields.io/npm/v/eslint-plugin-snakecasejs.svg)](https://www.npmjs.com/package/eslint-plugin-snakecasejs) [![](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/ptkdev/eslint-plugin-snakecasejs/blob/master/LICENSE.md) [![](https://img.shields.io/badge/ES-9-F7DF1E.svg)](https://wikipedia.org/wiki/ECMAScript) [![](https://img.shields.io/badge/powered%20by-eslint-46aef7.svg)](https://www.npmjs.com/package/eslint) [![](https://snyk.io/test/npm/eslint-plugin-snakecasejs/badge.svg)](https://snyk.io/test/github/eslint-plugin-snakecasejs)
5+
[![](https://img.shields.io/badge/version-v2.1.0-lightgrey.svg)](https://github.com/ptkdev/eslint-plugin-snakecasejs/releases) [![](https://img.shields.io/npm/v/eslint-plugin-snakecasejs.svg)](https://www.npmjs.com/package/eslint-plugin-snakecasejs) [![](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/ptkdev/eslint-plugin-snakecasejs/blob/master/LICENSE.md) [![](https://img.shields.io/badge/ES-9-F7DF1E.svg)](https://wikipedia.org/wiki/ECMAScript) [![](https://img.shields.io/badge/powered%20by-eslint-46aef7.svg)](https://www.npmjs.com/package/eslint) [![](https://snyk.io/test/npm/eslint-plugin-snakecasejs/badge.svg)](https://snyk.io/test/github/eslint-plugin-snakecasejs)
66

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

package-lock.json

Lines changed: 51 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugin.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,16 @@
55
*
66
* @contributors: Patryk Rzucidło [@ptkdev] <support@ptkdev.io> (https://ptkdev.it)
77
* David Buchan-Swanson <david.buchanswanson@gmail.com>
8+
* Tomasz Domański [@rozpuszczalny] <github@tomaszdomanski.com> (https://tomaszdomanski.com)
89
*
910
* @license: This code and contributions have 'MIT License'
1011
*
1112
*/
1213

13-
/**
14-
* Default list of names allowed to be camel cased
15-
*/
16-
const defaultWhitelist = [];
17-
/**
18-
* Default list of parent node types, that allows node to be camel cased
19-
*/
20-
const defaultFilter = ["ClassDeclaration", "NewExpression"];
14+
// Default list of names allowed to be camel cased
15+
const default_whitelist = [];
16+
// Default list of parent node types, that allows node to be camel cased
17+
const default_filter = ["ClassDeclaration", "NewExpression"];
2118

2219
/**
2320
* Detect function and variables name
@@ -32,10 +29,10 @@ module.exports = {
3229
fixable: true,
3330
},
3431
create (context) {
35-
const rawWhitelist = context.settings["snakecasejs/whitelist"];
36-
const whitelist = Array.isArray(rawWhitelist) ? rawWhitelist : defaultWhitelist;
37-
const rawSettings = context.settings["snakecasejs/filter"];
38-
const settings = Array.isArray(rawSettings) ? rawSettings : defaultFilter;
32+
const raw_whitelist = context.settings["snakecasejs/whitelist"];
33+
const whitelist = Array.isArray(context.settings["snakecasejs/whitelist"]) ? raw_whitelist : default_whitelist;
34+
const raw_settings = context.settings["snakecasejs/filter"];
35+
const settings = Array.isArray(context.settings["snakecasejs/filter"]) ? raw_settings : default_filter;
3936

4037
/**
4138
* Indicates if current node should be ignored for error report

0 commit comments

Comments
 (0)