# @wayofdev/eslint-config

> A shareable eslint configuration for projects.

Latest version **1.1.0** (published 2022-12-20) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @wayofdev/eslint-config
pnpm add @wayofdev/eslint-config
yarn add @wayofdev/eslint-config
bun add @wayofdev/eslint-config
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2022-12-20 |
| First published | 2022-12-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 14 |
| Unpacked size | 10.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | lotyp7@gmail.com |
| Maintainers | lotyp |
| Keywords | eslint, eslint-config |

## Links

- npm: https://www.npmjs.com/package/@wayofdev/eslint-config
- Repository: https://github.com/wayofdev/npm-shareable-configs
- Homepage: https://github.com/wayofdev/npm-shareable-configs/tree/master/packages/eslint-config#readme
- Issues: https://github.com/wayofdev/npm-shareable-configs/issues
- npm.io page: https://npm.io/package/@wayofdev/eslint-config

## Dependencies (14)

- [eslint-plugin-jest](https://npm.io/package/eslint-plugin-jest.md) ^27.0.4
- [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.1
- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) ^0.16.0
- [eslint-plugin-unicorn](https://npm.io/package/eslint-plugin-unicorn.md) ^44.0.0
- [eslint-config-prettier](https://npm.io/package/eslint-config-prettier.md) ^8.5.0
- [eslint-plugin-jest-dom](https://npm.io/package/eslint-plugin-jest-dom.md) ^4.0.2
- [eslint-plugin-prettier](https://npm.io/package/eslint-plugin-prettier.md) ^4.2.1
- [eslint-plugin-security](https://npm.io/package/eslint-plugin-security.md) ^1.5.0
- [@typescript-eslint/parser](https://npm.io/package/@typescript-eslint/parser.md) ^5.38.1
- [eslint-config-airbnb-base](https://npm.io/package/eslint-config-airbnb-base.md) ^15.0.0
- [eslint-plugin-jest-formatting](https://npm.io/package/eslint-plugin-jest-formatting.md) ^3.1.0
- [eslint-config-airbnb-typescript](https://npm.io/package/eslint-config-airbnb-typescript.md) ^17.0.0
- [@typescript-eslint/eslint-plugin](https://npm.io/package/@typescript-eslint/eslint-plugin.md) ^5.38.1

## 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

- 1.1.0 (latest) — 2022-12-20
- 1.0.3 — 2022-12-20
- 1.0.1 — 2022-12-15
- 1.0.0 — 2022-12-13

## README

# Eslint Config

Shareable eslint configuration.

## Install

```bash
# install with yarn
$ yarn add -D @wayofdev/eslint-config

# install with pnpm
$ pnpm add -Dw @wayofdev/eslint-config
```

## Usage

**`.eslintrc.js`**

### JS

```js
module.exports = {
    extends: '@wayofdev/eslint-config',
};
```

### TS

```js
module.exports = {
    extends: '@wayofdev/eslint-config/ts',
};
```

### Jest

```js
module.exports = {
    extends: '@wayofdev/eslint-config/jest',
};
```

## Extending

An example configuring a mixed JS/TS, `tsconfig`-compatible configuration.

**`.eslintrc.js`**

```js
module.exports = {
    // ignore linting in dist bundle output folder
    ignorePatterns: ['dist/**'],
    // enable global variables
    env: {
        browser: true,
        node: true,
        jest: true,
    },
    overrides: [
        {
            files: ['**/*.ts'],
            extends: [
                '@wayofdev/eslint-config/ts',
                // add jest linting
                '@wayofdev/eslint-config/jest',
            ],
            parserOptions: {
                project: 'tsconfig.json',
                tsconfigRootDir: __dirname,
            },
        },
        {
            files: ['**/*.js'],
            extends: [
                '@wayofdev/eslint-config',
                // add jest linting
                '@wayofdev/eslint-config/jest',
            ],
        },
    ],
};
```

## Add an NPM Script

Running this command:

```bash
# using yarn, npm
$ npm pkg set scripts.lint:js="eslint --fix **/*.{js,jsx,ts,tsx}"

# using pnpm
$ pnpm pkg set scripts.lint:js="eslint --fix **/*.{js,jsx,ts,tsx}"
```

Will create:

**`package.json`**

```bash
...
"scripts": {
    ...
    "lint:js": "eslint --fix **/*.{js,jsx,ts,tsx}"
    ...
},
...
```

## Add a Pre-commit Hook

**`lint-staged.config.js`**

```js
module.exports = {
    '*.{js,jsx,ts,tsx}': ['prettier --cache --write', 'eslint --cache --fix'],
};
```

## Under The Hood

### `index.js`

- Plugins
    - `eslint-plugin-prettier`
- Parser
    - default `eslint` parser
- Extends
    - `eslint-plugin-unicorn`
    - `eslint-plugin-promise`
    - `eslint-plugin-sonarjs`
    - `eslint-plugin-security`,
    - default `eslint` ruleset
    - `eslint-config-airbnb-base`
    - `eslint-config-prettier`
- Rules
    - [Prettier Special Rules](https://github.com/prettier/eslint-config-prettier#special-rules)
    - Other rules can be found in the config

### `ts.js`

- Plugins
    - `@typescript-eslint/eslint-plugin`
    - `eslint-plugin-prettier`
- Parser
    - `@typescript-eslint/parser`
- Extends
    - `eslint-plugin-unicorn`
    - `eslint-plugin-promise`
    - `eslint-plugin-sonarjs`
    - `eslint-plugin-security`,
    - `@typescript-eslint/eslint-plugin`
    - `eslint-config-airbnb-typescript`
    - `eslint-config-prettier`
- Rules
    - [Prettier Special Rules](https://github.com/prettier/eslint-config-prettier#special-rules)
    - Other rules can be found in the config

### `jest.js`

- Plugins
    - `jest`
    - `jest-dom`
    - `jest-formatting`
- Extends
    - `plugin:jest/recommended`
    - `plugin:jest-dom/recommended`
    - `plugin:jest-formatting/recommended`

## License

MIT

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