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

Rule: require tests for rules

Open not-an-aardvark opened this issue 8 years ago • 2 comments
trafficstars

Requires a rule file to have tests. Can be configured with a location of the tests.

/* eslint eslint-plugin/require-rule-tests: ["error", {"testPath": "../../tests/lib/rules/"}]

If the file at ../../tests/lib/rules/${__filename} exists (relative to rule file), an error is reported.

not-an-aardvark avatar Apr 06 '17 17:04 not-an-aardvark

similar to tests, should also require docs?

aladdin-add avatar Jul 16 '17 03:07 aladdin-add

Seems reasonable. The reason I'm not sure about whether this rule is a good idea is because it seems like adding tests for a feature isn't necessarily something specific to ESLint plugins, so it might not be in scope for this plugin.

not-an-aardvark avatar Jul 16 '17 03:07 not-an-aardvark