Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

⚙️ ESLint configuration presets for TypeScript and TypeScript + React projects.

License

NotificationsYou must be signed in to change notification settings

darkobits/eslint-config

Repository files navigation

ESLint configuration presets for TypeScript and TypeScript + React projects.

Requirements

Install

npm install --save-dev @darkobits/eslint-config

Use

This package provides two presets:presetTs for TypeScriptprojects andpresetTsx for TypeScript projects that useJSX and React.

In your project'seslint.config.js file, import the desired preset and re-export it as the defaultexport:

export{presetTsasdefault}from'@darkobits/eslint-config'

or

export{presetTsxasdefault}from'@darkobits/eslint-config'

If you need to define any additional configuration specific to your project, use the spread operator toadd the preset to a new array:

import{airBnb}from'@airbnb/eslint-config-airbnb-is-still-a-thing-right'import{presetTs}from'@darkobits/eslint-config'exportdefault[// Exempt this directory from linting. Do this early to prevent ESLint from// processing these files any further.{ignores:['rainbows/**']},// Then, apply one or more configuration presets.  ...airBnb,  ...presetTs,// If we then wanted to disable a rule used by any of the above:{rules:{'unicorn/catch-error-name':'off'}}]

Tip

Order matters here! Configuration for files that you want to have globally ignored occur first,followed by one or more configuration presets, then overrides.

For more on this topic, refer to the ESLintdocumentation.

Type Safety

For added type safety, use thedefineFlatConfig helper:

import{defineFlatConfig,presetTs}from'@darkobits/eslint-config'exportdefaultdefineFlatConfig([{ignores:['rainbows/**']},  ...presetTs,{rules:{'unicorn/catch-error-name':'off'}}])

Configuration Inspector

You can use ESLint's newConfiguration Inspector tosee an exhaustive list of all rules (and their settings) applied in your project by running thefollowing:

npx eslint --inspect-config

Example:


About

⚙️ ESLint configuration presets for TypeScript and TypeScript + React projects.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp