eslint-plugin-sort-class-members
Advanced tools
Comparing version 1.15.2 to 1.16.0
@@ -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, |
{ | ||
"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"`. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31619
13
635
149