fix: properly scope rules to file types#86
Open
saberzero1 wants to merge 1 commit into
Open
Conversation
Contributor
|
The approach looks good. |
Collaborator
Author
Alright. Thanks for confirming. I'll tidy up this PR tomorrow. |
Collaborator
Author
|
@joethei do we currently have any React/Svelte-specific rules? If not, do you want me to add stubs for those? Considering Obsidian's plugin tutorial has examples for both React and Svelte. |
Contributor
|
we don't have any specific rules, stubs would be nice. |
Collaborator
Author
|
@joethei apologies for the delay. Finally got around to addressing this. |
- Split rule configurations into base (JS/TS) and type-checked (TS-only) - Separate package.json checks from main configuration - Add stubs for react and svelte configs - Regenerated documentation
0b40674 to
b432677
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Splits the recommended config's rule sets so that rules requiring TypeScript type information only run on TypeScript files, while rules that don't need type info apply to both JS and TS files.
Problem
The recommended config applied all
obsidianmdrules uniformly. Rules that callgetParserServices(likeno-plugin-as-component,no-view-references-in-plugin,prefer-file-manager-trash-file,prefer-instanceof,no-unsupported-api) would crash or produce misleading errors when run on plain JavaScript files that aren't parsed by@typescript-eslint/parser.Changes
recommendedPluginRulesConfigintorecommendedPluginRulesConfigBase(JS + TS) andrecommendedPluginRulesConfigTypeChecked(TS only)package.jsonlinting into its ownpackageJsonconfigreactandsvelte