Giter Club home page Giter Club logo

eslint-config-codetakt-ts's Introduction

eslint-config-codetakt-ts

Opinionated eslint config for TypeScript and (optionally) React projects.

Installation

module.exports = {
  // REQUIRED: Put extends option. react is optional.
  extends: ['codetakt-ts', 'codetakt-ts/react'],
  rules: {
    // You can customize global rules here.
  },
  overrides: [
    {
      files: ['*.js', '*.jsx'],
      // You can customize config only for JS files, optional.
      env: {
        es2020: true,
        node: true,
      },
    },
    {
      files: ['*.ts', '*.tsx'],
      parserOptions: {
        // REQUIRED: You need specify parser, add this to your config:
        // https://github.com/typescript-eslint/typescript-eslint/issues/251
        tsconfigRootDir: __dirname,
      },
      // You can customize config only for TS files, optional.
      rules: {
        // ...
      },
    },
  ],
}

Customize config for no-restricted-imports rules

You can customize it by importing the config object placed as separated file.

const { merge } = require('webpack-merge')
const noRestrictedImportsRulesWithoutLayoutEffect = merge(
  require('eslint-config-codetakt-ts/noRestrictedImportsRules'),
  {
    // Your config goes here.
  }
)

(webpack-merge is convenient for merging nested array/object structure)

Philosophy

  • Catch common mistakes but not to be too strict/verbose.
  • Use standards like eslint:recommended and prettier for base config.
  • Enable migration to latest syntax by linting.
  • For @typescript-eslint:
    • @typescript-eslint/recommended includes more style rules than eslint:recommended.
    • Disable strict style config which not included in eslint:recommended, like no-empty-function.
    • Please consider to use @typescript-eslint/no-explicit-any in your config. It is currently not included.
    • TODO: Consider including @typescript-eslint/recommended-requiring-type-checking.

eslint-config-codetakt-ts's People

Contributors

ypresto avatar megos avatar plus886 avatar hanachin avatar tompng avatar

Watchers

Takeru Naito avatar  avatar Masaki Goto avatar Ryo Kajiwara avatar James Cloos avatar Sakito Matsuyama avatar Taka avatar Takafumi Asano avatar innparusu avatar  avatar Taichiro Takasaki avatar Yuka Saito avatar  avatar Takuya Hitomi avatar lovealebeer avatar  avatar  avatar tsb avatar  avatar Seong Yong-ju avatar Shinsuke Hamasho avatar matzryo avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.