Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hypernym-studio/eslint-config

Hypernym's internal config for ESLint.
https://github.com/hypernym-studio/eslint-config

config configuration eslint eslint-config esm presets shareable

Last synced: 2 days ago
JSON representation

Hypernym's internal config for ESLint.

Awesome Lists containing this project

README

        

Hypernym ESLint Config

Hypernym's internal config for ESLint.


Repository

Package

Releases

Discussions


pnpm add -D @hypernym/eslint-config


## Setup

Add `lint` commands for manual linting (optionally):

```js
// package.json

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

## Usage

### JS

```js
// eslint.config.js

import { jsConfig, ignoresConfig } from '@hypernym/eslint-config'

export default [jsConfig, ignoresConfig]
```

### TS

```js
// eslint.config.js

import { jsConfig, tsConfig, ignoresConfig } from '@hypernym/eslint-config'

export default [jsConfig, tsConfig, ignoresConfig]
```

### Svelte/SvelteKit

> [!NOTE]
>
> Install the required `Svelte` dev dependencies before using:
>
> ```sh
> pnpm add -D eslint-plugin-svelte svelte-eslint-parser
> ```
>
> Also, don't forget to add the `svelte` lang key to the `eslint.validate` vscode setting:
>
> ```js
> // .vscode/settings.json
>
> {
> "eslint.validate": ["javascript", "typescript", "svelte"]
> }
> ```

```js
// eslint.config.js

import { jsConfig, tsConfig, ignoresConfig } from '@hypernym/eslint-config'
import { svelteConfig } from '@hypernym/eslint-config/svelte'

export default [jsConfig, tsConfig, svelteConfig, ignoresConfig]
```

### Vue/Nuxt

> [!NOTE]
>
> Install the required `Vue` dev dependencies before using:
>
> ```sh
> pnpm add -D eslint-plugin-vue
> ```
>
> Also, don't forget to add the `vue` lang key to the `eslint.validate` vscode setting:
>
> ```js
> // .vscode/settings.json
>
> {
> "eslint.validate": ["javascript", "typescript", "vue"]
> }
> ```

```js
// eslint.config.js

import { jsConfig, tsConfig, ignoresConfig } from '@hypernym/eslint-config'
import { vueConfig } from '@hypernym/eslint-config/vue'

export default [jsConfig, tsConfig, vueConfig, ignoresConfig]
```

### React/Next

> [!NOTE]
>
> Install the required `React` dev dependencies before using:
>
> ```sh
> pnpm add -D eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-react-refresh
> ```
>
> Also, don't forget to add the `react` lang keys to the `eslint.validate` vscode setting:
>
> ```js
> // .vscode/settings.json
>
> {
> "eslint.validate": ["javascript", "typescript", "javascriptreact", "typescriptreact"]
> }
> ```

```js
// eslint.config.js

import { ignoresConfig } from '@hypernym/eslint-config'
import { jsxConfig, tsxConfig } from '@hypernym/eslint-config/react'

export default [jsxConfig, tsxConfig, ignoresConfig]
```

### Custom

```js
// eslint.config.js

import { jsConfig, tsConfig, ignores } from '@hypernym/eslint-config'

export default [
jsConfig,
tsConfig,
{
files: tsConfig.files,
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ ignoreRestSiblings: true },
],
},
},
{
ignores: [...ignores, '**/dir/**/*'],
},
]
```

## Community

Feel free to ask questions or share new ideas.

Use the official [discussions](https://github.com/hypernym-studio/eslint-config/discussions) to get involved.

## License

Developed in 🇭🇷 Croatia, © Hypernym Studio.

Released under the [MIT](LICENSE.txt) license.