Skip to main content

Getting Started

Install the plugin:

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

Enable one preset in your Flat Config:

import etcMisc from "eslint-plugin-etc-misc";

export default [
etcMisc.configs.recommended,
];

Use minimal or recommended first, then move through stricter presets as your baseline stabilizes.

Alternative: manual scoped setup

If you prefer to apply plugin rules inside your own file-scoped config object, spread the preset rules manually.

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

export default [
{
files: ["**/*.{ts,tsx,mts,cts}"],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: "latest",
// Enable only when using a type-aware preset.
// projectService: true,
sourceType: "module",
},
},
plugins: {
"etc-misc": etcMisc,
},
rules: {
...etcMisc.configs.recommended.rules,
},
},
];

Use this pattern when you only extend rules and want full control over parser setup per scope.

  1. Start with minimal if you want to defer the typescript/prefer-readonly* rules.
  2. Move to recommended for the full baseline.
  3. Promote to strict when you want the same rules to hard-fail.
  4. Move to strictTypeChecked once your lint config is fully type-aware.
  5. Adopt allStrict or all when you want full rule coverage.

See the Presets section in this sidebar for details and examples.