open-index/open-npm huggingface dataset:
npm package: @karta.io/eslint-config
Description: A Eslint config we use for our projects
Author: Karta Frontend team
Latest version: 1.3.0

# Eslint config

Flat ESLint config for JavaScript, TypeScript, Vue 2, Vue 3, Prettier.
Thanks to [sxzz](https://github.com/sxzz/eslint-config) for example.

## Features

- Format with Prettier.
- Designed to work with TypeScript, Vue 2 and 3 out-of-box.
- Support JSON(5), YAML, Markdown...
- Sort imports, `package.json`, `tsconfig.json`...
- [ESLint Flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new), compose easily!
- Reasonable defaults, best practices, only one-line of config

## Usage

### Install

```bash
npm install @karta.io/eslint-config eslint --save-dev

# or with pnpm:
pnpm add -D @karta.io/eslint-config eslint
```

Require Node.js >= 18.18, and ESLint >= 9.0.0.

And create `eslint.config.mjs` in your project root:

```js
// eslint.config.mjs
import { createConfig } from '@karta.io/eslint-config';

export default createConfig();
```

### Add script for package.json

For example:

```json
{
  "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint . --fix"
  }
}
```

### VS Code support

```jsonc
{
  "eslint.experimental.useFlatConfig": true,
}
```

## Customization

We use [ESLint Flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new). It provides much better organization and composition.

Normally you only need to import the `createConfig` function:

```js
// eslint.config.mjs
import { createConfig } from '@karta.io/eslint-config';

export default createConfig();
```

And that's it! Or you can enable/disable each integration individually, for example:

```js
// eslint.config.mjs
import { createConfig } from '@karta.io/eslint-config';

export default createConfig({
  settings: {
    // Vue is auto-detected, you can also explicitly enable or disable them:
    vue: true,

    // Disable jsonc, yaml and markdown support
    yaml: false,
    markdown: false,

    // Disable prettier support
    prettier: false,

    // Disable jsonc support and sorting keys for package.json and tsconfig.json
    jsonc: false,
    sortKeys: false,
  },
});
```

And also you can override any rule:

```js
// eslint.config.mjs
import { createConfig } from '@karta.io/eslint-config';

export default createConfig({
  // https://eslint.org/docs/latest/use/configure/configuration-files#configuration-objects
  config: [
    {
      files: ['**/*.ts'],
      rules: {
        '@typescript-eslint/no-redeclare': 'off',
      },
    },
    {
      files: ['**/*.vue'],
      rules: {
        'vue/no-dupe-keys': 'error',
      },
    },
  ],
});
```
npm package: @karta.io/prettier-config
Description: A Prettier config we use for our projects
Author: Karta Frontend team
Latest version: 1.0.3

# Prettier config

## Installation

```bash
npm install @karta.io/prettier-config prettier --save-dev

# or with pnpm:
pnpm add -D @karta.io/prettier-config prettier
```

## Set prettier config

```json
// package.json
{
  // ...
  "prettier": "@karta.io/prettier-config"
  // ...
}
```

or <https://prettier.io/docs/en/configuration.html#sharing-configurations>

## Add scripts

```json
// package.json
{
  // ...
  "scripts": {
    // ...
    "prettier": "prettier --check --ignore-unknown \"**/*\"",
    "prettier:fix": "prettier --write --ignore-unknown \"**/*\""
  }
  // ...
}
```