[padding-line-between-statements] Add an option for padding object elements
See original GitHub issueWhat rule do you want to change?
padding-line-between-statements
Does this change cause the rule to produce more or fewer warnings?
More warnings, if enabled. (but none if --fix is enabled.)
How will the change be implemented? (New option, new default behavior, etc.)?
New option for STATEMENT_TYPE for object elements.
Please provide some example code that this change will affect:
const obj = {
props: {
elt: Object,
},
data() {
return {
selected: {},
config: {
card_mode: false
},
};
},
created() {
this.today = new Date;
},
methods: {
onSubmit() {
const url = '/foo';
this.POST(url, {
selected: this.selected,
});
},
onReset() {
this.$nextTick(() => this.$bvModal.hide('modal'));
},
},
};
What does the rule currently do for this code?
Nothing
What will the rule do after it’s changed?
Add padding between object elements this:
const obj = {
props: {
elt: Object,
},
data() {
return {
selected: {}
config: {
card_mode: false
},
};
},
created() {
this.today = new Date;
},
methods: {
onSubmit() {
const url = '/foo';
this.POST(url, {
selected: this.selected,
});
},
onReset() {
this.$nextTick(() => this.$bvModal.hide('modal'));
},
},
};
Are you willing to submit a pull request to implement this change?
Nooooo.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:5 (1 by maintainers)
Top Results From Across the Web
padding-line-between-statements
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >vue/padding-line-between-blocks
require or disallow padding lines between blocks. The --fix option on the command line can automatically fix some of the problems ...
Read more >Apply Padding to an Object
Apply padding to an object to add white space between the object and its margin or, if there is a border, between the...
Read more >ESLint v4.0.0 released - ESLint中文文档
This release adds some new features and fixes several bugs found in the ... have been deprecated in favor of the new padding-line-between-statements...
Read more >padding
Padding and Element Width Calculations. If an element has a specified width, any padding added to that element will add to the total...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1. Before ESLint officially support it, I modified the
lines-between-class-members
rule and made lines-between-object-properties.Hi @mat813, thanks for this proposal!
padding-line-between-statements
is about statements, so it probably shouldn’t apply to elements in object literals.Some of the alternatives might be:
I’m not sure which of these would be the best choice at the moment.