Skip to content

Commit

Permalink
Adds Options Schema to validate eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
mattorchard committed Nov 12, 2023
1 parent 6b21166 commit f242aaa
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# Change Log

## 1.0.0
- Adds Options Schema to validate options passed in eslint config

## 0.4.2
- Fixes false positives from object prototype fields

## 0.4.1
- Readme and copy updates

## 0.4.0
- Added support for function calls on member expressions
- Added support for function calls on member expressions

## 0.3.0
- Added support for checking constructors
Expand Down
19 changes: 18 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,24 @@ function assertThatNodeHasExpectedGenerics({ context, expectedCountMap, node, no
const rules = {
"require-explicit-generics": {
meta: {
type: "problem"
type: "problem",
schema: [{
oneOf: [
{
type: "array",
items: { type: "string" },
uniqueItems: true,
minItems: 1
},
{
type: "object",
additionalProperties: {
type: "integer",
minimum: 1
}
}
]
}]
},
create: function (context) {
if (context.options.length === 0) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "eslint-plugin-require-explicit-generics",
"description": "Force configured functions to include explicit generics",
"version": "0.4.2",
"version": "1.0.0",
"main": "index.js",
"homepage": "https://github.com/mattorchard/eslint-plugin-require-explicit-generics",
"repository": {
Expand Down

0 comments on commit f242aaa

Please sign in to comment.