Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
441 views
in Technique[技术] by (71.8m points)

yarnpkg - How to get a list of all eslint rules that errored during linting?

I'm currently in the process of updating the eslint packages being used for a large codebase. After the update eslint is now finding errors on thousands of files that fail different rules.

Is there a way to run eslint and have it output a list of the rules that failed?

By default eslint runs through each file and outputs each line that failed. Instead I want to build a list of rules that failed (no duplicates) like below:

i.e.

no-console
react/no-multi-comp
react/jsx-curly-spacing

My intent is to turn all these failing rules off in the eslint.js file, but was hoping for an easy way to collate this list.

question from:https://stackoverflow.com/questions/65836228/how-to-get-a-list-of-all-eslint-rules-that-errored-during-linting

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You need to use an eslint formater to do this. Here are a couple that you might consider

https://www.npmjs.com/package/eslint-formatter-summary https://www.npmjs.com/package/eslint-formatter-summary-chart


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...