eslint-config
Skill2 starsChanged 4 months agoMITView on GitHub
ESLint configuration expert for flat config setup, custom rules, TypeScript integration, plugin management, and migration from legacy .eslintrc to modern eslint.config.js. Use when the task involves `ESLint`, `eslint.config`, `linting JavaScript`, `TypeScript linting`, or `ESLint rules`.
- Installs packages
In this repository43 other files it gives its agents.
- accessibilitySkill
- best-practicesSkill
- brainstormingSkill
- core-web-vitalsSkill
- cypress-e2eSkill
- docker-expertSkill
- drizzle-ormSkill
- elixir-developmentSkill
- express-apiSkill
- frontend-designSkill
- github-actionsSkill
- go-developmentSkill
- grafana-dashboardsSkill
- grpc-apiSkill
- helm-chartsSkill
- jest-testingSkill
- kubernetes-orchestrationSkill
- makefileSkill
- markdown-a11ySkill
- nothing-designSkill
- performanceSkill
- php-developmentSkill
- pinned-tagSkill
- postgresql-developmentSkill
- pr-creatorSkill
- prettier-formattingSkill
- pydanticSkill
- qwik-developmentSkill
- rails-developmentSkill
- ruby-developmentSkill
- rust-async-patternsSkill
- seoSkill
- skill-creatorSkill
- solidjs-developmentSkill
- sqlalchemySkill
- sql-optimization-patternsSkill
- swift-ios-developmentSkill
- tensorflow-mlSkill
- testing-librarySkill
- trpc-type-safetySkill
- webapp-testingSkill
- web-quality-auditSkill
- zig-developmentSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 0 are distinctive, and 14 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 24
Flat Config Only: Always use eslint.config.js (or .mjs/.mts).
- Very specific: line 28
TypeScript Requires Parser: Always pair @typescript-eslint/parser with @typescript-eslint/eslint-plugin.
- Very specific: line 31
Severity Consistency: Use "error" for rules that must block CI, "warn" for progressive adoption, and "off" to explicitly disable inherited …
- Very specific: line 33
Ignore via Config: Use the ignores property in flat config instead of .eslintignore files.
- Very specific: line 37
Performance: Use --cache in CI and locally.
- Very specific: line 212
Use typescript-eslint.config() helper — it provides type-safe config composition.
- Very specific: line 213
Place Prettier config (eslint-config-prettier) as the last entry to disable conflicting format rules.
- Very specific: line 216
Use --cache in every environment — it reduces re-lint time by 60-80%.
- Very specific: line 221
Don't mix .eslintrc.* files with eslint.config.js — flat config ignores legacy files completely.
- Very specific: line 223
Don't use eslint-plugin-prettier (runs Prettier inside ESLint) — it's slow.
- Very specific: line 225
Don't set "no-unused-vars": "error" when using TypeScript — use @typescript-eslint/no-unused-vars instead to avoid false positives.
- Very specific: line 227
Don't apply type-checked rules to plain .js files — they require a tsconfig.json and will error without one.
- Very specific: line 229
Don't suppress rules with // eslint-disable without a justification comment explaining *why*.
- Very specific: line 230
Don't create .eslintignore with flat config — use the ignores property in the config array.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
When to Use
- Setting up ESLint from scratch using the modern flat config format (
eslint.config.js). - Migrating a project from legacy
.eslintrc.*to flat config. - Configuring TypeScript-ESLint for strict type-checked linting.
- Writing custom ESLint rules or shareable config packages.
- Resolving rule conflicts between ESLint, Prettier, and framework-specific plugins.
- Optimizing linting performance for large monorepos.
Critical Patterns
- Flat Config Only: Always use
eslint.config.js(or.mjs/.mts). The legacy.eslintrc.*format is deprecated since ESLint v9. Do NOT create new projects with.eslintrc. - Explicit Over Implicit: Flat config has no implicit inheritance. Every config object in the array is applied in order — later entries override earlier ones.
- TypeScript Requires Parser: Always pair
@typescript-eslint/parserwith@typescript-eslint/eslint-plugin. Use type-checked rules (strictTypeChecked) for maximum safety. - Severity Consistency: Use
"error"for rules that must block CI,"warn"for progressive adoption, and"off"to explicitly disable inherited rules. Never leave rules ambiguous. - Ignore via Config: Use the
ignoresproperty in flat config instead of.eslintignorefiles. Global ignores go in a config object with only theignoreskey. - Plugin Namespacing: In flat config, plugins are objects, not strings. Import the plugin and assign it to a namespace key to avoid collisions.
- Performance: Use
--cachein CI and locally. For monorepos, scope linting to changed files with--no-error-on-unmatched-pattern.
Code Examples
Modern Flat Config (eslint.config.js)
import js from "@eslint/js";
import tseslint from "typescript-eslint";
import prettier from "eslint-config-prettier";
export default tseslint.config(
// Global ignores — standalone object with ONLY ignores key
{
ignores: ["dist/", "node_modules/", "coverage/", "**/*.generated.*"],
},
// Base JS recommended rules
js.configs.recommended,
// TypeScript strict + type-checked rules
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
// TypeScript parser options — applies to all TS files
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
// Disable type-checked rules for JS files (config files, scripts)
{
files: ["**/*.js", "**/*.mjs"],
...tseslint.configs.disableTypeChecked,
},
// Project-specific overrides
{
files: ["src/**/*.ts"],
rules: {
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/strict-boolean-expressions": "warn",
},
},
// Test file relaxations
{
files: ["**/*.test.ts", "**/*.spec.ts"],
rules: {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
},
},
// Prettier must be LAST to override formatting rules
prettier,
);Custom ESLint Rule
// eslint-rules/no-console-in-services.js
/** @type {import("eslint").Rule.RuleModule} */
export default {
meta: {
type: "suggestion",
docs: {
description: "Disallow console.* in service files, use a logger instead",
},
fixable: null,
schema: [],
messages: {
noConsole: "Use the injected logger instead of console.{{ method }}().",
},
},
create(context) {
return {
MemberExpression(node) {
if (
node.object.type === "Identifier" &&
node.object.name === "console" &&
node.property.type === "Identifier"
) {
context.report({
node,
messageId: "noConsole",
data: { method: node.property.name },
});
}
},
};
},
};Registering a Custom Rule in Flat Config
import noConsoleInServices from "./eslint-rules/no-console-in-services.js";
export default [
{
files: ["src/services/**/*.ts"],
plugins: {
custom: { rules: { "no-console-in-services": noConsoleInServices } },
},
rules: {
"custom/no-console-in-services": "error",
},
},
];Migration from Legacy .eslintrc to Flat Config
# Use the official migration tool
npx @eslint/migrate-config .eslintrc.json
# Install the compatibility utility for plugins that lack flat config support
npm install -D @eslint/compat// Using @eslint/compat for legacy plugins
import { fixupPluginRules } from "@eslint/compat";
import legacyPlugin from "eslint-plugin-legacy";
export default [
{
plugins: {
legacy: fixupPluginRules(legacyPlugin),
},
rules: {
"legacy/some-rule": "error",
},
},
];Commands
# Lint with caching (recommended for CI and local)
npx eslint --cache --cache-location node_modules/.cache/eslint/ .
# Auto-fix safe fixes
npx eslint --fix .
# Lint only staged files (use with lint-staged)
npx eslint --no-error-on-unmatched-pattern
# Debug config resolution for a specific file
npx eslint --print-config src/index.ts
# Inspect which rules are active
npx eslint --inspect-configBest Practices
DO
- Use
typescript-eslint.config()helper — it provides type-safe config composition. - Place Prettier config (
eslint-config-prettier) as the last entry to disable conflicting format rules. - Enable
projectService: trueinstead of manually listingtsconfig.jsonpaths. - Use
--cachein every environment — it reduces re-lint time by 60-80%. - Pin plugin versions in
package.jsonto avoid surprise rule changes.
DON'T
- Don't mix
.eslintrc.*files witheslint.config.js— flat config ignores legacy files completely. - Don't use
eslint-plugin-prettier(runs Prettier inside ESLint) — it's slow. Run Prettier separately. - Don't set
"no-unused-vars": "error"when using TypeScript — use@typescript-eslint/no-unused-varsinstead to avoid false positives. - Don't apply type-checked rules to plain
.jsfiles — they require atsconfig.jsonand will error without one. - Don't suppress rules with
// eslint-disablewithout a justification comment explaining why. - Don't create
.eslintignorewith flat config — use theignoresproperty in the config array.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

