# eslint-config-fritx

> > Highly inspired by [@antfu/eslint-config](https://github.com/antfu/eslint-config)

Latest version **0.2.4** (published 2023-04-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install eslint-config-fritx
pnpm add eslint-config-fritx
yarn add eslint-config-fritx
bun add eslint-config-fritx
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.4 |
| Published | 2023-04-23 |
| First published | 2022-10-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 10.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | fritx |

## Links

- npm: https://www.npmjs.com/package/eslint-config-fritx
- Repository: https://github.com/fritx/eslint-config-fritx
- Issues: https://github.com/fritx/eslint-config-fritx/issues
- npm.io page: https://npm.io/package/eslint-config-fritx

## Dependencies (2)

- [eslint-plugin-es](https://npm.io/package/eslint-plugin-es.md) ^4.1.0
- [eslint-plugin-prefer-let](https://npm.io/package/eslint-plugin-prefer-let.md) ^3.0.1

## Recent versions

- 0.2.4 (latest) — 2023-04-23
- 0.2.3 — 2023-03-14
- 0.2.2 — 2022-11-28
- 0.2.1 — 2022-10-27
- 0.2.0 — 2022-10-27
- 0.1.0 — 2022-10-19
- 0.0.4 — 2022-10-18
- 0.0.3 — 2022-10-18
- 0.0.2 — 2022-10-17
- 0.0.1 — 2022-10-17
- 0.0.0 — 2022-10-16

## README

# eslint-config-fritx

> Highly inspired by [@antfu/eslint-config](https://github.com/antfu/eslint-config)

[![][npm-badge]][npm-url]&nbsp;&nbsp;[![][standard-badge]][standard-url]

[![][standard-logo]](http://standardjs.com)

- ~~Extends [eslint-config-standard][eslint-standard-url]~~
- [Standard][standard-url] like, super light-weight
- Single quotes, no semi
- Auto fix for formatting (aimed to be used standalone without Prettier)
- [Prefer let][prefer-let-url] (const is allowed at the top-level)
- Node / Browser / Wxapp / TypeScript / ESM
- es2022 / es2018 / es5 / etc

[npm-badge]: https://img.shields.io/npm/v/eslint-config-fritx.svg
[npm-url]: https://npmjs.org/package/eslint-config-fritx
[standard-badge]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
[standard-url]: https://standardjs.com
[standard-logo]: https://cdn.rawgit.com/standard/standard/master/badge.svg
[eslint-standard-url]: https://www.npmjs.com/package/eslint-config-standard
[prefer-let-url]: https://www.npmjs.com/package/eslint-plugin-prefer-let

## Usage

### Install

```sh
npm i -g @antfu/ni  # `ni` is recommended

ni -D eslint eslint-config-fritx
```

### Config .eslintrc.cjs

```js
module.exports = {
  extends: ['fritx/node'],
  // or es2017 for better compatibility
  extends: ['fritx/node', 'fritx/es2018'],

  // or for front-end projects
  extends: ['fritx/browser'],

  // or for some really old projects
  extends: ['fritx/browser', 'fritx/es5-loose'],

  // if you want to lint third-party libraries with es5
  overrides: [
    {
      files: 'vendor/**/*.js',
      extends: ['plugin:es/restrict-to-es5'],
    },
    // ...

  // typescript
  // execute `ni -D typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin`
  extends: ['fritx/typescript'],
  // wechat miniprogram
  extends: ['fritx/wxapp'],
  // both
  extends: ['fritx/wxapp', 'fritx/typescript'],

  // if you want more standard rules on besides
  // execute `ni -D eslint-config-standard eslint-plugin-import eslint-plugin-n eslint-plugin-promise`
  extends: ['fritx/standard-full'],
}
```

### Add scripts for package.json

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

### Config VS Code auto fix

```js
// .vscode/settings.json
{
  "prettier.enable": false,
  "editor.formatOnSave": false,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  }
}
```

## If you are using ESM (ES Modules)

```js
// package.json
{
  "type": "module",
  // ...
}
```

```js
// .eslintrc.cjs
module.exports = {
  extends: ['fritx/node', 'fritx/es2022', 'fritx/esm'],
  // or
  extends: ['fritx/browser', 'fritx/es2022', 'fritx/esm'],
  // ...
}
```

```js
// .vscode/settings.json
{
  // Intellisense vs JavaScript Modules - lack of ".js" in completion #126171
  // https://github.com/microsoft/vscode/issues/126171
  "javascript.preferences.importModuleSpecifierEnding": "js",
  // ...
}
```

## Extended Reading

Learn more about the context - [Why I don't use Prettier](https://antfu.me/posts/why-not-prettier).

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