3.6.1 • Published 7 months ago

@hypernym/eslint-config v3.6.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Usage

Linting Commands

Add lint commands for manual linting (optional):

// package.json

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

JavaScript Config

// eslint.config.js

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

export default defineConfig([jsConfig, ignoresConfig])

TypeScript Config

// eslint.config.js

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

export default defineConfig([jsConfig, tsConfig, ignoresConfig])

Svelte/SvelteKit Config

!NOTE

Install the required Svelte dependencies before using:

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:

// .vscode/settings.json

{
  "eslint.validate": ["javascript", "typescript", "svelte"]
}
// eslint.config.js

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

export default defineConfig([jsConfig, tsConfig, svelteConfig, ignoresConfig])

Vue/Nuxt Config

!NOTE

Install the required Vue dependencies before using:

pnpm add -D eslint-plugin-vue vue-eslint-parser

Also, don't forget to add the vue lang key to the eslint.validate vscode setting:

// .vscode/settings.json

{
  "eslint.validate": ["javascript", "typescript", "vue"]
}
// eslint.config.js

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

export default defineConfig([jsConfig, tsConfig, vueConfig, ignoresConfig])

React/Next Config

!NOTE

Install the required React dependencies before using:

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:

// .vscode/settings.json

{
  "eslint.validate": ["javascript", "typescript", "javascriptreact", "typescriptreact"]
}
// eslint.config.js

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

export default defineConfig([jsxConfig, tsxConfig, ignoresConfig])

Custom Setup

// eslint.config.js

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

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

For more info on how to ignore files, see the official docs.

Community

Feel free to ask questions or share new ideas.

Use the official discussions to get involved.

License

Developed in 🇭🇷 Croatia, © Hypernym Studio.

Released under the MIT license.

3.5.7

10 months ago

3.5.6

10 months ago

3.5.5

10 months ago

3.5.4

12 months ago

3.5.9

9 months ago

3.5.8

10 months ago

3.5.3

1 year ago

3.6.1

7 months ago

3.5.2

1 year ago

3.6.0

8 months ago

3.5.1

1 year ago

3.4.0

1 year ago

3.3.1

1 year ago

3.3.0

1 year ago

3.2.0

1 year ago

3.1.0

1 year ago

3.3.3

1 year ago

3.5.0

1 year ago

3.3.2

1 year ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago