eslint-plugin-decorator-position
Advanced tools
Comparing version 0.0.1-preview.4 to 0.0.1-preview.5
@@ -11,3 +11,3 @@ module.exports = { | ||
plugins: ['ember'], | ||
plugins: ['decorator-position'], | ||
}; |
'use strict'; | ||
const { assertConfig } = require('../utils/assert-config'); | ||
module.exports = { | ||
@@ -16,2 +14,51 @@ meta: { | ||
}, | ||
schema: { | ||
definitions: { | ||
decoratorConfig: { | ||
oneOf: [ | ||
{ | ||
type: 'array', | ||
items: [ | ||
{ type: 'string' }, | ||
{ | ||
type: 'object', | ||
properties: { | ||
withArgs: { | ||
type: 'boolean', | ||
}, | ||
}, | ||
additionalProperties: false, | ||
}, | ||
], | ||
additionalItems: false, | ||
minItems: 1, | ||
maxItems: 2, | ||
}, | ||
{ | ||
type: 'string', | ||
}, | ||
], | ||
}, | ||
}, | ||
items: [ | ||
{ | ||
type: 'object', | ||
properties: { | ||
onSameLine: { | ||
type: 'array', | ||
uniqeItems: true, | ||
items: { $ref: '#/definitions/decoratorConfig' }, | ||
}, | ||
onDifferentLines: { | ||
type: 'array', | ||
uniqeItems: true, | ||
items: { $ref: '#/definitions/decoratorConfig' }, | ||
}, | ||
}, | ||
additionalProperties: false, | ||
}, | ||
], | ||
additionalItems: false, | ||
}, | ||
}, | ||
@@ -38,4 +85,2 @@ | ||
const ALLOWED_OPTIONS = Object.keys(defaultOptions); | ||
function decoratorPositionRule(context) { | ||
@@ -45,4 +90,2 @@ const userOptions = context.options[0] || {}; | ||
assertConfig(options, { ALLOWED_OPTIONS }); | ||
return { | ||
@@ -49,0 +92,0 @@ 'ClassProperty:exit'(node) { |
{ | ||
"name": "eslint-plugin-decorator-position", | ||
"version": "0.0.1-preview.4", | ||
"version": "0.0.1-preview.5", | ||
"description": "ESLint plugin for enforcing decorator position", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
15158
8
243