sort-keys - include/exclude objects by name
See original GitHub issueWhat rule do you want to change? sort-keys
Does this change cause the rule to produce more or fewer warnings? fewer potentially
How will the change be implemented? (New option, new default behavior, etc.)? new option
Please provide some example code that this change will affect:
/*eslint sort-keys: ["error", { includeObjects: ["includeMe"] }]*/
// Examples of incorrect code for this rule:
const includeMe = { b: 'b', a: 'a' }
// Exampes of correct code for this rule
const someObj = { b: 'b', a: 'a' }
/*eslint sort-keys: ["error", { excludeObjects: ["excludeMe"] }]*/
// Examples of incorrect code for this rule:
const foo = { b: 'b', a: 'a' }
// Exampes of correct code for this rule
const excludeMe = { b: 'b', a: 'a' }
What does the rule currently do for this code? Answered above
What will the rule do after it’s changed? Answered above
Are you willing to submit a pull request to implement this change? I will try with some guidance, I’ve never looked into eslint code.
Motivation The biggest use case for me is sorting JSS properties, while NOT linting the rest of the app.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Using Sort Keys to Organize Data in Amazon DynamoDB - AWS
You use sort keys to not only group and organize data, but also to ... to include, exclude, and match items by their...
Read more >How to access and sort keys in nested objects in Javascript?
I need to access keys in objects (name, age, position, experience) and sort them according to this string, so keys in the object...
Read more >SortCriteria - Oracle Help Center
Constructs a new SortCriteria object with the specified display name and state for include/exclude ( true == include). Parameters: displayName - The desired ......
Read more >PK Automation - Certara
Use one of the following to add a PK Automation object to a Workflow: ... Check/Uncheck the Standard box to include/exclude a table...
Read more >Template and Listdef
I could also EXCLUDE some objects. There can be several INCLUDE/EXCLUDE clauses within a LISTDEF. TABLESPACES, LIST01 will contain table spaces. TABLESPACE.
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
Hi @goldylucks, thanks for the issue.
Have you tried using ESLint disable comments? I think that would be a pretty good fit for your use case, especially in the exclude case.
so I ended up including instead of excluding. Not very clean, but it works 😃