@git-validator/eslint-config v0.4.15
@git-validator/eslint-config
A strict eslint config for better code quality. Based on standard.js without any stylistic opinions.
Feature
- Lint
js
/mjs
/cjs
/jsx
/ts
/mts
/cts
/tsx
/package.json
files only. - Based on standard.js.
- Have no stylistic opinions. Prettier friendly.
- ESLint Flat config, compose easily!
- Strict, but progressive.
- One-line of config.
- Modern. ESM first.
- Respect
.gitignore
. - React friendly.
- NestJS friendly.
- Type safe.
Usage
Install
pnpm add -D eslint @git-validator/eslint-config
Config eslint.config.js
(for ESM)
import config from "@git-validator/eslint-config";
export default config;
If you are in CommonJS, config eslint.config.js
bellow
module.exports = import("@git-validator/eslint-config");
Config package.json
{
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
}
}
Note: TypeScript project is required a
tsconfig.eslint.json
ortsconfig.json
ortsconfig.build.json
file in the root of the project. Otherwise, ts files will be ignored and only js files will be linted.
Progressive Usage
The default config is too strict for some projects. You can use pick
or omit
function in eslint.config.js
to enable the rules step by step, progressively.
// @ts-check
import { pick } from "@git-validator/eslint-config";
// Enable the rules that you configured. The other builtin rules will not work.
export default pick([
"unicorn/error-message",
"@typescript-eslint/no-floating-promises",
// Other rules key. You will get auto suggestions in VSCode here.
]);
// @ts-check
import { omit } from "@git-validator/eslint-config";
// Ignore the rules that you configure. The other builtin rules will work.
export default omit([
"unicorn/error-message",
"@typescript-eslint/no-floating-promises",
// Other rules key. You will get auto suggestions in VSCode here.
]);
Tips: After enabling ts check by adding
// @ts-check
at the top, you will get auto suggestions when you are usingpick
andomit
.
License
MIT
1 day ago
1 day ago
12 days ago
17 days ago
22 days ago
30 days ago
1 month ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
5 months ago
6 months ago
6 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago