New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@m4ttheweric/eslint-plugin-unflag

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@m4ttheweric/eslint-plugin-unflag

``` pnpm add -D @m4ttheweric/eslint-plugin-unflag ```

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

eslint-plugin-unflag

pnpm add -D @m4ttheweric/eslint-plugin-unflag
import tseslint from 'typescript-eslint';
import unflag from '@m4ttheweric/eslint-plugin-unflag';

export default tseslint.config({
  files: ['src/**/*.{ts,tsx}'],
  languageOptions: {
    parser: tseslint.parser,
    parserOptions: { ecmaFeatures: { jsx: true } },
  },
  plugins: { unflag },
  rules: {
    'unflag/no-raw-config-reads': ['error', {
      restricted: [{ importSource: '../rawConfig' }, { importSource: './rawConfig' }],
      allowIn: ['**/features/**', '**/App.tsx', '**/rawConfig.ts'],
    }],
    'unflag/require-unready-for-deferred-reads': 'error',
  },
});

@m4ttheweric/eslint-plugin-unflag ships two rules.

unflag/no-raw-config-reads restricts raw config imports/reads to the modules you allow (typically the *.features.ts files and nothing else), so a stray flags['some-flag'] read or raw config import creeping into a component gets caught by the linter instead of a reviewer. restricted entries are either { importSource } (bans an import specifier) or { objectPattern } (bans a dotted member-access chain, e.g. window.__FLAGS__.foo); allowIn is a picomatch glob allowlist, defaulting to ['**/*.features.ts', '**/features/**'] when omitted.

unflag/require-unready-for-deferred-reads catches the defineFeatures mistake that only throws at runtime: a feature whose reads names a deferredInput input but declares no unready fallback. It also flags the opposite, dead config -- an unready on a feature that reads no deferred input -- unless inputs contains a spread, since an unseen spread key could be deferred. It takes no options and only recognizes defineFeatures / deferredInput imported (any local alias) from @m4ttheweric/unflag.

See @m4ttheweric/unflag for the library this rule enforces.

FAQs

Package last updated on 15 Aug 2026

Related posts