Skip to content

Commit

Permalink
chore: util function to get rules requiring type checking
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang committed Sep 12, 2023
1 parent 60a544c commit 5f2226c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions utils/rules-requiring-type-checking.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const allRules = require('@typescript-eslint/eslint-plugin').rules

module.exports = Object.entries(allRules)
.filter(([name, rule]) => rule.meta?.docs?.requiresTypeChecking)
.map(([name]) => name)
// This rule does not require type information, but as its source code requires the parserService,
// it seems to be encountering undefined behavior in `.vue` files
// https://github.com/typescript-eslint/typescript-eslint/issues/4755#issuecomment-1080961338
.concat('prefer-optional-chain')
.map(name => `@typescript-eslint/${name}`)

0 comments on commit 5f2226c

Please sign in to comment.