From 2c2b1ea5bb123683344fdbf800f0c8b6dfa7ae5b Mon Sep 17 00:00:00 2001 From: Bell Date: Sun, 7 Apr 2024 21:07:57 +0200 Subject: [PATCH] Support flat config format (#32) * Support flat config format Without the schema, you get an error like this: ``` Error: Key "rules": Key "no-relative-import-paths/no-relative-import-paths": Value [{"allowSameFolder":true}] should NOT have more than 0 items. ``` * Convert tabs to spaces --- index.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/index.js b/index.js index 3f60565..da5cbe4 100644 --- a/index.js +++ b/index.js @@ -35,6 +35,22 @@ module.exports = { meta: { type: "layout", fixable: "code", + schema: { + type: "array", + minItems: 0, + maxItems: 1, + items: [ + { + type: "object", + properties: { + allowSameFolder: { type: "boolean" }, + rootDir: { type: "string" }, + prefix: { type: "string" }, + }, + additionalProperties: false, + }, + ], + }, }, create: function (context) { const { allowSameFolder, rootDir, prefix } = {