question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add option for groups to `sort-keys`

See original GitHub issue

What rule do you want to change?

sort-keys

Does this change cause the rule to produce more or fewer warnings?

Fewer

How will the change be implemented? (New option, new default behavior, etc.)?

New option to allow groups separated by blank lines. This concept is taken from the TSLint counterpart, where this is the default behaviour. This will be very helpful for everyone who is migrating from TSLint and used this rule.

Please provide some example code that this change will affect:

const foo = {
	a: "Value",
	b: "Bar",

	action: () => {
		console.log()
	}
}

What does the rule currently do for this code?

action should be before b.

What will the rule do after it’s changed?

Reset the sorting after each blank line, which makes the code valid.

Are you willing to submit a pull request to implement this change?

I might look into it, but I can’t promise anything since I do not have prior experience with writing lint rules.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
kaicataldocommented, Sep 30, 2019

Thanks for clarifying. I’m 👍 for adding this to the core rule. I don’t think it should have to be implemented by @typescript-eslint/plugin since the changes proposed aren’t related to TypeScript syntax.

0reactions
eslint-deprecated[bot]commented, Oct 31, 2019

Unfortunately, it looks like there wasn’t enough interest from the team or community to implement this change. While we wish we’d be able to accommodate everyone’s requests, we do need to prioritize. We’ve found that issues failing to reach accepted status after 21 days tend to never be accepted, and as such, we close those issues. This doesn’t mean the idea isn’t interesting or useful, just that it’s not something the team can commit to.

Thanks for contributing to ESLint and we appreciate your understanding.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Best practices for using sort keys to organize data
Best practices for using sort keys to organize data. PDFRSS. In an Amazon DynamoDB table, the primary key that uniquely identifies each item...
Read more >
sortkeys | Looker - Google Cloud
Use a sort key to specify the columns of a PDT that will be most frequently sorted by to make querying the data...
Read more >
Sort Key Functionalities - SAP Blogs
Sort Keys are used to populate the Assignment number field in the line items of customers or vendors or general ledgers.
Read more >
How to sort keys in MAP while grouping
I am trying to insert list of wrapper class records in a MAP taking group name as KEY and related Wrapper class records...
Read more >
sort-keys - ESLint - Pluggable JavaScript Linter
Others feel that it adds complexity and becomes burden to maintain. Rule Details. This rule checks all property definitions of object expressions and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found