CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-stylistic--eslint-plugin-ts

TypeScript stylistic rules for ESLint providing comprehensive code style enforcement for modern ESLint configurations.

Pending
Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

index.mddocs/

ESLint Stylistic TypeScript Plugin

⚠️ DEPRECATION NOTICE: This package is deprecated in favor of the unified @stylistic/eslint-plugin. Please consider migrating to the main package.

ESLint Stylistic TypeScript Plugin provides TypeScript-specific stylistic and formatting rules for ESLint. This package serves as a community-maintained alternative after ESLint and typescript-eslint teams deprecated formatting rules from their core packages, offering comprehensive TypeScript code style enforcement for modern ESLint configurations.

Package Information

  • Package Name: @stylistic/eslint-plugin-ts
  • Package Type: npm
  • Language: TypeScript
  • Installation: npm install @stylistic/eslint-plugin-ts
  • Migration: Consider migrating to @stylistic/eslint-plugin (unified package)

Core Imports

import stylistic from "@stylistic/eslint-plugin-ts";

For CommonJS:

const stylistic = require("@stylistic/eslint-plugin-ts");

For specific rules:

import blockSpacing from "@stylistic/eslint-plugin-ts/rules/block-spacing";

Basic Usage

import stylistic from "@stylistic/eslint-plugin-ts";

// Basic ESLint configuration
export default [
  {
    plugins: {
      "@stylistic/ts": stylistic,
    },
    rules: {
      "@stylistic/ts/indent": ["error", 2],
      "@stylistic/ts/quotes": ["error", "single"],
      "@stylistic/ts/semi": ["error", "always"],
    },
  },
];

// Using predefined configurations
export default [
  stylistic.configs.all, // Enable all stylistic rules
];

Architecture

The plugin is built around several key components:

  • Plugin Object: Main export containing rules and configurations
  • Rules Collection: 25 TypeScript-specific stylistic rules
  • Configuration Presets: Pre-configured rule sets for common use cases
  • Type Definitions: Complete TypeScript interfaces for all rule options
  • Individual Rule Exports: Direct access to specific rules for custom configurations

Capabilities

Plugin Configuration

Core plugin object providing rules and configuration presets for ESLint integration.

interface Plugin {
  rules: Rules;
  configs: {
    "disable-legacy": Linter.Config;
    "all": Linter.Config;
    "all-flat": Linter.Config; // @deprecated use 'all' instead
  };
}

interface Rules {
  [K in keyof UnprefixedRuleOptions]: Rule.RuleModule;
}

Plugin Configuration

Stylistic Rules

Collection of 25 TypeScript-specific formatting and style rules including spacing, indentation, quotes, semicolons, and object/array formatting.

interface UnprefixedRuleOptions {
  "block-spacing": BlockSpacingRuleOptions;
  "brace-style": BraceStyleRuleOptions;
  "comma-dangle": CommaDangleRuleOptions;
  "comma-spacing": CommaSpacingRuleOptions;
  "func-call-spacing": FunctionCallSpacingRuleOptions;
  "function-call-spacing": FunctionCallSpacingRuleOptions;
  "indent": IndentRuleOptions;
  "key-spacing": KeySpacingRuleOptions;
  "keyword-spacing": KeywordSpacingRuleOptions;
  "lines-around-comment": LinesAroundCommentRuleOptions;
  "lines-between-class-members": LinesBetweenClassMembersRuleOptions;
  "member-delimiter-style": MemberDelimiterStyleRuleOptions;
  "no-extra-parens": NoExtraParensRuleOptions;
  "no-extra-semi": NoExtraSemiRuleOptions;
  "object-curly-newline": ObjectCurlyNewlineRuleOptions;
  "object-curly-spacing": ObjectCurlySpacingRuleOptions;
  "object-property-newline": ObjectPropertyNewlineRuleOptions;
  "padding-line-between-statements": PaddingLineBetweenStatementsRuleOptions;
  "quote-props": QuotePropsRuleOptions;
  "quotes": QuotesRuleOptions;
  "semi": SemiRuleOptions;
  "semi-spacing": SemiSpacingRuleOptions;
  "space-before-blocks": SpaceBeforeBlocksRuleOptions;
  "space-before-function-paren": SpaceBeforeFunctionParenRuleOptions;
  "space-infix-ops": SpaceInfixOpsRuleOptions;
  "type-annotation-spacing": TypeAnnotationSpacingRuleOptions;
}

Stylistic Rules

Types

import type { Linter, Rule } from "eslint";

interface Rules {
  [K in keyof UnprefixedRuleOptions]: Rule.RuleModule;
}

declare const plugin: {
  rules: Rules;
  configs: {
    "disable-legacy": Linter.Config;
    "all": Linter.Config;
    "all-flat": Linter.Config;
  };
};

docs

index.md

plugin-configuration.md

stylistic-rules.md

tile.json