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

Allow changing parameter properties #1075

Merged

Conversation

openorclose
Copy link
Contributor

What is the purpose of this pull request? (put "X" next to an item, remove the rest)

• [x] Enhancement to an existing feature

Fixes #1065
What is the rationale for this request?

Improve code quality, so that we don't need to unnecessarily redeclare parameters.

What changes did you make? (Give an overview)

Override the eslint rule to allow for parameter properties to be reassigned.

Provide some example code that this change will affect:

function setName(o, name) {
o.name = name;
}

The above is now allowed.

Is there anything you'd like reviewers to focus on?

Ensure that parameters still can't be reassigned.

Testing instructions:

Proposed commit message: (wrap lines at 72 characters)

Allow function param property reassign

Our eslint rule doesn't allow for
properties on parameters to be changed.

This leads to a lot of boilerplate:

function setName(obj, newName) {
    const sameObj = obj;
    sameObj.name = newName;
}

Let's eliminate this by allowing parameter properties
to be reassigned via the eslint rule:

"no-param-reassign": ["error", { "props": false }]

@ang-zeyu
Copy link
Contributor

ang-zeyu commented Mar 2, 2020

LGTM, should we standardise all such names to node at the same time?

…props-assign

# Conflicts:
#	src/lib/markbind/src/parser.js
#	src/lib/markbind/src/parsers/componentParser.js
Copy link
Contributor

@ang-zeyu ang-zeyu left a comment

Choose a reason for hiding this comment

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

The small additional refactor for getAbsoluteResourcePath looks good as well 👍

@yamgent yamgent added this to the v2.11.1 milestone Mar 7, 2020
@yamgent yamgent merged commit e521f97 into MarkBind:master Mar 7, 2020
$('img, pic, thumbnail').each(function () {
const elem = $(this);
if (elem[0].name === 'thumbnail' && elem.attr('src') === undefined) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Reverted 204-207 #1092

Tejas2805 added a commit to Tejas2805/markbind that referenced this pull request Mar 7, 2020
…nvert-to-code-block

* 'master' of https://github.com/MarkBind/markbind:
  Allow changing parameter properties (MarkBind#1075)
  Custom timezone for built-in timestamp (MarkBind#1073)
  Fix reload inconsistency when updating frontmatter (MarkBind#1068)
  Implement an api to ignore content in certain tags (MarkBind#1047)
  Enable AppVeyor CI (MarkBind#1040)
  Add heading and line highlighting to code blocks (MarkBind#1034)
  Add dividers and fix bug in siteNav (MarkBind#1063)
  Fixed navbar no longer covers modals (MarkBind#1070)
  Add copy code-block plugin (MarkBind#1043)
  Render plugins on dynamic resources (MarkBind#1051)
  Documentation for Implement no-* attributes for <box>  (MarkBind#1042)
  Migrate to bootstrap-vue popovers (MarkBind#1033)
  Refactor preprocess and url processing functions (MarkBind#1026)
  Add pageNav to Using Plugins Page (MarkBind#1062)

# Conflicts:
#	docs/userGuide/syntax/siteNavigationMenus.mbdf
Tejas2805 added a commit to Tejas2805/markbind that referenced this pull request Mar 9, 2020
* 'master' of https://github.com/MarkBind/markbind:
  2.12.0
  Update outdated test files
  Update vue-strap version to v2.0.1-markbind.37
  Fix refactor to processDynamicResources (MarkBind#1092)
  Implement lazy page building for markbind serve (MarkBind#1038)
  Add warnings for conflicting/deprecated component attribs (MarkBind#1057)
  Allow changing parameter properties (MarkBind#1075)
  Custom timezone for built-in timestamp (MarkBind#1073)
  Fix reload inconsistency when updating frontmatter (MarkBind#1068)
  Implement an api to ignore content in certain tags (MarkBind#1047)
  Enable AppVeyor CI (MarkBind#1040)
  Add heading and line highlighting to code blocks (MarkBind#1034)
  Add dividers and fix bug in siteNav (MarkBind#1063)
  Fixed navbar no longer covers modals (MarkBind#1070)
  Add copy code-block plugin (MarkBind#1043)
  Render plugins on dynamic resources (MarkBind#1051)
  Documentation for Implement no-* attributes for <box>  (MarkBind#1042)
  Migrate to bootstrap-vue popovers (MarkBind#1033)
  Refactor preprocess and url processing functions (MarkBind#1026)
  Add pageNav to Using Plugins Page (MarkBind#1062)
marvinchin pushed a commit that referenced this pull request Apr 10, 2020
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.

Override eslint rule to "no-param-reassign": ["error", { "props": false }]
3 participants