1.2.8 • Published 1 year ago

@rxlint/eslint-plugin-angular v1.2.8

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@rxlint/eslint-plugin-angular

GitHub License NPM version Downloads GitHub Actions Workflow Status

This package is a fork of the package cartant/eslint-plugin-rxjs-angular with trimmed and updated dependencies to work with both eslint 8 and 9.

There is no recommended configuration for this package, as all of the rules are opinionated.

Installation

Install the ESLint TypeScript parser using npm:

npm install --save-dev eslint typescript @typescript-eslint/parser @rxlint/eslint-plugin-angular --save-dev
# or
yarn add --dev eslint typescript @typescript-eslint/parser @rxlint/eslint-plugin-angular

Configuration

This plugin should work with both ESLint v8 eslintrc and ESLint v9 eslint.config.js format files.

For ESLint v8, add @rxlint/angular to your plugin array:

.eslintrc.js

module.exports = {
  files: ["**/*.ts"],
  parser: "@typescript-eslint/parser",
  parserOptions: {
    ecmaVersion: "latest",
    project: true,
    sourceType: "module"
  },
  plugins: ["@rxlint/angular"],
  rules: {
    "@rxlint/angular/prefer-async-pipe": "error"
  }
};

For ESLint v9, import the plugin and map it to a name:

eslint.config.js

const rxjsAngular = require("@rxlint/eslint-plugin-angular");

module.exports = [{
  files: ["**/*.ts"],
  plugins: {
    "@rxlint-angular": rxjsAngular
  },
  rules: {
    "@rxlint-angular/prefer-async-pipe": "error"
  }
}];

Rules

The package includes the following rules:

RuleDescriptionRecommended
prefer-async-pipeForbids the calling of subscribe within Angular components.No
prefer-compositionForbids subscribe calls that are not composed within Angular components (and, optionally, within services, directives, and pipes).No
prefer-takeuntilForbids Calling subscribe without an accompanying takeUntil.No
1.2.8

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago