Skip to content

Don't output ESLint rules that match extended configurations #448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 9, 2020

Conversation

JoshuaKGoldberg
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg commented May 4, 2020

PR Checklist

Overview

Renames the phrasing of "simplifying" conversion results to "summarizing" them, as the summary actually contains extra information. That information now includes extensionRules so that summarizePackageRules knows the configuration values received from configuration extensions.

Those configuration values are now compared against potentially output ESLint rule configuration. Ones that are directly equal are omitted from the output configuration for being redundant.

@JoshuaKGoldberg JoshuaKGoldberg changed the title WIP: logic for deduplicating ESLint rules' extensions Deduplicated ESLint rules that match extended configurations May 9, 2020
@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review May 9, 2020 20:23
@JoshuaKGoldberg JoshuaKGoldberg changed the title Deduplicated ESLint rules that match extended configurations Don't output ESLint rules that match extended configurations May 9, 2020
@JoshuaKGoldberg
Copy link
Member Author

Hmm, this mostly fixes the general issues, but we now/still have empty objects from configurations getting added to the root output file:

module.exports = {
    "env": {
        "browser": true,
        "es6": true
    },
    "extends": [
        "prettier",
        "prettier/@typescript-eslint",
        "plugin:@typescript-eslint/recommended",
        "plugin:@typescript-eslint/recommended-requiring-type-checking"
    ],
    "ignorePatterns": [],
    "parser": "@typescript-eslint/parser",
    "parserOptions": {
        "project": "tsconfig.json",
        "sourceType": "module"
    },
    "plugins": [
        "@typescript-eslint"
    ],
    "rules": { /* ... */ },
    "settings": {}
};

Note the ignorePatterns and settings. I'll file a followup bug on myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Running twice adds extended configuration's values in output config
1 participant