diff --git a/.changeset/dull-terms-matter.md b/.changeset/dull-terms-matter.md new file mode 100644 index 00000000..e7840c41 --- /dev/null +++ b/.changeset/dull-terms-matter.md @@ -0,0 +1,6 @@ +--- +"eslint-plugin-use-macros": patch +"eslint-plugin-wantedly": patch +--- + +hotfix(eslint-plugin): Fix option schema diff --git a/packages/eslint-plugin-use-macros/__tests__/GraphQLTag.test.js b/packages/eslint-plugin-use-macros/__tests__/GraphQLTag.test.js index 8e0f27d1..8d68886c 100644 --- a/packages/eslint-plugin-use-macros/__tests__/GraphQLTag.test.js +++ b/packages/eslint-plugin-use-macros/__tests__/GraphQLTag.test.js @@ -11,7 +11,6 @@ ruleTester.run("use-macros/graphql-tag", GraphQLTagRule, { valid: [ { code: `import { gql } from "graphql.macro";`, - options: ["error"], }, ], invalid: [ @@ -19,7 +18,6 @@ ruleTester.run("use-macros/graphql-tag", GraphQLTagRule, { code: `import gql from "graphql-tag";`, output: `import { gql } from "graphql.macro";`, errors: ['Please import from "graphql.macro" instead of "graphql-tag"'], - options: ["error"], }, ], }); diff --git a/packages/eslint-plugin-use-macros/__tests__/StyledComponents.test.js b/packages/eslint-plugin-use-macros/__tests__/StyledComponents.test.js index 15cac2f0..210fcd45 100644 --- a/packages/eslint-plugin-use-macros/__tests__/StyledComponents.test.js +++ b/packages/eslint-plugin-use-macros/__tests__/StyledComponents.test.js @@ -11,7 +11,6 @@ ruleTester.run("use-macros/styled-components", StyledComponentsRule, { valid: [ { code: `import styled from "styled-components/macro";`, - options: ["error"], }, ], invalid: [ @@ -19,7 +18,6 @@ ruleTester.run("use-macros/styled-components", StyledComponentsRule, { code: `import styled from "styled-components";`, output: `import styled from "styled-components/macro";`, errors: ['Please import from "styled-components/macro" instead of "styled-components"'], - options: ["error"], }, ], }); diff --git a/packages/eslint-plugin-use-macros/rules/GraphQLTag.js b/packages/eslint-plugin-use-macros/rules/GraphQLTag.js index 737124eb..62966897 100644 --- a/packages/eslint-plugin-use-macros/rules/GraphQLTag.js +++ b/packages/eslint-plugin-use-macros/rules/GraphQLTag.js @@ -23,11 +23,6 @@ module.exports = { meta: { type: "suggestion", fixable: "code", - schema: [ - { - enum: ["error", "warn", "off"], - }, - ], }, create(context) { return { diff --git a/packages/eslint-plugin-use-macros/rules/StyledComponents.js b/packages/eslint-plugin-use-macros/rules/StyledComponents.js index e222bb6b..a446a4b4 100644 --- a/packages/eslint-plugin-use-macros/rules/StyledComponents.js +++ b/packages/eslint-plugin-use-macros/rules/StyledComponents.js @@ -5,11 +5,6 @@ module.exports = { meta: { type: "suggestion", fixable: "code", - schema: [ - { - enum: ["error", "warn", "off"], - }, - ], }, create(context) { return { diff --git a/packages/eslint-plugin-wantedly/src/__tests__/__snapshots__/index.test.ts.snap b/packages/eslint-plugin-wantedly/src/__tests__/__snapshots__/index.test.ts.snap index 99cde6d8..a0b9a38e 100644 --- a/packages/eslint-plugin-wantedly/src/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/eslint-plugin-wantedly/src/__tests__/__snapshots__/index.test.ts.snap @@ -15,13 +15,6 @@ exports[`should match snapshot 1`] = ` }, "fixable": "code", "schema": [ - { - "enum": [ - "error", - "warn", - "off", - ], - }, { "additionalProperties": false, "properties": { @@ -43,13 +36,6 @@ exports[`should match snapshot 1`] = ` }, "fixable": "code", "schema": [ - { - "enum": [ - "error", - "warn", - "off", - ], - }, { "additionalProperties": false, "properties": { @@ -71,13 +57,6 @@ exports[`should match snapshot 1`] = ` }, "fixable": "code", "schema": [ - { - "enum": [ - "error", - "warn", - "off", - ], - }, { "additionalProperties": false, "properties": { @@ -98,15 +77,6 @@ exports[`should match snapshot 1`] = ` "url": "https://github.com/wantedly/frolint/tree/master/packages/eslint-plugin-wantedly/docs/rules/nexus-enum-values-description.md", }, "fixable": "code", - "schema": [ - { - "enum": [ - "error", - "warn", - "off", - ], - }, - ], "type": "suggestion", }, }, @@ -117,15 +87,6 @@ exports[`should match snapshot 1`] = ` "url": "https://github.com/wantedly/frolint/tree/master/packages/eslint-plugin-wantedly/docs/rules/nexus-field-description.md", }, "fixable": "code", - "schema": [ - { - "enum": [ - "error", - "warn", - "off", - ], - }, - ], "type": "suggestion", }, }, @@ -137,13 +98,6 @@ exports[`should match snapshot 1`] = ` }, "fixable": "code", "schema": [ - { - "enum": [ - "error", - "warn", - "off", - ], - }, { "additionalProperties": false, "properties": { @@ -163,15 +117,6 @@ exports[`should match snapshot 1`] = ` "docs": { "url": "https://github.com/wantedly/frolint/tree/master/packages/eslint-plugin-wantedly/docs/rules/nexus-type-description.md", }, - "schema": [ - { - "enum": [ - "error", - "warn", - "off", - ], - }, - ], "type": "suggestion", }, }, @@ -183,13 +128,6 @@ exports[`should match snapshot 1`] = ` }, "fixable": "code", "schema": [ - { - "enum": [ - "error", - "warn", - "off", - ], - }, { "additionalProperties": false, "properties": { @@ -217,13 +155,6 @@ exports[`should match snapshot 1`] = ` }, "fixable": "code", "schema": [ - { - "enum": [ - "error", - "warn", - "off", - ], - }, { "additionalProperties": false, "properties": { @@ -245,13 +176,6 @@ exports[`should match snapshot 1`] = ` }, "fixable": "code", "schema": [ - { - "enum": [ - "error", - "warn", - "off", - ], - }, { "additionalProperties": false, "properties": { @@ -273,13 +197,6 @@ exports[`should match snapshot 1`] = ` }, "fixable": "code", "schema": [ - { - "enum": [ - "error", - "warn", - "off", - ], - }, { "additionalProperties": false, "properties": { @@ -300,15 +217,6 @@ exports[`should match snapshot 1`] = ` "url": "https://github.com/wantedly/frolint/tree/master/packages/eslint-plugin-wantedly/docs/rules/nexus-enum-values-description.md", }, "fixable": "code", - "schema": [ - { - "enum": [ - "error", - "warn", - "off", - ], - }, - ], "type": "suggestion", }, }, @@ -319,15 +227,6 @@ exports[`should match snapshot 1`] = ` "url": "https://github.com/wantedly/frolint/tree/master/packages/eslint-plugin-wantedly/docs/rules/nexus-field-description.md", }, "fixable": "code", - "schema": [ - { - "enum": [ - "error", - "warn", - "off", - ], - }, - ], "type": "suggestion", }, }, @@ -339,13 +238,6 @@ exports[`should match snapshot 1`] = ` }, "fixable": "code", "schema": [ - { - "enum": [ - "error", - "warn", - "off", - ], - }, { "additionalProperties": false, "properties": { @@ -365,15 +257,6 @@ exports[`should match snapshot 1`] = ` "docs": { "url": "https://github.com/wantedly/frolint/tree/master/packages/eslint-plugin-wantedly/docs/rules/nexus-type-description.md", }, - "schema": [ - { - "enum": [ - "error", - "warn", - "off", - ], - }, - ], "type": "suggestion", }, }, @@ -385,13 +268,6 @@ exports[`should match snapshot 1`] = ` }, "fixable": "code", "schema": [ - { - "enum": [ - "error", - "warn", - "off", - ], - }, { "additionalProperties": false, "properties": { diff --git a/packages/eslint-plugin-wantedly/src/rules/__tests__/graphql-operation-name.test.ts b/packages/eslint-plugin-wantedly/src/rules/__tests__/graphql-operation-name.test.ts index 8ad62d12..f2bed2e9 100644 --- a/packages/eslint-plugin-wantedly/src/rules/__tests__/graphql-operation-name.test.ts +++ b/packages/eslint-plugin-wantedly/src/rules/__tests__/graphql-operation-name.test.ts @@ -61,7 +61,7 @@ gql\` } \`;`, errors: ["The operation name getProject should be PascalCase"], - options: ["error", { autofix: true }], + options: [{ autofix: true }], }, { name: "No operation name is specified for a query", diff --git a/packages/eslint-plugin-wantedly/src/rules/__tests__/graphql-pascal-case-type-name.test.ts b/packages/eslint-plugin-wantedly/src/rules/__tests__/graphql-pascal-case-type-name.test.ts index d41590b8..321d7951 100644 --- a/packages/eslint-plugin-wantedly/src/rules/__tests__/graphql-pascal-case-type-name.test.ts +++ b/packages/eslint-plugin-wantedly/src/rules/__tests__/graphql-pascal-case-type-name.test.ts @@ -83,7 +83,7 @@ ruleTester.run(RULE_NAME, RULE, { } \`;`, errors: ["The interface type node should be PascalCase"], - options: ["error", { autofix: true }], + options: [{ autofix: true }], }, { name: "Type name is fixed by plugin", @@ -100,7 +100,7 @@ ruleTester.run(RULE_NAME, RULE, { } \`;`, errors: ["The object type foo should be PascalCase"], - options: ["error", { autofix: true }], + options: [{ autofix: true }], }, { name: "Fragment name is fixed by plugin", @@ -115,7 +115,7 @@ ruleTester.run(RULE_NAME, RULE, { } \`;`, errors: ["The fragment fooFragment should be PascalCase"], - options: ["error", { autofix: true }], + options: [{ autofix: true }], }, { name: "Nested fragment name is fixed by plugin", @@ -132,7 +132,7 @@ ruleTester.run(RULE_NAME, RULE, { \$\{BarFragment\} \`;`, errors: ["The fragment fooFragment should be PascalCase"], - options: ["error", { autofix: true }], + options: [{ autofix: true }], }, { name: "Nested fragment name is fixed by plugin 2", @@ -149,7 +149,7 @@ ruleTester.run(RULE_NAME, RULE, { } \`;`, errors: ["The fragment fooFragment should be PascalCase"], - options: ["error", { autofix: true }], + options: [{ autofix: true }], }, ], }); diff --git a/packages/eslint-plugin-wantedly/src/rules/__tests__/nexus-camel-case-field-name.test.ts b/packages/eslint-plugin-wantedly/src/rules/__tests__/nexus-camel-case-field-name.test.ts index 8858167a..cef1e3ca 100644 --- a/packages/eslint-plugin-wantedly/src/rules/__tests__/nexus-camel-case-field-name.test.ts +++ b/packages/eslint-plugin-wantedly/src/rules/__tests__/nexus-camel-case-field-name.test.ts @@ -39,7 +39,6 @@ const User = objectType({ "The field Profile should be camelCase", "The field Posts should be camelCase", ], - options: ["error"], }, { name: "Auto fix enabled", @@ -78,7 +77,7 @@ const User = objectType({ "The field Profile should be camelCase", "The field Posts should be camelCase", ], - options: ["error", { autofix: true }], + options: [{ autofix: true }], }, ], }); diff --git a/packages/eslint-plugin-wantedly/src/rules/__tests__/nexus-pascal-case-type-name.test.ts b/packages/eslint-plugin-wantedly/src/rules/__tests__/nexus-pascal-case-type-name.test.ts index 4941bc7f..29dbca03 100644 --- a/packages/eslint-plugin-wantedly/src/rules/__tests__/nexus-pascal-case-type-name.test.ts +++ b/packages/eslint-plugin-wantedly/src/rules/__tests__/nexus-pascal-case-type-name.test.ts @@ -31,7 +31,7 @@ const Foo = objectType({ }, });`, errors: ["The object type name foo should be PascalCase"], - options: ["error", { autofix: true }], + options: [{ autofix: true }], }, { name: "Union type name is not PascalCase", @@ -54,7 +54,7 @@ const MediaType = unionType({ }, });`, errors: ["The union type name mediaType should be PascalCase"], - options: ["error", { autofix: true }], + options: [{ autofix: true }], }, { name: "Scalar type name is not PascalCase", @@ -87,7 +87,7 @@ const DateScalar = scalarType({ }, });`, errors: ["The scalar type name date should be PascalCase"], - options: ["error", { autofix: true }], + options: [{ autofix: true }], }, { name: "Interface type name is not PascalCase", @@ -106,7 +106,7 @@ const Node = interfaceType({ }, });`, errors: ["The interface type name node should be PascalCase"], - options: ["error", { autofix: true }], + options: [{ autofix: true }], }, { name: "Input type name is not PascalCase", @@ -127,7 +127,7 @@ export const InputType = inputObjectType({ }, });`, errors: ["The input object type name inputType should be PascalCase"], - options: ["error", { autofix: true }], + options: [{ autofix: true }], }, { name: "Enum type is not Pascal case", @@ -144,7 +144,7 @@ const Episode = enumType({ description: "The first Star Wars episodes released", });`, errors: ["The enum type name episode should be PascalCase"], - options: ["error", { autofix: true }], + options: [{ autofix: true }], }, ], }); diff --git a/packages/eslint-plugin-wantedly/src/rules/__tests__/nexus-upper-case-enum-members.test.ts b/packages/eslint-plugin-wantedly/src/rules/__tests__/nexus-upper-case-enum-members.test.ts index 154bd3cf..e032882f 100644 --- a/packages/eslint-plugin-wantedly/src/rules/__tests__/nexus-upper-case-enum-members.test.ts +++ b/packages/eslint-plugin-wantedly/src/rules/__tests__/nexus-upper-case-enum-members.test.ts @@ -44,7 +44,7 @@ const Episode = enumType({ "The enum member `Episode.empire` should be UPPER_CASE", "The enum member `Episode.jedi` should be UPPER_CASE", ], - options: ["error", { autofix: true }], + options: [{ autofix: true }], }, { @@ -89,7 +89,7 @@ const Episode = enumType({ "The enum member `Episode.empire` should be UPPER_CASE", "The enum member `Episode.jedi` should be UPPER_CASE", ], - options: ["error", { autofix: true }], + options: [{ autofix: true }], }, { @@ -122,7 +122,7 @@ const Episode = enumType({ "The enum member `Episode.empire` should be UPPER_CASE", "The enum member `Episode.jedi` should be UPPER_CASE", ], - options: ["error", { autofix: true }], + options: [{ autofix: true }], }, { diff --git a/packages/eslint-plugin-wantedly/src/rules/graphql-operation-name.ts b/packages/eslint-plugin-wantedly/src/rules/graphql-operation-name.ts index 8c8cd790..3c37c7d7 100644 --- a/packages/eslint-plugin-wantedly/src/rules/graphql-operation-name.ts +++ b/packages/eslint-plugin-wantedly/src/rules/graphql-operation-name.ts @@ -25,9 +25,6 @@ export const RULE: Rule.RuleModule = { type: "suggestion", fixable: "code", schema: [ - { - enum: ["error", "warn", "off"], - }, { type: "object", properties: { diff --git a/packages/eslint-plugin-wantedly/src/rules/graphql-pascal-case-type-name.ts b/packages/eslint-plugin-wantedly/src/rules/graphql-pascal-case-type-name.ts index 2a80a4ad..2a3ac17d 100644 --- a/packages/eslint-plugin-wantedly/src/rules/graphql-pascal-case-type-name.ts +++ b/packages/eslint-plugin-wantedly/src/rules/graphql-pascal-case-type-name.ts @@ -78,9 +78,6 @@ export const RULE: Rule.RuleModule = { type: "suggestion", fixable: "code", schema: [ - { - enum: ["error", "warn", "off"], - }, { type: "object", properties: { diff --git a/packages/eslint-plugin-wantedly/src/rules/nexus-camel-case-field-name.ts b/packages/eslint-plugin-wantedly/src/rules/nexus-camel-case-field-name.ts index 8f3f2a2c..e21b4f99 100644 --- a/packages/eslint-plugin-wantedly/src/rules/nexus-camel-case-field-name.ts +++ b/packages/eslint-plugin-wantedly/src/rules/nexus-camel-case-field-name.ts @@ -19,9 +19,6 @@ export const RULE: Rule.RuleModule = { type: "suggestion", fixable: "code", schema: [ - { - enum: ["error", "warn", "off"], - }, { type: "object", properties: { diff --git a/packages/eslint-plugin-wantedly/src/rules/nexus-enum-values-description.ts b/packages/eslint-plugin-wantedly/src/rules/nexus-enum-values-description.ts index 89a4f1a1..b51b0e5c 100644 --- a/packages/eslint-plugin-wantedly/src/rules/nexus-enum-values-description.ts +++ b/packages/eslint-plugin-wantedly/src/rules/nexus-enum-values-description.ts @@ -9,11 +9,6 @@ export const RULE: Rule.RuleModule = { meta: { type: "suggestion", fixable: "code", - schema: [ - { - enum: ["error", "warn", "off"], - }, - ], docs: { url: docsUrl(RULE_NAME), }, diff --git a/packages/eslint-plugin-wantedly/src/rules/nexus-field-description.ts b/packages/eslint-plugin-wantedly/src/rules/nexus-field-description.ts index e34769f1..90426a45 100644 --- a/packages/eslint-plugin-wantedly/src/rules/nexus-field-description.ts +++ b/packages/eslint-plugin-wantedly/src/rules/nexus-field-description.ts @@ -12,11 +12,6 @@ export const RULE: Rule.RuleModule = { meta: { type: "suggestion", fixable: "code", - schema: [ - { - enum: ["error", "warn", "off"], - }, - ], docs: { url: docsUrl(RULE_NAME), }, diff --git a/packages/eslint-plugin-wantedly/src/rules/nexus-pascal-case-type-name.ts b/packages/eslint-plugin-wantedly/src/rules/nexus-pascal-case-type-name.ts index f3031fe0..3966e41f 100644 --- a/packages/eslint-plugin-wantedly/src/rules/nexus-pascal-case-type-name.ts +++ b/packages/eslint-plugin-wantedly/src/rules/nexus-pascal-case-type-name.ts @@ -19,9 +19,6 @@ export const RULE: Rule.RuleModule = { type: "suggestion", fixable: "code", schema: [ - { - enum: ["error", "warn", "off"], - }, { type: "object", properties: { diff --git a/packages/eslint-plugin-wantedly/src/rules/nexus-type-description.ts b/packages/eslint-plugin-wantedly/src/rules/nexus-type-description.ts index 202dc4fe..ba66cefc 100644 --- a/packages/eslint-plugin-wantedly/src/rules/nexus-type-description.ts +++ b/packages/eslint-plugin-wantedly/src/rules/nexus-type-description.ts @@ -11,11 +11,6 @@ const FUNCTION_WHITELIST = ["objectType", "unionType", "scalarType", "interfaceT export const RULE: Rule.RuleModule = { meta: { type: "suggestion", - schema: [ - { - enum: ["error", "warn", "off"], - }, - ], docs: { url: docsUrl(RULE_NAME), }, diff --git a/packages/eslint-plugin-wantedly/src/rules/nexus-upper-case-enum-members.ts b/packages/eslint-plugin-wantedly/src/rules/nexus-upper-case-enum-members.ts index 7d945d3b..b3463489 100644 --- a/packages/eslint-plugin-wantedly/src/rules/nexus-upper-case-enum-members.ts +++ b/packages/eslint-plugin-wantedly/src/rules/nexus-upper-case-enum-members.ts @@ -16,9 +16,6 @@ export const RULE: Rule.RuleModule = { type: "suggestion", fixable: "code", schema: [ - { - enum: ["error", "warn", "off"], - }, { type: "object", properties: {