Skip to content
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

fix(config-loader): enhance config-loader results #1322

Merged
merged 8 commits into from Jan 27, 2024
Merged

Conversation

azu
Copy link
Member

@azu azu commented Jan 8, 2024

This is breaking change, but @textlint/config-loader is internal use.

Changes

moduleName should be package's name

Previously, moduleName is a file path.

            {
                "type": "RuleInPreset",
                "ruleId": "abc/c",
                "options": false,
                "filePath": "<MODULES_DIR>/textlint-rule-preset-abc/index.js",
-                "moduleName": "<MODULES_DIR>/textlint-rule-preset-abc",
+                "moduleName": "textlint-rule-preset-abc",
                "ruleKey": "c"
            }

Add type: "Plugin"

        "plugins": [
            {
+                "type": "Plugin",
                "pluginId": "custom",
                "plugin": {},
                "filePath": "<MODULES_DIR>/textlint-plugin-custom/index.js",
                "moduleName": "textlint-plugin-custom"
            }
        ],

Add inputModuleName: string

Previously, the input module name is not defined in results.
In some usecase, a user want to map input to result.

For this usecase, the user can use inputModuleName <-> moduleName

Previously, moduleName is a file path.
@azu azu added the Type: Breaking Change Includes breaking changes label Jan 8, 2024
Previously, the input module name is not defined in results.
In some usecase, a user want to map input to result.

For this usecase, the user can use inputModuleName <-> moduleName
Comment on lines 23 to +29
{
"type": "RuleInPreset",
"ruleId": "abc/c",
"options": true,
"filePath": "<MODULES_DIR>/textlint-rule-preset-abc/index.js",
"moduleName": "<MODULES_DIR>/textlint-rule-preset-abc",
"moduleName": "textlint-rule-preset-abc",
"inputModuleName": "preset-abc",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an example of ruleId and inputModuleName.

@azu azu added the Type: Feature New Feature label Jan 8, 2024
@azu azu merged commit 083e138 into master Jan 27, 2024
17 checks passed
@azu azu deleted the refactor-config-loader branch January 27, 2024 23:50
@github-actions github-actions bot mentioned this pull request Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Breaking Change Includes breaking changes Type: Feature New Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant