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 conflict against base rules #41

Merged
merged 4 commits into from
Jan 23, 2021
Merged

Fix conflict against base rules #41

merged 4 commits into from
Jan 23, 2021

Conversation

phanect
Copy link
Owner

@phanect phanect commented Jan 23, 2021

Currently, eslint-plugin-editorconfig modifies the rule object received from new Linter().getRules().get(baseRuleName) directly.
By modifying the object, it modifies original rule object.

Therefore, if the original rule is used anywhere (e.g. in extending eslint-config-* packages), it causes error.

This PR fixes the error by cloning the base rule object before modifying it.

Closes #38

Currently .eslintrc.js in the root directory lints files using eslint-plugin-editorconfig which includes bug to modify the original rules.
Therefore, to avoid lint failure on the CI, lint in the test-packages/base-rules-conflict/ directory is temporary disabled.
@phanect phanect merged commit b9ca8c0 into main Jan 23, 2021
@phanect phanect deleted the base-rules-conflict branch January 23, 2021 11:44
@phanect phanect changed the title Do not modify original rules Fix conflict against base rules Jan 23, 2021
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.

Incompatible with eslint-config-airbnb-base and typescript
1 participant