Repository: eslint/eslint
File: lib/rules/no-restricted-imports.js (JavaScript)

Code before:
                            type: "string"
                        },
                        minItems: 1,
                        uniqueItems: true
                    },
                    regex: {
                        type: "string"
                    },
                    importNamePattern: {
                        type: "string"
                    },
                    allowImportNamePattern: {
                        type: "string"
                    },
                    message: {
                        type: "string",
                        minLength: 1
                    },
                    caseSensitive: {
                        type: "boolean"
                    }
                },
                additionalProperties: false,
                not: {
                    anyOf: [
                        { required: ["group", "regex"] },
                        { required: ["importNames", "allowImportNames"] },
                        { required: ["importNamePattern", "allowImportNamePattern"] },
                        { required: ["importNames", "allowImportNamePattern"] },
                        { required: ["importNamePattern", "allowImportNames"] },
                        { required: ["allowImportNames", "allowImportNamePattern"] }
                    ]
                },
                oneOf: [
                    { required: ["group"] },
                    { required: ["regex"] }
                ]
            },
            uniqueItems: true
        }
    ]
};

/** @type {import('../shared/types').Rule} */
module.exports = {
    meta: {
        type: "suggestion",

        docs: {
            description: "Disallow specified modules when loaded by `import`",
            recommended: false,

Review comment (suggestion):
```suggestion
```

I think this restriction is now already covered by the `oneOf` below.

Code after:
                            type: "string"
                        },
                        minItems: 1,
                        uniqueItems: true
                    },
                    regex: {
                        type: "string"
                    },
                    importNamePattern: {
                        type: "string"
                    },
                    allowImportNamePattern: {
                        type: "string"
                    },
                    message: {
                        type: "string",
                        minLength: 1
                    },
                    caseSensitive: {
                        type: "boolean"
                    }
                },
                additionalProperties: false,
                not: {
                    anyOf: [
                        { required: ["importNames", "allowImportNames"] },
                        { required: ["importNamePattern", "allowImportNamePattern"] },
                        { required: ["importNames", "allowImportNamePattern"] },
                        { required: ["importNamePattern", "allowImportNames"] },
                        { required: ["allowImportNames", "allowImportNamePattern"] }
                    ]
                },
                oneOf: [
                    { required: ["group"] },
                    { required: ["regex"] }
                ]
            },
            uniqueItems: true
        }
    ]
};

/** @type {import('../shared/types').Rule} */
module.exports = {
    meta: {
        type: "suggestion",

        docs: {
            description: "Disallow specified modules when loaded by `import`",
            recommended: false,
            url: "https://eslint.org/docs/latest/rules/no-restricted-imports"