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.2.0 to 1.2.1

10

dist/rules/schema.js

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

properties: {
order: { '$ref': '#/definitions/order' },
order: { $ref: '#/definitions/order' },
groups: {
patternProperties: {
'^.+$': { '$ref': '#/definitions/order' }
'^.+$': { $ref: '#/definitions/order' }
},

@@ -34,4 +34,6 @@ additionalProperties: false

type: { enum: ['method', 'property'] },
static: { type: 'boolean' },
kind: { enum: ['get', 'set'] }
kind: { enum: ['get', 'set'] },
propertyType: { type: 'string' },
accessorPair: { type: 'boolean' },
static: { type: 'boolean' }
},

@@ -38,0 +40,0 @@ additionalProperties: false

27

dist/rules/sort-class-members.js

@@ -30,3 +30,3 @@ 'use strict';

return {
'ClassDeclaration': function ClassDeclaration(node) {
ClassDeclaration: function ClassDeclaration(node) {
var members = getClassMemberInfos(node, context.getSourceCode(), orderedSlots);

@@ -90,3 +90,10 @@

var _message = 'Expected {{ source }} to come {{ expected }} {{ target }}.';
reportProblem({ problem: _problem, message: _message, context: context, stopAfterFirst: stopAfterFirst, problemCount: problemCount, groupAccessors: groupAccessors });
reportProblem({
problem: _problem,
message: _message,
context: context,
stopAfterFirst: stopAfterFirst,
problemCount: problemCount,
groupAccessors: groupAccessors
});

@@ -415,5 +422,5 @@ if (stopAfterFirst) {

var builtInGroups = {
'properties': { type: 'property' },
'getters': { kind: 'get' },
'setters': { kind: 'set' },
properties: { type: 'property' },
getters: { kind: 'get' },
setters: { kind: 'set' },
'accessor-pairs': { accessorPair: true },

@@ -423,3 +430,3 @@ 'static-properties': { type: 'property', static: true },

'arrow-function-properties': { propertyType: 'ArrowFunctionExpression' },
'methods': { type: 'method' },
methods: { type: 'method' },
'static-methods': { type: 'method', static: true },

@@ -440,4 +447,8 @@ 'conventional-private-methods': { type: 'method', name: '/_.+/' },

return s.accessorPair && m.matchingAccessor;
} }, { property: 'propertyType', value: 11, test: function test(m, s) {
} }, {
property: 'propertyType',
value: 11,
test: function test(m, s) {
return m.type === 'property' && s.propertyType === m.propertyType;
} }];
}
}];
{
"name": "eslint-plugin-sort-class-members",
"version": "1.2.0",
"version": "1.2.1",
"description": "ESLint rule for enforcing consistent ES6 class member order.",

@@ -25,6 +25,9 @@ "keywords": [

"scripts": {
"build": "npm run lint && npm run test && rm -rf dist && babel src --out-dir dist",
"prebuild": "npm run lint && npm run prettier-check && npm run test",
"build": "rm -rf dist && babel src --out-dir dist",
"test": "NODE_ENV=test nyc --reporter=lcov --reporter=text mocha test/**/*.js",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"lint": "eslint src/ test/",
"prettier": "prettier --write './{src,test}/**/*.js'",
"prettier-check": "prettier --list-different './{src,test}/**/*.js'",
"patch": "release patch",

@@ -48,4 +51,6 @@ "minor": "release minor",

"eslint": "^3.0.1",
"eslint-config-prettier": "^2.6.0",
"mocha": "^3.0.2",
"nyc": "^8.1.0",
"prettier": "^1.7.3",
"release-script": "^1.0.2"

@@ -52,0 +57,0 @@ },

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

Members can be matched to positional slots using several criteria, including name (exact match or regexp), member type (method or property), and whether or not the member is static. Each match slot is described by an object with five properties, all of which are optional.
Members can be matched to positional slots using several criteria, including name (exact match or regexp), member type (method or property), and whether or not the member is static. Each match slot is described by an object with six properties, all of which are optional.
* `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.

@@ -98,0 +98,0 @@ * `type`: `"method"|"property"`. **Note**: Class properties currently require a custom parser like [babel-eslint](https://github.com/babel/babel-eslint).

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