简体   繁体   中英

Is there a way to list all active ESLint / Prettier rules in an Angular project?

Background:

I'm trying to config ESLint and Prettier using .eslintrc.js and .prettierrc.js by starting with some extends like:

  • eslint:recommended
  • plugin:@typescript-eslint/recommended
  • prettier/@typescript-eslint
  • plugin:prettier/recommended
  • plugin:@angular-eslint/recommended

However these may contain conflicting rules or options / rules I find annoying.


Question:

Is there a script, an IDE plugin (our team uses WebStorm and VS Code ) or a standalone tool which will compile a list of effective options and rules based on my current config?


It should ideally list all rules which are actually applied including imported rule sets. For each rule it should show its current setting (maybe even the default and other options) and its origin (rule set, config file). If a rule has been overwritten or has conflicting settings from two ore more imported rule sets it should show that too.

I imagine something similar to an effective Maven POM or a Maven dependencies tree either as a printed output or a GUI tool window.

I looked at https://www.npmjs.com/package/eslint-find-rules which is a start. However so far I only got a list of rules with no info where they come from or what their current setting is.

Motivation:

We are looking for a way to determine which rule set(s) to use as a starting point and which rules we want to overwrite without having to blindly try for ages.

The eslint --print-config file.js command should be able to list all the rules with their values applied to a specific file. However, it will not show in which plugin the rule was enabled.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM