# ko-lint-config

> lint configs about eslint stylelint and prettier

Latest version **2.2.22** (published 2026-02-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install ko-lint-config
pnpm add ko-lint-config
yarn add ko-lint-config
bun add ko-lint-config
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 2.2.22 |
| Published | 2026-02-27 |
| First published | 2022-06-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14 |
| Dependencies | 24 |
| Unpacked size | 28.7 KB |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 31 |
| Author | DTStack |
| Maintainers | xbrave, liuxy0551 |
| Keywords | code style, eslint, eslint config, prettier, stylelint, lint |

## Links

- npm: https://www.npmjs.com/package/ko-lint-config
- Repository: https://github.com/DTStack/ko
- Issues: https://github.com/DTStack/ko/issues
- npm.io page: https://npm.io/package/ko-lint-config

## Dependencies (24)

- [eslint](https://npm.io/package/eslint.md) 8.22.0
- [postcss](https://npm.io/package/postcss.md) 8.4.14
- [prettier](https://npm.io/package/prettier.md) 2.7.1
- [stylelint](https://npm.io/package/stylelint.md) 14.11.0
- [postcss-less](https://npm.io/package/postcss-less.md) 6.0.0
- [postcss-scss](https://npm.io/package/postcss-scss.md) 4.0.4
- [stylelint-scss](https://npm.io/package/stylelint-scss.md) 4.3.0
- [eslint-plugin-n](https://npm.io/package/eslint-plugin-n.md) 15.2.3
- [stylelint-order](https://npm.io/package/stylelint-order.md) 5.0.0
- [eslint-plugin-jest](https://npm.io/package/eslint-plugin-jest.md) 26.5.3
- [eslint-plugin-react](https://npm.io/package/eslint-plugin-react.md) 7.30.1
- [eslint-plugin-import](https://npm.io/package/eslint-plugin-import.md) 2.26.0
- [eslint-plugin-promise](https://npm.io/package/eslint-plugin-promise.md) 6.0.0
- [eslint-config-prettier](https://npm.io/package/eslint-config-prettier.md) 8.5.0
- [eslint-config-standard](https://npm.io/package/eslint-config-standard.md) 17.0.0
- [eslint-plugin-dt-react](https://npm.io/package/eslint-plugin-dt-react.md) 0.0.6
- [eslint-plugin-jsx-a11y](https://npm.io/package/eslint-plugin-jsx-a11y.md) 6.6.0
- [eslint-plugin-prettier](https://npm.io/package/eslint-plugin-prettier.md) 4.2.1
- [@typescript-eslint/parser](https://npm.io/package/@typescript-eslint/parser.md) 5.30.0
- [eslint-plugin-react-hooks](https://npm.io/package/eslint-plugin-react-hooks.md) 4.6.0
- [stylelint-config-standard](https://npm.io/package/stylelint-config-standard.md) 25.0.0
- [eslint-plugin-sort-requires](https://npm.io/package/eslint-plugin-sort-requires.md) 2.1.0
- [@typescript-eslint/eslint-plugin](https://npm.io/package/@typescript-eslint/eslint-plugin.md) 5.30.0
- [eslint-plugin-simple-import-sort](https://npm.io/package/eslint-plugin-simple-import-sort.md) ^10.0.0

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 2.2.22 (latest) — 2026-02-27
- 2.2.21 — 2023-07-20
- 2.2.20 — 2023-05-18
- 2.2.19 — 2023-03-06
- 2.2.18 — 2023-02-06
- 2.2.17 — 2023-02-06
- 2.2.16 — 2022-12-13
- 2.2.15 — 2022-10-08
- 2.2.13 — 2022-08-30
- 2.2.12 — 2022-08-26
- 2.2.11 — 2022-08-25
- 2.2.10 — 2022-08-25
- 2.2.9 — 2022-08-25
- 2.2.8 — 2022-08-25
- 2.2.7 — 2022-08-24
- … 20 more at https://npm.io/package/ko-lint-config/versions

## README

# [ko-lint-config] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url]

[npm-image]: https://img.shields.io/npm/v/ko-lint-config.svg
[npm-url]: https://npmjs.org/package/ko-lint-config
[downloads-image]: https://img.shields.io/npm/dm/ko-lint-config.svg
[downloads-url]: https://npmjs.org/package/ko-lint-config

<p align="center">
  English | <a href="./README_CN.md">简体中文 (Simplified Chinese)</a>
</p>

This module saves time in three ways for you:

- **No configuration** - The easier way to enforce code quality in your
  project. No configuration rules. It just works.
- **Automatically format code** - Just run `pnpm lint-fix` and say goodbye to
  messy or inconsistent code.
- **Catch style issues & programmer errors early** - Reduce manual review in the code review process, and leave simple things to tools to save time.

No hesitation. No more maintenance `.eslintrc`. Give it a try right now!

## Detailed rules
- **four spaces are required** – indent
- **single quotation marks are required for string** – except where escape is need
- **require keyword followed by space** - ` if (condition) {...}`
- **requires no spaces after the function name** - ` function name (arg) {...}` except anonymous functions and async ` function (arg) {...} `` async () { ... }`
- **semicolons are not mandatory**
- **not mandatory = = =** - the field type returned by the backend cannot be guaranteed
- **do not force ternary operators to wrap**
- **allow but do not require trailing commas** - when the last element or attribute is on a different line from the end or attribute
- **function content is allowed to be empty**
- **allow this alias** - alias optional `self` `_this` `that', cannot be deconstructed from this
- **no debugger required**
- **no console is recommended**

## Install

``` bash
pnpm add ko-lint-config -D
```

## Usage

&emsp;&emsp;How to get Code Style Guide: <a href="https://dtstack.yuque.com/rd-center/sm6war/eeyxxe" target="_black">如何引入 Code Style Guide</a>

1、Then, add this to your `.eslintrc.js`、`.prettierrc.js`、`.stylelintrc.js` file:

``` js
module.exports = {
  extends: [require.resolve('ko-lint-config')],
}
```
``` js
const prettier = require('ko-lint-config/.prettierrc')

module.exports = {
  ...prettier,
}
```
``` js
module.exports = {
  extends: [require.resolve('ko-lint-config/.stylelintrc')],
}
```

You should not override settings. Because this is a Code Style Guide for group.

2、Add script to `package.json`:

``` json
"scripts": {
  "lint": "npx eslint './src/**/*.ts' './src/**/*.tsx'",
  "lint-fix": "npx eslint './src/**/*.ts' './src/**/*.tsx' --fix",
  "lint-css": "npx stylelint './src/**/*.scss' './src/**/*.css'",
  "lint-css-fix": "npx stylelint './src/**/*.scss' './src/**/*.css' --fix"
},
```

You can use `pnpm lint-fix` to correct most code style problems.

## How do I disable a eslint rule?

In rare cases, you'll need to break a rule and hide the error generated by `Code Style Guide`.

`ko-lint-config` uses [ESLint](http://eslint.org/) under-the-hood and
you can hide errors as you normally would if you used ESLint directly. stylelint is same to eslint.

Disable **all rules** on a specific line:

```js
file = 'I know what I am doing' // eslint-disable-line
```

Or, disable **only** the `"no-use-before-define"` rule:

```js
file = 'I know what I am doing' // eslint-disable-line no-use-before-define
```

Or, disable the `"no-use-before-define"` rule for **multiple lines**:

```js
/* eslint-disable no-use-before-define */
console.log('offending code goes here...')
console.log('offending code goes here...')
console.log('offending code goes here...')
/* eslint-enable no-use-before-define */
```

### Looking for something easier than this?

You can add to your `pnpm lint` script and install eslint plugin for vscode.


## Learn more

[Code-Style-Guide](https://github.com/DTStack/Code-Style-Guide)

## License

MIT. Copyright (c) 2022 dt-insight

---
_Source: https://npm.io/package/ko-lint-config · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
