Created
November 12, 2021 08:32
-
-
Save viktor-yakubiv/65d0b14d37304b699fd6b6fc5cfcfef7 to your computer and use it in GitHub Desktop.
Check if you use proper TypeScript rules for ESLint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run within this directory: | |
# https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin/docs/rules | |
# | |
# Before running execute `eslint --print-config <src> > eslint.json` | |
# and copy this file to the directory where this script is ran. | |
for file in $(ls *.md); do | |
rule=${file%.md} | |
# fgrep "\"$rule\"" eslint.json | |
es_res=$(jq ".rules[\"$rule\"][0]" eslint.json) | |
ts_res=$(jq ".rules[\"@typescript-eslint/$rule\"][0]" eslint.json) | |
if [ $es_res != null ] && [ $ts_res == null ]; then | |
echo "$rule: $es_res" | |
echo "'@typescript-eslint/$rule': $ts_res" | |
echo | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment