eslint-plugin-etc-misc

June 18, 2026 ยท View on GitHub

npm version. npm downloads. license.

Opinionated ESLint plugin that combines and curates rules from etc and misc style linting patterns for TypeScript-heavy codebases.

Credits

This plugin builds on ideas and rule work from:

Installation

npm install --save-dev eslint-plugin-etc-misc eslint typescript

Usage (Flat Config)

import etcMisc from "eslint-plugin-etc-misc";
import tsParser from "@typescript-eslint/parser";

export default [
 {
  files: ["**/*.{ts,tsx,mts,cts}"],
  languageOptions: {
   parser: tsParser,
   parserOptions: {
    ecmaVersion: "latest",
    sourceType: "module",
   },
  },
 },
 etcMisc.configs.recommended,
];

If your project uses CommonJS config files, require() works too:

// eslint.config.cjs
const etcMisc = require("eslint-plugin-etc-misc");

module.exports = [etcMisc.configs.recommended];

A good way to adopt this plugin is to pick only the rules you want, then scope them manually to the files where they provide the most value.

import tsParser from "@typescript-eslint/parser";
import etcMisc from "eslint-plugin-etc-misc";

export default [
 {
  files: ["src/**/*.{ts,tsx,mts,cts}"],
  languageOptions: {
   parser: tsParser,
   parserOptions: {
    ecmaVersion: "latest",
    sourceType: "module",
   },
  },
  plugins: {
   "etc-misc": etcMisc,
  },
  rules: {
   "etc-misc/no-assign-mutated-array": "error",
   "etc-misc/no-internal": "error",
   "etc-misc/typescript/require-this-void": "warn",
  },
 },
];

Plugin namespace

Rules are namespaced as etc-misc/<rule-name>, for example:

{
    plugins: {
        "etc-misc": etcMisc,
    },
    rules: {
        "etc-misc/no-t": "error",
    },
}

Presets

Preset
๐ŸŸข etcMisc.configs.minimal
๐ŸŸก etcMisc.configs.recommended
๐ŸŸ  etcMisc.configs.strict
๐Ÿ”ต etcMisc.configs.strictTypeChecked
๐Ÿ”ด etcMisc.configs.allStrict
๐ŸŸฃ etcMisc.configs.all

Rules

RuleFixPreset keyDeprecatedRecommended replacement
array-type๐Ÿ”ง๐Ÿ”ด ๐ŸŸฃโš ๏ธ@typescript-eslint/array-type
class-match-filenameโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
comment-spacingโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
consistent-empty-linesโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
consistent-enum-membersโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
consistent-filenameโ€”๐Ÿ”ด ๐ŸŸฃโš ๏ธunicorn/filename-case
consistent-importโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
consistent-optional-props๐Ÿ”ง๐ŸŸข ๐ŸŸก ๐ŸŸ  ๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
consistent-source-extensionโ€”๐Ÿ”ด ๐ŸŸฃโš ๏ธimport/extensions
consistent-symbol-descriptionโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
default-caseโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
disallow-importโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
export-matching-filename-onlyโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
match-filenameโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
max-identifier-blocksโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-assign-mutated-arrayโ€”๐ŸŸข ๐ŸŸก ๐ŸŸ  ๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-at-sign-importโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-at-sign-internal-importโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-chain-coalescence-mixtureโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-commented-out-codeโ€”๐Ÿ”ด ๐ŸŸฃโš ๏ธno-commented-code
no-const-enum๐Ÿ”ง ๐Ÿ’ก๐ŸŸข ๐ŸŸก ๐ŸŸ  ๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-deprecatedโ€”๐Ÿ”ด ๐ŸŸฃโš ๏ธ@typescript-eslint/no-deprecated
no-enumโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-expression-empty-lines๐Ÿ”ง๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-foreachโ€”๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-function-declare-after-return๐Ÿ”ง๐ŸŸข ๐ŸŸก ๐ŸŸ  ๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-implicit-any-catch๐Ÿ”ง ๐Ÿ’ก๐ŸŸข ๐ŸŸก ๐ŸŸ  ๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-index-importโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-internalโ€”๐ŸŸข ๐ŸŸก ๐ŸŸ  ๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-internal-modulesโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-language-mixingโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-misused-genericsโ€”๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-mixed-enumsโ€”๐Ÿ”ด ๐ŸŸฃโš ๏ธ@typescript-eslint/no-mixed-enums
no-negated-conditionsโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-nodejs-modulesโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-param-reassignโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-relative-parent-importโ€”๐Ÿ”ด ๐ŸŸฃโš ๏ธimport/no-relative-parent-imports
no-restricted-syntaxโ€”๐Ÿ”ด ๐ŸŸฃโš ๏ธno-restricted-syntax
no-secretโ€”๐Ÿ”ด ๐ŸŸฃโš ๏ธsecretlint ยท detect-secrets ยท no-secrets/no-secrets
no-self-importโ€”๐Ÿ”ด ๐ŸŸฃโš ๏ธimport/no-self-import
no-shadowโ€”๐Ÿ”ด ๐ŸŸฃโš ๏ธ@typescript-eslint/no-shadow
no-sibling-importโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-single-line-comment๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-tโ€”๐ŸŸข ๐ŸŸก ๐ŸŸ  ๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-underscore-exportโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-unnecessary-as-const๐Ÿ”ง๐ŸŸข ๐ŸŸก ๐ŸŸ  ๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-unnecessary-break๐Ÿ”ง ๐Ÿ’ก๐ŸŸข ๐ŸŸก ๐ŸŸ  ๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-unnecessary-initialization๐Ÿ”ง๐ŸŸข ๐ŸŸก ๐ŸŸ  ๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-unnecessary-template-literal๐Ÿ”ง๐ŸŸข ๐ŸŸก ๐ŸŸ  ๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-unused-disableโ€”๐Ÿ”ด ๐ŸŸฃโš ๏ธ@eslint-community/eslint-comments/no-unused-disable
no-use-extend-nativeโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-useless-generics๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโš ๏ธ@typescript-eslint/no-unnecessary-type-parameters
no-value-tostringโ€”๐Ÿ”ด ๐ŸŸฃโš ๏ธ@typescript-eslint/no-base-to-string
no-vulnerableโ€”๐ŸŸข ๐ŸŸก ๐ŸŸ  ๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
no-writeonlyโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
object-formatโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
only-export-nameโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
prefer-arrow-function-propertyโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
prefer-const-requireโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
prefer-includes๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโš ๏ธunicorn/prefer-includes
prefer-interface๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโš ๏ธ@typescript-eslint/consistent-type-definitions
prefer-less-than๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
prefer-object-has-own๐Ÿ”ง๐Ÿ”ด ๐ŸŸฃโš ๏ธeslint/prefer-object-has-own
prefer-only-exportโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
require-jsdocโ€”๐Ÿ”ด ๐ŸŸฃโš ๏ธjsdoc/require-jsdoc
require-syntaxโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
restrict-identifier-charactersโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
sort-array๐Ÿ”ง๐Ÿ”ด ๐ŸŸฃโ€”โ€”
sort-call-signatureโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
sort-class-membersโ€”๐Ÿ”ด ๐ŸŸฃโš ๏ธsort-class-members ยท perfectionist
sort-construct-signatureโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
sort-export-specifiers๐Ÿ”ง๐Ÿ”ด ๐ŸŸฃโ€”โ€”
sort-keys๐Ÿ”ง๐Ÿ”ด ๐ŸŸฃโ€”โ€”
sort-top-comments๐Ÿ”ง๐Ÿ”ด ๐ŸŸฃโ€”โ€”
switch-case-spacingโ€”๐Ÿ”ด ๐ŸŸฃโš ๏ธ@stylistic/switch-colon-spacing
template-literal-format๐Ÿ”ง๐Ÿ”ด ๐ŸŸฃโ€”โ€”
throw-error๐Ÿ’ก๐ŸŸข ๐ŸŸก ๐ŸŸ  ๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
throw-new-error๐Ÿ”ง๐Ÿ”ด ๐ŸŸฃโš ๏ธunicorn/throw-new-error
typescript/array-callback-return-typeโ€”๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/class-methods-use-thisโ€”๐Ÿ”ด ๐ŸŸฃโš ๏ธ@typescript-eslint/class-methods-use-this
typescript/consistent-array-type-nameโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/define-function-in-one-statementโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/exhaustive-switchโ€”๐Ÿ”ด ๐ŸŸฃโš ๏ธ@typescript-eslint/switch-exhaustiveness-check
typescript/no-boolean-literal-type๐Ÿ”ง๐ŸŸข ๐ŸŸก ๐ŸŸ  ๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/no-complex-declarator-typeโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/no-complex-return-typeโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/no-empty-interfacesโ€”๐Ÿ”ด ๐ŸŸฃโš ๏ธ@typescript-eslint/no-empty-object-type
typescript/no-inferrable-typesโ€”๐Ÿ”ด ๐ŸŸฃโš ๏ธ@typescript-eslint/no-inferrable-types
typescript/no-multi-type-tuplesโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/no-neverโ€”๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/no-redundant-undefined-const๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/no-redundant-undefined-default-parameter๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/no-redundant-undefined-let๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/no-redundant-undefined-optional๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/no-redundant-undefined-promise-return-type๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/no-redundant-undefined-readonly-property๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/no-redundant-undefined-return-type๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/no-redundant-undefined-var๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/no-restricted-syntaxโ€”๐Ÿ”ด ๐ŸŸฃโš ๏ธ@typescript-eslint/no-restricted-syntax
typescript/no-unsafe-object-assignโ€”๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/no-unsafe-object-assignmentโ€”๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/prefer-array-type-aliasโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/prefer-class-methodโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/prefer-enumโ€”๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/prefer-named-tuple-members๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/prefer-readonly-array๐Ÿ”ง๐ŸŸก ๐ŸŸ  ๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/prefer-readonly-array-parameter๐Ÿ”ง ๐Ÿ’ก๐ŸŸก ๐ŸŸ  ๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/prefer-readonly-index-signature๐Ÿ”ง๐ŸŸก ๐ŸŸ  ๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/prefer-readonly-map๐Ÿ”ง๐ŸŸก ๐ŸŸ  ๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/prefer-readonly-property๐Ÿ”ง ๐Ÿ’ก๐ŸŸก ๐ŸŸ  ๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/prefer-readonly-record๐Ÿ”ง๐ŸŸก ๐ŸŸ  ๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/prefer-readonly-set๐Ÿ”ง๐ŸŸก ๐ŸŸ  ๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/require-prop-type-annotation๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/require-readonly-array-property-type๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/require-readonly-array-return-type๐Ÿ”ง ๐Ÿ’ก๐ŸŸข ๐ŸŸก ๐ŸŸ  ๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/require-readonly-array-type-alias๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/require-readonly-map-parameter-type๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/require-readonly-map-property-type๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/require-readonly-map-return-type๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/require-readonly-map-type-alias๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/require-readonly-record-parameter-type๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/require-readonly-record-property-type๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/require-readonly-record-return-type๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/require-readonly-record-type-alias๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/require-readonly-set-parameter-type๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/require-readonly-set-property-type๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/require-readonly-set-return-type๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/require-readonly-set-type-alias๐Ÿ”ง ๐Ÿ’ก๐Ÿ”ด ๐ŸŸฃโ€”โ€”
typescript/require-this-void๐Ÿ”ง ๐Ÿ’ก๐ŸŸข ๐ŸŸก ๐ŸŸ  ๐Ÿ”ต ๐Ÿ”ด ๐ŸŸฃโ€”โ€”
underscore-internalโ€”๐Ÿ”ด ๐ŸŸฃโ€”โ€”
unused-internal-propertiesโ€”๐Ÿ”ด ๐ŸŸฃโš ๏ธunicorn/no-unused-properties
uppercase-iifeโ€”๐Ÿ”ด ๐ŸŸฃโš ๏ธunicorn/no-unreadable-iife
wordsโ€”๐Ÿ”ด ๐ŸŸฃโš ๏ธwrite-good-comments

Documentation

Contributors

All Contributors.

Daniel Nixon
Daniel Nixon

๐Ÿ’ป
Felix Becker
Felix Becker

๐Ÿ’ป
Karl Horky
Karl Horky

๐Ÿ’ป
Martin Hochel
Martin Hochel

๐Ÿ’ป
Nicholas Jamieson
Nicholas Jamieson

๐Ÿ’ป
Nick2bad4u
Nick2bad4u

๐Ÿ› ๐Ÿ’ป ๐Ÿ–‹ ๐Ÿ“– ๐Ÿค” ๐Ÿš‡ ๐Ÿšง ๐Ÿ”Œ ๐Ÿ”ฌ ๐Ÿ‘€ โš ๏ธ ๐Ÿ”ง
Snyk bot
Snyk bot

๐Ÿ›ก๏ธ ๐Ÿš‡ ๐Ÿšง ๐Ÿ‘€
StepSecurity Bot
StepSecurity Bot

๐Ÿ›ก๏ธ ๐Ÿš‡ ๐Ÿšง
dependabot[bot]
dependabot[bot]

๐Ÿš‡ ๐Ÿ›ก๏ธ

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT