@mephisto5558/eslint-config
v5.3.0
Published
ESLint configuration
Readme
ESLint-Config
This is a full opinionated eslint config using multiple plugins supporting Typescript, JavaScript, Markdown, CSS, HTML, JSON and JSON5.
Features
- Comprehensive ruleset: Pre-configured for modern Web and Node.js development.
- Reusable TSConfigs: Includes optimized TypeScript configurations for Node and Browser environments.
- Global Type Enhancements: Automatically integrates
@mephisto5558/better-typesfor improved global types.
How to use
1. Installation
Install
npm install --save-dev @mephisto5558/eslint-configAdd this script (or any other script calling
eslint) to yourpackage.json:"lint": "eslint . --cache --cache-location ./node_modules/.cache/eslint/",
2. Use in eslint.config.ts / js / cjs / mjs
import config, { tsGlob, jsGlob } from '@mephisto5558/eslint-config';
export default [
...config,
{
name: 'your-project-overrides',
files: [`*${tsGlob}`, `*${jsGlob}`],
rules: {
...
}
}
] as typeof config;See one of my other project's ESLint config for a more complex example using getModifiedRule: Teufelsbot.
3. Reusable TSConfigs (Optional)
You can extend your tsconfig.json from this package to get secure defaults:
For Node.js projects:
{
"extends": "@mephisto5558/eslint-config/tsconfigs/node/tsconfig.check.json"
}For Browser projects:
{
"extends": "@mephisto5558/eslint-config/tsconfigs/browser/tsconfig.check.json"
}Use the tsconfig.build.json variants for your build pipeline.
4. Run
Run normally:
npm run lintRun with autofix enabled:
npm run lint -- --fixRule Severity
The rules are divided into three severity levels: error, warn, and off.
error: Rules that indicate potential runtime errors, syntax errors, or unsafe behavior. These should always be fixed. Examples:
@typescript-eslint/no-array-delete: Disallows usingdeleteon array elements, which creates sparse arrays and is often not the intended behavior.regexp/no-invalid-regexp: Reports invalid regular expressions inRegExpconstructors.eslint/no-const-assign: Disallows reassigning constants.
warn: Rules that point to style issues, best practices, or potential typos, but do not cause runtime errors. These should generally be fixed to improve code quality. Examples:
@stylistic/quotes: Enforces the use of single (') quotes.unicorn/no-for-loop: Suggests usingfor...ofinstead of C-styleforloops.jsdoc/check-syntax: Ensures that the JSDoc syntax is valid.
off: Rules that are disabled. The reasons for this are:
- Covered by other rules: The functionality is already handled by another, often more specific, rule.
Example:
eslint/no-dupe-class-membersis disabled because@typescript-eslint/no-dupe-class-membershandles this better for TypeScript code.
- Not (sufficiently) configurable: The rule does not fit the desired coding style and cannot be adjusted accordingly.
Example:
@stylistic/object-property-newlineis too restrictive in formatting objects.
- Personal preference: The rule deliberately contradicts the coding style of my projects.
Example:
unicorn/no-array-reduceis disabled because I preferArray.prototype.reduce.
- Covered by other rules: The functionality is already handled by another, often more specific, rule.
Example:

