Comments (12)
I've improved the section on how it differs from Standard:
https://github.com/sindresorhus/xo#why-not-standard
from xo.
That argument is regarding standard
trying to be the code style. I have no such goal. I just made XO after my code style, but I still allow other options, like spaces, for pragmatic reasons so other people can use it too. The reality is that the JS community is just too diverse and opinionated to create one code style. My goal is just to make it easier for me and people wanting to use this code style (or spaces by setting the spaces
option).
Any suggestions on how I can make that clearer?
from xo.
Oh I see. That's perfectly fine, I was thinking that your goal was the same as standard
(one to rule them all). I guess you can specify what you just posted here inside the readme somewhere.
from xo.
XO is more pragmatic and has no aspiration of being the style
The readme is pretty clear to me.
from xo.
@kevva Yup. I still want rework that paragraph though. Keeping this open until then.
from xo.
@sindresorhus I'm just curious. What choices do you think standard
made wrong, i.e. what popular rules do they not follow do you mean? If it's only the semicolons there's semistandard
for that...
from xo.
@joakimbeng I don't remember them all from memory, but it was at least semicolons, space after function name function foo () {}
, lax use of braces. Good overview of differences between standard
and XO rules here: standard/standard#216 (comment) As you can see, XO is a lot stricter. My personal preference is strict non-ambiguous readable code.
from xo.
@sindresorhus thanks!
I'm with you on the strictness! Then I'm convinced, XO is the one I'll
stick to :)
from xo.
That space after function thing really bugs me. I just can't stomach function myFunc () {}
, but I like the space when there's no name. function () {}
.
Just goes to show that Standard (while a great idea) is poorly executed, and there are just too many diverse opinions to have a standard on code style. Let's have standard on things that really matter.
Sorry for the rant!
from xo.
@joakimbeng the semi-colons thing is a big one for me personally. I want to know when a statement is finished; it adds a wee bit of cognitive load reading source, imo.
@therealklanni just being clear, there isn't a space after the name of a function; only the function
keyword, which means a space between function
and ()
in the event it's anonymous.
from xo.
@Qix- I was referring to Standard:
Space after function name
function name (arg) { ... }
from xo.
@therealklanni Aha gotcha.
from xo.
Related Issues (20)
- Expected HOT 2
- Unexpected token with dynamic import with type assertion HOT 1
- In a monorepo with turborepo and typescript which is the best setup? HOT 1
- Support with reviewdog? HOT 1
- Replace native/deprecated stylistic rules with `eslint-stylistic` HOT 2
- Automatic ecmaVersion HOT 2
- Projects in a Turborepo monorepo not using workspace package.json config HOT 2
- Deprecation of Formatting Rules in ESLint v8.53 HOT 5
- Proposal: enable strict-boolean-expressions
- XO seems to not play well with Typescript's array `extends` HOT 1
- EACCESS: permission denied on ignored directory HOT 2
- Reintroduce "length" rules to catch excess HOT 3
- List typescript extensions as well for `extensions` config
- regression: `xo: false` in nested `package.json` is not supported any more HOT 9
- xo does not check for `.xo.config.js` (or any file with dot '.' prefix) HOT 1
- can't pass options to @typescript-eslint/switch-exhaustiveness-check
- Compatibility with Biome ? HOT 1
- Object Literal Property must match one of the following formats: strictCamelCase HOT 8
- default-case & @typescript-eslint/switch-exhaustiveness-check conflict with each other HOT 3
- "Definition for rule '@typescript/eslint/....' was not found" error happening in js, cjs and mjs files 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 xo.