@lifeomic/eslint-plugin-typescript
LifeOmic config for typescript-eslint
Last updated 6 months ago by lifeomicdev .
MIT · Original npm · Tarball · package.json
$ cnpm install @lifeomic/eslint-plugin-typescript 
SYNC missed versions from official npm registry.

eslint-plugin-typescript

LifeOmic config for typescript-eslint

Installation

Next, install @lifeomic/eslint-plugin-typescript:

yarn add -D @lifeomic/eslint-plugin-typescript --save-dev

Usage

Add typescript to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  plugins: ['@lifeomic/typescript'];
}

Add the recommended config and rules to your extends:

{
    extends: ['plugin:@lifeomic/typescript/recommended']
}

There's an optional reactNative config which provides some helpers for reactNative.

NOTE: These make use of the @typescript-eslint/eslint-plugin-tslint plugin, which does not like to be run on non-typescript files, or files not included in a project. That means if you have js files, or ts files outside of a helper included in your lint config, you can do something like this:

const lifeomicTypescript = require('@lifeomic/eslint-plugin-typescript');
const reactNative = lifeomicTypescript.configs.reactNative;

...

  overrides: [
    {
      // src files
      files: ['src/**/*.{ts,tsx}', 'typings/**/*.ts'],
      excludedFiles: [
        'src/**/*.test.{tsx,ts}',
        'src/{testUtils,utils/__mocks__}/**/*'
      ],
      env: {
        node: false,
        browser: true
      },
      rules: {
          ...reactNative.rules // only add these rules to source files
      }
    }
  ]

...

Current Tags

  • 0.1.1                                ...           latest (6 months ago)

2 Versions

  • 0.1.1                                ...           6 months ago
  • 0.1.0                                ...           6 months ago
Maintainers (1)
Downloads
Today 0
This Week 2
This Month 2
Last Day 0
Last Week 0
Last Month 2
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |