@pascaliske/eslint-config

3.0.0 • Public • Published

Shared ESLint config

npm (scoped) GitHub Tag Build Status License: MIT GitHub Last Commit Awesome Badges

Installation

To install the config use the following command:

yarn add @pascaliske/eslint-config --dev

For TypeScript projects you will also need the following peer dependencies:

yarn add eslint @typescript-eslint/{parser,eslint-plugin} --dev

For Angular projects you will also need the following peer dependencies:

yarn add eslint @typescript-eslint/{parser,eslint-plugin} @angular-eslint/{template-parser,eslint-plugin,eslint-plugin-template} --dev

Usage

There are three possible types of configurations available: base (only JS), typescript (JS + TS) and angular (JS + TS + Angular specifics). You can reference those by adding a suffix to the extends value in your config file (e.g. @pascaliske/eslint-config/angular). The base configuration will be used as default when the suffix is missing.

.eslintrc

{
  "root": true,
  "extends": "@pascaliske/eslint-config/base", // or typescript / angular
  "env": {
    "browser": true
  }
}

For usage in Node.js projects you can also enable the Node.js environment instead:

.eslintrc

{
  "root": true,
  "extends": "@pascaliske/eslint-config/base", // or typescript / angular
  "env": {
    "node": true
  }
}

For usage in TypeScript and Angular projects you have to use a JS based config file and explicitly set parser options with a tsconfig.json-file:

.eslintrc.js

module.exports = {
    root: true,
    extends: "@pascaliske/eslint-config/typescript", // or angular
    parserOptions: {
        project: `${__dirname}/tsconfig.json`,
        createDefaultProgram: true,
    },
    env: {
        node: true,
    },
}

For more information on environments visit the ESLint documentation.

License

MIT © 2022 Pascal Iske

Package Sidebar

Install

npm i @pascaliske/eslint-config

Weekly Downloads

68

Version

3.0.0

License

MIT

Unpacked Size

18.1 kB

Total Files

15

Last publish

Collaborators

  • pascaliske