Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-sort-class-members

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-sort-class-members - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

14

dist/rules/sort-class-members.js

@@ -88,6 +88,6 @@ 'use strict';

for (var _iterator2 = problems[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var problem = _step2.value;
var _problem = _step2.value;
var message = 'Expected {{ source }} to come {{ expected }} {{ target }}.';
reportProblem({ problem: problem, message: message, context: context, stopAfterFirst: stopAfterFirst, problemCount: problemCount, groupAccessors: groupAccessors });
var _message = 'Expected {{ source }} to come {{ expected }} {{ target }}.';
reportProblem({ problem: _problem, message: _message, context: context, stopAfterFirst: stopAfterFirst, problemCount: problemCount, groupAccessors: groupAccessors });

@@ -155,3 +155,3 @@ if (stopAfterFirst) {

var typeName = undefined;
var typeName = void 0;
if (member.matchingAccessor && groupAccessors) {

@@ -183,4 +183,4 @@ typeName = 'accessor pair';

function getMemberInfo(node, sourceCode) {
var name = undefined;
var type = undefined;
var name = void 0;
var type = void 0;

@@ -316,3 +316,3 @@ if (node.type === 'ClassProperty') {

var slot = undefined;
var slot = void 0;
if (typeof input === 'string') {

@@ -319,0 +319,0 @@ slot = input[0] === '[' // check for [groupName] shorthand

{
"name": "eslint-plugin-sort-class-members",
"version": "1.0.1",
"version": "1.0.2",
"description": "ESLint rule for enforcing consistent ES6 class member order.",

@@ -26,5 +26,5 @@ "keywords": [

"build": "npm run lint && npm run test && rm -rf dist && babel src --out-dir dist",
"test": "babel-node node_modules/.bin/isparta cover --report text-summary --report lcov node_modules/mocha/bin/_mocha -- --recursive",
"test": "NODE_ENV=test nyc --reporter=lcov --reporter=text mocha test/**/*.js",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"lint": "eslint src/ test/",
"ci": "npm run build && cat coverage/lcov.info | node_modules/.bin/coveralls",
"patch": "release patch",

@@ -39,13 +39,14 @@ "minor": "release minor",

"devDependencies": {
"@bryanrsmith/eslint-config-standard": "1.0.0",
"babel-cli": "6.4.0",
"babel-eslint": "5.0.0",
"babel-preset-es2015": "6.3.13",
"babel-preset-stage-1": "6.3.13",
"babel-register": "6.3.13",
"coveralls": "2.11.6",
"eslint": "^1.3.1",
"isparta": "4.0.0",
"mocha": "^2.3.2",
"release-script": "0.5.8"
"@bryanrsmith/eslint-config-standard": "^2.1.3",
"babel-cli": "^6.9.0",
"babel-eslint": "^6.1.0",
"babel-plugin-istanbul": "^2.0.1",
"babel-preset-latest": "^6.14.0",
"babel-preset-stage-2": "^6.13.0",
"babel-register": "^6.9.0",
"coveralls": "^2.11.9",
"eslint": "^3.0.1",
"mocha": "^3.0.2",
"nyc": "^8.1.0",
"release-script": "^1.0.2"
},

@@ -58,6 +59,23 @@ "engines": {

"presets": [
"stage-1",
"es2015"
]
"latest",
"stage-2"
],
"env": {
"test": {
"plugins": [
"istanbul"
]
}
}
},
"nyc": {
"include": [
"src/**/*.js"
],
"require": [
"babel-register"
],
"sourceMap": false,
"instrument": false
}
}

@@ -97,3 +97,3 @@ [![build status][travis-image]][travis-url]

* `name`: a string matching the name of the member. If the string starts and ends with `/` it will be interpreted as a regular expression. E.g., `"/_.+/"` will match members whose name starts with an underscore.
* `type`: `"method"|"property"`. Note that class properties currently require a custom parser like [babel-eslint](https://github.com/babel/babel-eslint).
* `type`: `"method"|"property"`. **Note**: Class properties currently require a custom parser like [babel-eslint](https://github.com/babel/babel-eslint).
* `kind`: `"get"|"set"`. A subtype of `type: "method"` that can match getter or setter methods.

@@ -110,3 +110,3 @@ * `accessorPair`: `true|false`. True to match only getters and setters that are part of a pair. i.e., only those that have both `get` and `set` methods defined.

Note that you can simply use a string if you only want to match on the name.
**Note**: You can simply use a string if you only want to match on the name.

@@ -125,4 +125,7 @@ The following groups are provided by default:

**NOTE**: Currently only ES2016 property initializers are matched by `"type": "property"`. Properties added via assignment are not considered by this rule.
**NOTE**: Currently only class properties using the proposed syntax are matched by `"type": "property"`. Properties added via assignment are not considered by this rule.
## Acknowledgements
Inspired by the `sort-comp` rule from [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react).
[travis-image]: https://img.shields.io/travis/bryanrsmith/eslint-plugin-sort-class-members/master.svg?style=flat-square

@@ -129,0 +132,0 @@ [travis-url]: https://travis-ci.org/bryanrsmith/eslint-plugin-sort-class-members

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc