New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@labeg/code-style

Package Overview
Dependencies
Maintainers
1
Versions
236
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@labeg/code-style

Code styles rules for difference linters, for create best code quality

latest
Source
npmnpm
Version
6.10.21
Version published
Weekly downloads
107
122.92%
Maintainers
1
Weekly downloads
 
Created
Source

CodeStyle

npm version npm downloads GitHub build status CodeQL

Comprehensive ESLint configuration for TypeScript and React projects with strict code quality rules.

Features

  • ESLint 9+ with flat config format
  • TypeScript support with strict rules
  • React 19+ and React Hooks best practices
  • Accessibility checks (jsx-a11y)
  • Code style enforcement (@stylistic)
  • Modern JavaScript standards

Included Plugins

This configuration includes and configures the following ESLint plugins:

Installation

Install the package as a dev dependency:

npm install -D @labeg/code-style

Usage

ESLint 9+ (Flat Config)

Create or update your eslint.config.js:

import codeStyle from "@labeg/code-style";

export default [
    ...codeStyle,
    {
        // Your custom overrides
        rules: {
            // Override specific rules here
        }
    }
];

Next.js Projects

import nextVitals from "eslint-config-next/core-web-vitals";
import codeStyle from "@labeg/code-style";

export default [
    ...nextVitals,
    ...codeStyle,
    {
        rules: {
            // Next.js specific overrides
            "react/react-in-jsx-scope": "off"
        }
    }
];

TypeScript Projects

The configuration automatically works with TypeScript files (.ts, .tsx). Make sure you have typescript installed:

npm install -D typescript

Code Style Philosophy

Always End Lines with Operators or Semicolons

Lines should always end with an operator or semicolon to make it clear whether the statement continues. This saves reading time and prevents execution errors.

// Bad - unclear if statement continues
let sample = sample.sample.sample
                 + sample.sample.sample;

// Good - operator at end shows continuation
let sample = sample.sample.sample +
                 sample.sample.sample;

Always Use Braces for If Statements

Even for single-line statements, always use braces. This prevents bugs during refactoring and improves code clarity.

// Bad
if (n > 10) alert("Bad");

// Good
if (n > 10) {
    alert("Good");
}

Use Double Quotes and Template Literals

Use double quotes for consistency with other languages, and template literals for string interpolation.

const message = "rolls";
const count = 5;

// Bad
const data = 'Sending "grandma" ' + count * 5 + ' ' + message + '.';

// Good
const data = `Sending "grandma" ${count * 5} ${message}.`;

Line Length: 120 Characters, Indent: 4 Spaces

Optimal line length is 120 characters for readability across different monitors. Use 4-space indentation for clear nesting levels.

Security

For security concerns, please see our Security Policy.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

License

MIT © Eugene Labutin

Keywords

code style

FAQs

Package last updated on 01 Apr 2026

Did you know?

Socket

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.

Install

Related posts