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.15.2 to 1.16.0

3

dist/rules/schema.js

@@ -70,2 +70,5 @@ "use strict";

type: 'boolean'
},
accessibility: {
"enum": ['public', 'private', 'protected']
}

@@ -72,0 +75,0 @@ },

@@ -244,2 +244,4 @@ "use strict";

function getMemberInfo(node, sourceCode) {
var _node$accessibility;
var isPrivate = node.key.type === 'PrivateName' || node.key.type === 'PrivateIdentifier';

@@ -251,2 +253,3 @@ var name;

var decorators = [];
var accessibility = (_node$accessibility = node.accessibility) !== null && _node$accessibility !== void 0 ? _node$accessibility : 'public';
decorators = !!node.decorators && node.decorators.map(function (n) {

@@ -291,2 +294,3 @@ return n.expression.type === 'CallExpression' ? n.expression.callee.name : n.expression.name;

"private": isPrivate,
accessibility: accessibility,
kind: node.kind,

@@ -593,2 +597,8 @@ propertyType: propertyType,

}, {
property: 'accessibility',
value: 10,
test: function test(m, s) {
return s.accessibility == m.accessibility;
}
}, {
property: 'kind',

@@ -595,0 +605,0 @@ value: 10,

8

package.json
{
"name": "eslint-plugin-sort-class-members",
"version": "1.15.2",
"version": "1.16.0",
"description": "ESLint rule for enforcing consistent ES6 class member order.",

@@ -30,6 +30,3 @@ "keywords": [

"prettier": "prettier --write './{src,test}/**/*.js'",
"prettier-check": "prettier --list-different './{src,test}/**/*.js'",
"patch": "release patch",
"minor": "release minor",
"major": "release major"
"prettier-check": "prettier --list-different './{src,test}/**/*.js'"
},

@@ -52,3 +49,2 @@ "peerDependencies": {

"prettier": "^2.5.0",
"release-script": "^1.0.2",
"typescript": "^4.8.2"

@@ -55,0 +51,0 @@ },

@@ -107,2 +107,3 @@ [![build][ci-image]][ci-url]

- `private`: `true|false` to restrict the match to [private members](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields). **Note**: Private members currently require a custom parser like [babel-eslint](https://github.com/babel/babel-eslint).
- `accessibility`: `"public"|"private"|"protected"` to restrict the match to members with the specified typescript accessibility modifier. **Note**: Requires `@typescript-eslint/parser`.
- `async`: `true|false` to restrict the match to async members.

@@ -109,0 +110,0 @@ - `sort`: `"alphabetical"|"none"`. Used to require a specific sorting within the slot for matched members. Defaults to `"none"`.

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