ESLint Plugins
@studnicky/eslint-config ships two custom ESLint plugins:
@studnicky— 22 structural and semantic rules that enforce the substrate codebase doctrine.@studnicky/v8— 24 V8 performance rules that flag patterns preventing V8 from using optimized code paths.
Register both plugins in your flat config to enable the rules.
Install
Add the GitHub Packages registry to .npmrc:
@studnicky:registry=https://npm.pkg.github.comThen install the package:
sh
pnpm add -D @studnicky/eslint-configInstall peer dependencies:
sh
pnpm add -D eslint@>=10 typescript-eslint@>=8 @typescript-eslint/eslint-plugin@>=8 @typescript-eslint/parser@>=8 @stylistic/eslint-plugin@>=5 eslint-plugin-import-x@>=4 eslint-plugin-perfectionist@>=5 eslint-plugin-regexp@>=3 eslint-plugin-unused-imports@>=4 typescript@>=6Subpath exports
| Subpath | Exports |
|---|---|
@studnicky/eslint-config | plugin, v8Plugin, and all individual rule modules |
@studnicky/eslint-config/plugin | plugin (the @studnicky ESLint plugin object) |
@studnicky/eslint-config/v8 | v8Plugin (the @studnicky/v8 ESLint plugin object) |
Usage
Import plugin and v8Plugin and register them in a flat-config entry:
js
// eslint.config.mjs
import { plugin, v8Plugin } from '@studnicky/eslint-config';
export default [
{
plugins: { '@studnicky': plugin, '@studnicky/v8': v8Plugin },
rules: {
'@studnicky/type-alias-invariants': 'error',
'@studnicky/v8/array-spread-outside-loops': 'error'
}
}
];Combine with additional rules in the same entry:
js
// eslint.config.mjs
import { plugin, v8Plugin } from '@studnicky/eslint-config';
export default [
{
plugins: { '@studnicky': plugin, '@studnicky/v8': v8Plugin },
rules: {
'@studnicky/type-alias-invariants': 'error',
'@studnicky/v8/array-spread-outside-loops': 'error',
'no-console': 'warn'
}
}
];Using the plugins directly
Import the raw plugin objects for hand-rolled flat config:
ts
// eslint.config.ts
import { plugin, v8Plugin } from '@studnicky/eslint-config';
export default [
{
plugins: {
'@studnicky': plugin,
'@studnicky/v8': v8Plugin
},
rules: {
'@studnicky/single-export': 'error',
'@studnicky/v8/delete-property': 'error'
}
}
];Or import from the dedicated subpath exports:
ts
import { plugin } from '@studnicky/eslint-config/plugin';
import { v8Plugin } from '@studnicky/eslint-config/v8';Configuration rules
22 rules that enforce structural, semantic, and stylistic constraints.
| Rule | Fixable | Severity |
|---|---|---|
@studnicky/adapter-only-import | No | error |
@studnicky/all-types-are-entities | No | error |
@studnicky/canonical-export-names | No | error |
@studnicky/clean-diagnostics | Yes | error |
@studnicky/descriptive-identifiers | No | error |
@studnicky/direct-invocation-only | No | error |
@studnicky/domain-purity | No | error |
@studnicky/folder-content-shape | No | error |
@studnicky/hash-private-fields | No | error |
@studnicky/inline-trivial-logic | Yes | error |
@studnicky/interface-must-be-contract | Yes | error |
@studnicky/interface-suffix | No | error |
@studnicky/interfaces-compose-named-types | No | error |
@studnicky/known-types-outside-adapters | No | error |
@studnicky/layer-import-boundary | No | error |
@studnicky/lexical-this-only | No | error |
@studnicky/prefer-collection-types | No | warn |
@studnicky/require-options-object | No | error |
@studnicky/single-export | No | error |
@studnicky/static-method-verbs | No | error |
@studnicky/type-alias-invariants | Partial | error |
@studnicky/whole-canonical-types | No | error |
V8 performance rules
24 rules that flag patterns preventing V8 from using optimized code paths.