Comments (15)
Too bad that this plugin does not support it. I will uninstall it and search for another plugin that does not take my freedom away.
from eslint-plugin-jsonc.
Thank you for posting issue.
I don't think the brace-style rule is needed for JSON as it is a rule for block statements.
Instead, I think you can use two rules.
https://ota-meshi.github.io/eslint-plugin-jsonc/rules/object-curly-newline.html
https://ota-meshi.github.io/eslint-plugin-jsonc/rules/object-curly-spacing.html
What do you think?
I don't know what it means to use the Allman style in JSON.
from eslint-plugin-jsonc.
Thanks for the quick response, I was actual trying those rules but they don't enforce the brace style like allman.
/* eslint jsonc/brace-style: ["error", "allman"] */
{
/* ✓ GOOD */
"GOOD":
{
"foo": "bar"
}
/* ✗ BAD */
"BAD": {
"foo": "bar"
}
}
from eslint-plugin-jsonc.
Thank you for your explanation.
There doesn't seem to be a rule in ESLint to apply the Allman style to object expressions either.
Do you have a rule for applying the Allman style to JavaScript object expressions? It will be helpful if you have it.
from eslint-plugin-jsonc.
There is a rule of course, see allman brace style.
from eslint-plugin-jsonc.
No, it's not. brace-style rule that apply to block statements. What I want is a rule that applies to object expressions.
from eslint-plugin-jsonc.
Related to eslint/eslint#5203
from eslint-plugin-jsonc.
I couldn't find any information about the style of placing a newline before an object expression.
I've found information about applying the Allman style to statements, but not about object literal expressions.
Do you have a popular style guide on it?
Without it, I don't think I can implement the rule.
(However, you are free to create your own plugins and create rules to use them.)
from eslint-plugin-jsonc.
First of all, is there no way to just use the eslint rule for JavaScript? Allman (BSD), Whitesmiths, GNU, Horstmann ... there are tons of styles that enforce placing the {
and [
on the next line.
https://en.wikipedia.org/wiki/Indentation_style#Styles
from eslint-plugin-jsonc.
I think the link you provided only mentions the "statements".
Object expressions are not statements.
from eslint-plugin-jsonc.
Sure, why would you think it affects statements aswell? It doesn't...
from eslint-plugin-jsonc.
I don't understand your favorite style. If it's common, I want that document. Without it I can't implement the rule. That's because I can't understand the details of the style.
from eslint-plugin-jsonc.
There is a wikipedia article pointing out that popular developers and projects are using different indent styles. There is a eslint rule providing "good" and "bad" examples aswell... see the code.
Whatsoever, I cannot provide something that is not available... there is no commision taking care of that coding styles from my knowledge, so I have no idea what document you are looking for!?
from eslint-plugin-jsonc.
The question I'm just wondering is, do objects that don't have properties also line break? Also, do I need a line break before the close brace?
{
"a": {},
"b":
{},
"c":
{
},
}
Perhaps there are many other questions in implementing the rule. I don't think I can solve them myself. If I ask you questions one by one, I think it's more efficient for you to implement the rule.
from eslint-plugin-jsonc.
By the way, I don't favorite your favorite style. So I don't use the new rule.
from eslint-plugin-jsonc.
Related Issues (20)
- Adding no-duplicate-values-in-json files rule feature to the plugin HOT 14
- Allow ignoring certain paths from sorting HOT 3
- Error importing this plugin in Vite application HOT 2
- Add only allow flattened/nested keys rule HOT 1
- Request textDocument/codeAction failed. HOT 1
- "jsonc/no-comments" regra - Há um bug que Comentário no início do bloco é igno
- "jsonc/no-comments" rule - [bug] some comments are ignored HOT 2
- Support configuration file eslint.config.js HOT 1
- Conflict with @typescript-eslint/recommended-requiring-type-checking? HOT 1
- vscode-eslint extension cannot validate JSON using the "eslint.probe" configuration HOT 4
- Question: vscode and JSON5 syntax highlight HOT 2
- sort-keys need to run many times to sort big files HOT 4
- sort-keys: Misplaced comments in tsconfig.json HOT 1
- Internal code suggestion: add explicit call signatures for RuleListener node types? HOT 1
- Keep getting "Parsing error: Expected to be an expression, but got empty" HOT 7
- Error: Cannot find module 'espree'
- Struggling to get plugin to work with typescript parser... HOT 2
- Version 3 HOT 1
- typescript gives an error saying `synckit` is an ESM package, but `synckit` can also be used with commonjs. I don't quite understand the correct way to configure typescript 😓
- How config correctly my eslint config with jsonc HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-plugin-jsonc.