eslint-plugin-eslint-plugin icon indicating copy to clipboard operation
eslint-plugin-eslint-plugin copied to clipboard

New rule `require-error-positions`

Open FloEdelmann opened this issue 1 year ago • 1 comments

Many contributors add tests with only line: 4 for reported errors. Often, the test cases should include the column and end position though. This could be enforced with a new ESLint rule that requires all of line, endLine, column, and endColumn to be present for all expected errors.

FloEdelmann avatar Jul 08 '24 16:07 FloEdelmann

Currently, there is no rule enforcing the structure of error objects. I am considering introducing a rule that developers can configure to enforce which properties (such as line, endLine, column, and endColumn) must be present in error objects. Additionally, this rule could specify whether the properties must follow a certain order. Of course, this will require a more detailed and specific design.

aladdin-add avatar Jul 11 '24 06:07 aladdin-add