All Projects → rfgamaral → eslint-config-typescript-unified

rfgamaral / eslint-config-typescript-unified

Licence: MIT license
🛠️ A unified ESLint configuration with sensible defaults for TypeScript projects.

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to eslint-config-typescript-unified

eslint-config-welly
😎 ⚙️ ESLint configuration for React projects that I do. Feel free to use this!
Stars: ✭ 21 (+40%)
Mutual labels:  prettier, airbnb, eslint-config
eslint-config-ns
ESLint config ready to be used in multiple projects. Based on Airbnb's code style with prettier, jest and react support.
Stars: ✭ 27 (+80%)
Mutual labels:  prettier, eslint-config, react-hooks
react-remark
React component and hook to use remark to render markdown
Stars: ✭ 81 (+440%)
Mutual labels:  unified, react-hooks
eslint-config-with-prettier
Eslint config with prettier
Stars: ✭ 39 (+160%)
Mutual labels:  airbnb, eslint-config
eslint-config
My shared ESLint & Prettier configuration for projects
Stars: ✭ 12 (-20%)
Mutual labels:  prettier, eslint-config
eslint-config-adjunct
A reasonable collection of plugins to use alongside your main esLint configuration
Stars: ✭ 39 (+160%)
Mutual labels:  prettier, eslint-config
eslint-config-hardcore
The most strict (yet practical) ESLint config. 34 plugins. 1047 rules.
Stars: ✭ 168 (+1020%)
Mutual labels:  prettier, eslint-config
promotion-web
基于React: v18.x.x/Webpack: v5.x.x/React Router v6.x.x/ Antd: v5..x.x/Fetch Api/ Typescript: v4.x.x 等最新版本进行构建...
Stars: ✭ 374 (+2393.33%)
Mutual labels:  prettier, react-hooks
Eslint Config Prettier
Turns off all rules that are unnecessary or might conflict with Prettier.
Stars: ✭ 3,471 (+23040%)
Mutual labels:  prettier, eslint-config
Ruby Airbnb
💎 Airbnb 的 Ruby 代码风格指南
Stars: ✭ 98 (+553.33%)
Mutual labels:  styleguide, airbnb
Dilettantes-Guide-to-Linting
Setting up ESLint, Prettier, VS Code, and the AirBnB style guide in beautiful harmony.
Stars: ✭ 18 (+20%)
Mutual labels:  prettier, airbnb
eslint-config-mingelz
A shared ESLint configuration with Chinese comments. 一份带有完整中文注释的 ESLint 规则。
Stars: ✭ 15 (+0%)
Mutual labels:  styleguide, eslint-config
use-countdown-timer
React hook exposing a countdown timer with optional expiration reset callbacks
Stars: ✭ 31 (+106.67%)
Mutual labels:  react-hooks
tiny-ui
⚛️ A friendly UI component set for React.js
Stars: ✭ 202 (+1246.67%)
Mutual labels:  react-hooks
wemake-frontend-styleguide
Set of the strictest linters for your next frontend app
Stars: ✭ 67 (+346.67%)
Mutual labels:  eslint-config
htwoo
hTWOo - a better Fluent UI framework.
Stars: ✭ 67 (+346.67%)
Mutual labels:  styleguide
use-axios-hooks
axios hooks for common network calls scenarios
Stars: ✭ 27 (+80%)
Mutual labels:  react-hooks
airbnb-map-search
Airbnb Map Search Page Rebuilt with Vue
Stars: ✭ 32 (+113.33%)
Mutual labels:  airbnb
eslint-config-i-am-meticulous
An ESLint shareable config for very meticulous people
Stars: ✭ 32 (+113.33%)
Mutual labels:  eslint-config
jss-material-ui
A enhanced styling engine for material-ui
Stars: ✭ 15 (+0%)
Mutual labels:  styleguide

@rfgamaral/eslint-config-typescript-unified

development ci codecov npm minified size downloads commitizen friendly semantic-release license

A unified ESLint configuration with sensible defaults for TypeScript projects.

Installation

This package provides multiple ESLint Shareable Configurations for your convenience. To make use of any of them, you must first install eslint, prettier and typescript since this package does not do it for you. Then install it with:

npm install --save-dev @rfgamaral/eslint-config-typescript-unified

Usage

Once @rfgamaral/eslint-config-typescript-unified is installed, you can use any of the available configurations in the extends section of your ESLint configuration.

Default

Default configuration with recommended rules from @typescript-eslint/eslint-plugin and eslint-plugin-prettier:

{
  "extends": "@rfgamaral/eslint-config-typescript-unified"
}

ESLint

Extends the default configuration with recommended rules from ESLint:

{
  "extends": "@rfgamaral/eslint-config-typescript-unified/eslint"
}

Airbnb

Extends the default configuration with base rules from Aribnb:

{
  "extends": "@rfgamaral/eslint-config-typescript-unified/airbnb"
}

Airbnb (React)

Extends the Airbnb configuration with React rules from Airbnb:

{
  "extends": "@rfgamaral/eslint-config-typescript-unified/airbnb-react"
}

Airbnb (React + Hooks)

Extends the Airbnb React configuration with Hooks rules from Airbnb:

{
  "extends": "@rfgamaral/eslint-config-typescript-unified/airbnb-react-hooks"
}

Recommended

Extends the Airbnb configuration with my own opinionated rules:

{
  "extends": "@rfgamaral/eslint-config-typescript-unified/recommended"
}

Recommended (React)

Extends the Airbnb (React) configuration with my own opinionated rules:

{
  "extends": "@rfgamaral/eslint-config-typescript-unified/recommended-react"
}

Recommended (React + Hooks)

Extends the Airbnb (React + Hooks) configuration with my own opinionated rules:

{
  "extends": "@rfgamaral/eslint-config-typescript-unified/recommended-react-hooks"
}

Semantics (type-checking)

For all the configurations mentioned above, the TypeScript rules are fast feedback rules which operate purely based on syntax (no type-checking). If you want some additional highly valuable rules that operate on semantics (type-checking), just suffix any of the configuration names above with -semantics. You can read a little bit more about it here.

Frequently Asked Questions

Why is ESLint's no-undef rule disabled?

This rule is disabled to prevent ESLint from reporting no-undef false positives for Interfaces and Types. More details at typescript-eslint/typescript-eslint#342.

The TypeScript compiler will catch undeclared variables by default, so we don't need this rule.

Why are *.d.ts files being ignored for all Airbnb and Recommended configurations?

Airbnb and Recommended configurations make use of eslint-plugin-import which triggers import/no-cycle false positives for cyclic dependencies between type imports. More details at benmosher/eslint-plugin-import#1453.

How to configure a mixed JavaScript/TypeScript codebase with any of the Recommended configurations?

Recommended configurations require explicit return types on functions and class methods (explicit-function-return-type) which triggers false positives for JavaScript files. To workaround that, please ensure add the following override to disable the rule for .js and .jsx files:

{
  "overrides": [
    {
      "files": ["*.{js,jsx}"],
      "rules": {
        "@typescript-eslint/explicit-function-return-type": "off"
      }
    }
  ]
}

License

The use of this source code is governed by an MIT-style license that can be found in the LICENSE file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].