Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
eslint-plugin-classes
Advanced tools
custom ESLint rule, checks class style. (will adding more rules for class)
should no space between method name and parens.
The following patterns are considered warnings:
class Foo {
bar () {
}
}
class Foo {
static bar () {
}
}
class Foo {
bar () {
}
buz() {
}
}
The following patterns are not warnings:
class Foo {
bar() {
}
}
class Foo {
static bar() {
}
}
class Foo {
bar() {
}
buz() {
}
}
The following patterns are considered warnings:
class foo {
}
class Foo {
Bar () {
}
}
The following patterns are not warnings:
class Foo {
}
class Foo {
bar () {
}
}
class should have constructor always even if empty body.
The following patterns are considered warnings:
class Foo {
}
class Foo {
bar() {
}
}
The following patterns are not warnings:
class Foo {
constructor() {
console.log('test');
}
}
class Foo {
constructor() {
}
bar() {
}
}
extended class should call super()
at the top of constructor.
The following patterns are considered warnings:
class Foo extends A {
bar() {
}
}
class Foo extends A {
constructor() {
this.bar();
}
bar() {
}
}
The following patterns are not warnings:
class Foo extends A {
constructor() {
super();
this.a = 10;
}
bar() {
}
}
class Foo extends A {
bar() {
}
constructor() {
super();
this.a = 10;
}
}
class Foo extends A {
constructor() {
// comments
super();
this.a = 10;
}
}
enforce order of definition of method in order of static method => constructor => instance methods.
The following patterns are considered warnings:
class Foo {
constructor() {}
static bar() {}
}
class Foo {
baz() {}
static bar() {}
constructor() {}
baz() {}
}
The following patterns are not warnings:
class Foo {
static bar() {}
static bal() {}
constructor() {}
baz() {}
biz() {}
bez() {}
}
plugins:
- classes
rules:
# Plugins
classes/space : 2
classes/name : [2, "class", "method"]
classes/constructor : 2
classes/super : 2
classes/style : 2
MIT
FAQs
custom ESLint rule, ckecks class style.
The npm package eslint-plugin-classes receives a total of 4,883 weekly downloads. As such, eslint-plugin-classes popularity was classified as popular.
We found that eslint-plugin-classes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.