3.0.0 • Published 10 months ago

@pascaliske/eslint-config v3.0.0

Weekly downloads
30
License
MIT
Repository
github
Last release
10 months ago

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

3.0.0

10 months ago

2.0.7

10 months ago

2.0.6

2 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago