1.0.1 • Published 2 years ago

@mels/eslint-config-typescript v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

✨ Features

This package contains all my TypeScript rules as an extensible shared ESLint config. It also disables ESLint rules which are already handled by TypeScript.

Install

With npm:

npm install @mels/eslint-config-typescript --save-dev

With yarn:

yarn add @mels/eslint-config-typescript --dev

How To Use

The only config option that is required is parserOptions.project, because this config uses rules which require type information.

// .eslintrc.js
module.exports = {
  extends: ['@mels/base', '@mels/typescript'],
  parserOptions: {
    project: './tsconfig.json', // Set the path to the project tsconfig. This is required.
  },
};

Additional config options for @typescript-eslint/parser and eslint-import-resolver-typescript should be structured like so:

// .eslintrc.js
module.exports = {
  extends: ['@mels/base', '@mels/typescript'],

  // Config options for `@typescript-eslint/parser` should go under `parserOptions`
  // Please see: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/parser#configuration
  parserOptions: {
    project: './tsconfig.json',
    tsconfigRootDir: __dirname, // root directory for relative tsconfig paths specified in the project option above
    // ...etc
  },

  settings: {
    'import/resolver': {
      // Config options for `eslint-import-resolver-typescript`
      // Please see: https://github.com/import-js/eslint-import-resolver-typescript#configuration
      typescript: {
        project: './tsconfig.eslint.json', // if different from default <root>/tsconfig.json
      },
    },
  },
};

Helpful Links

Credits

  • Toolkit logo by Creatype from www.flaticon.com

License

MIT

1.0.1

2 years ago

1.0.0

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago