@enigmax/linter

Ciphera-style linter and security auditor for TypeScript/JavaScript, with file-hygiene, blank-line, and hardcoded-secret checks extending to Python, Rust, and Prisma, plus embedded-code extraction for Jupyter notebooks, Astro, Vue, and Svelte.
1,388 3
Install
npm install @enigmax/linter
Latest Version:0.5.4
License:Apache-2.0
Last Updated:Oct 23, 2026
Links: GitHub  ·  npm
Maintainer: fjrg2007

@enigmax/linter

A small, fast linter and security auditor that enforces the Ciphera code style and flags hardcoded secrets. JavaScript/TypeScript is parsed with the TypeScript compiler API, so its style checks are AST-accurate rather than regex guesses; Python, Rust, and Prisma get the language-agnostic checks (file hygiene, blank-line collapsing, and secret detection) with lightweight per-language lexing so blanks inside docstrings, block comments, and multi-line strings are left alone.

Container formats - Jupyter notebooks (.ipynb), Astro (.astro), and Vue/Svelte single-file components (.vue, .svelte) - are understood structurally: the embedded code is extracted and linted as its real language, and the wrapper (JSON, HTML) is never fed to the rules. Violations are mapped back to the physical line in the original file.

It is meant to be run on demand - by a developer, by an agent as a self-check, or wired into a project's scripts/CI - not as an always-on background process.

Languages

Language Extensions Rules applied
TypeScript / JavaScript .ts .tsx .mts .cts .js .jsx .mjs .cjs all style + audit rules
Python .py .pyi no-consecutive-blank-lines, file-hygiene, no-hardcoded-secrets
Rust .rs no-consecutive-blank-lines, file-hygiene, no-hardcoded-secrets
Prisma .prisma no-consecutive-blank-lines, file-hygiene, no-hardcoded-secrets

The AST-based Ciphera style rules (length-sorted imports, double quotes, template literals, semicolons, URL imports) are JavaScript/TypeScript-only by design: they encode TS idioms and would misfire on other grammars (for example, Rust 'a' char literals or Python's idiomatic single quotes).

Container formats (embedded code)

Format Extensions Embedded code linted as
Jupyter notebook .ipynb each code cell as Python (markdown/raw cells and outputs ignored; non-Python kernels skipped)
Astro .astro the --- frontmatter as TypeScript plus every <script> block
Vue / Svelte .vue .svelte every <script> block, typed TS or JS by its lang attribute

Only the code regions are linted - the surrounding JSON or HTML template is never checked. The file-boundary part of file-hygiene (final newline, leading/trailing blank line) is skipped for embedded fragments, since the container owns the file's physical shape; trailing whitespace inside the code is still flagged. Every violation's line number refers to the physical line in the original file.

Usage

# lint the current directory
npx @enigmax/linter

# lint specific paths
npx @enigmax/linter src test

# only the security audit, or only style
npx @enigmax/linter --audit-only
npx @enigmax/linter --style-only

# apply safe formatting fixes in place, then report what remains
npx @enigmax/linter --fix

# machine-readable output
npx @enigmax/linter --json

# fail on warnings too (e.g. a changed-files commit/CI gate)
npx @enigmax/linter --strict

By default the CLI exits non-zero only on error-severity findings (URL/CDN imports, hardcoded secrets). --strict also fails on warning-severity Ciphera style findings, which is what a pre-commit or CI gate over changed files wants.

--fix rewrites only the mechanical rules, the ones whose fix cannot change what the program does: trailing whitespace, blank lines (collapsed, with leading/trailing removed), the final newline, the order of a contiguous import group, the semicolon terminating an interface or type-literal member, and the trailing comma in a named import/export list. The judgement-dependent style rules (quotes, statement semicolons, concatenation) and the security audits are reported, never rewritten. Container formats (.ipynb, .astro, .vue, .svelte) are left untouched by --fix.

The two punctuation fixes stand down when the file sits in a project configured with Prettier (a .prettierrc* / prettier.config.* file, or a prettier key in a package.json, anywhere from the file's directory up to the project root - the first directory holding .git, so a stray config in a home directory decides nothing). Prettier strips a single-line type literal's terminator and defaults to trailingComma: "all", so rewriting there would only make the two formatters flip the same lines back and forth. The two rules that report it (require-semicolons over type members, no-import-trailing-comma) go silent there as well, rather than block on a finding the fixer refuses to fix. Every other fix and every other rule keeps running, including require-semicolons over statements.

The bin is enigmax-lint. It exits non-zero when any error-severity violation is found (URL/CDN imports, hardcoded secrets), so it can gate a commit or CI step.

Rules

Style (Ciphera)

Rule What it flags
length-sorted-imports imports not ordered by line length, shortest first
prefer-double-quotes single-quoted strings (where double would work) and no-interpolation template literals (where double would work, i.e. no newline and no double quote in the content)
no-useless-concat string concatenation with + that should be a template literal
require-semicolons statements missing a terminating semicolon - declarations (const/let/var), imports, exports, directives like "use strict", type aliases, and class fields (function/class declarations are exempt, as their body terminates them) - plus every interface or type-literal member, including the last one of a single-line literal ({ url?: string; }) and members a comma separates
no-import-trailing-comma a trailing comma closing a named import or export list (export { a, b, };)
no-url-imports importing from a remote URL / CDN instead of a package name (error)
no-consecutive-blank-lines two or more consecutive blank lines (collapse to one); ignores blanks inside strings/templates and block comments (all languages)
file-hygiene trailing whitespace, missing or extra final newline, leading blank line (all languages)

Audit (security)

Rule What it flags
no-hardcoded-secrets high-signal credential patterns - AWS keys, GitHub/Slack/Google/Stripe tokens, private-key blocks, and secret/token/api_key = "..." assignments (error, all languages)

To keep false positives low, a match is only reported when its random portion looks like a real credential: obvious placeholders (your_api_key_here, changeme, ...) and low-entropy fillers (sk-proj-000000000000, repeated characters) are ignored. Files named *example*, *sample*, *template*, *fixture*, *.test.*, and *.spec.* are exempt from the secret audit entirely.

Programmatic API

import { lintFiles, lintText } from "@enigmax/linter";

const violations = lintFiles(["src"], { categories: ["audit"] });
const inline = lintText("snippet.ts", "const x = 'a'");

Style scope

These rules encode the Ciphera conventions for new code. Per the policy, existing files should match their established style; do not reformat working code just to satisfy the linter.

Related Packages

@nagi-labs/nagi-css

CSS, after the wind. Optional standalone ESLint runner for the Nagi CSS contract...

1,239 0
@ranklint/core

Ranklint engine: crawler, check runner, config loader, diff and report storages....

2,562 2
lsp-pi

LSP extension for pi-coding-agent - provides language server tool and diagnostic...

3,874
ranklint

Lint your SEO before Google does. Alias for @ranklint/cli: the SEO linter for CI...

1,671 2
@nerdstackgrp/nex-wizard

Connect an application (web, server, React Native, Expo or Flutter) to Nex with...

187 3

Version History

Version Released License
0.5.4 Apache-2.0
0.5.3 Apache-2.0
0.5.2 Apache-2.0
0.5.1 Apache-2.0
0.5.0 Apache-2.0