Comments (11)
https://prettier.io/ is also a popular option. It not only lints but reformats, supporting js, css, html, markdown and even php via a plugin.
from appwrite.
I would suggest Airbnb Javascript Style Guide.
Currently we are using the PHP-FIG for our PHP coding standards
I checked the source code and it seems that PSR-1 basic standard rules were mostly ignored, which violates requirements for PSR-2 / PSR-12.
I see that PHP 7.3+ is required, but features such as type hinting for parameters or null coalesce operator are not really being used.
from appwrite.
You can use ESLint with Airbnb config.
from appwrite.
Great, I will give it a try.
I have also just finished to commit all the changes that the PHP-CS-FIXER applied to the code to make it more compatible to the PSR-1+2.
from appwrite.
@eldadfux I also recommend, like the doctor, on ESLint
.
We in climacell use the rules of Airbnb
, together with jest
(for testing), and add some of our own taste. you can see the config here if you like:
module.exports = {
"parser": require.resolve("babel-eslint"),
"extends": [
require.resolve("eslint-config-airbnb"),
"plugin:jest/recommended"
],
"plugins": ["jest"],
"globals": {
"document": true,
"window": true,
"describe": true,
"it": true,
"expect": true,
"localStorage": true,
"MutationObserver": true,
"fetch": true,
"Image": true
},
"rules": {
"no-plusplus": "off",
"linebreak-style": "off",
"no-underscore-dangle": "off",
"class-methods-use-this": "off",
"react/prop-types": "off",
"react/jsx-filename-extension": "off",
"import/prefer-default-export": "off",
"import/no-default-export": "error",
"jsx-a11y/media-has-caption": "off",
"max-len": [
"error",
{
"code": 120
}
],
"no-param-reassign": [
"error",
{
"props": false
}
],
"indent": [
"error",
4,
{
"SwitchCase": 1
}
],
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": true
}
],
"react/jsx-indent": [
"error",
4
],
"react/jsx-indent-props": [
"error",
4
],
"object-curly-newline": "off",
"react/no-did-mount-set-state": "off",
"react/jsx-one-expression-per-line": "off",
"jsx-a11y/label-has-for": "off"
}
};
from appwrite.
Another point to Eslint + Airbnb style guide, most projects today i use it and seems very popular.
from appwrite.
https://prettier.io/ is also a popular option. It not only lints but reformats, supporting js, css, html, markdown and even php via a plugin.
Have had good success working with prettier.io as well (both for PHP and JS).
from appwrite.
Voting for prettier too, ever since it makes code seamless across multiple people, you can set up auto-formatting whenever someone pushes code too which at least standardizes the coding conventions!
from appwrite.
Hi guys! Thanks you all for the great advices! I have just formatted all of our entire JS codebase with prettier thanks to the easy integration with VS Code.
The fact that it can also support our PHP codebase can be a great bonus and although the Airbnb standard seems very popular, It seems more logical to go with the open-source project standard.
from appwrite.
Hi @TheDoctor0, Thanks for the feedback!
I will run, php-cs-fixer on the current code base, to make sure all code is consisted with psr-1 and psr-2.
As I mentions in the contributors guidelines, I haven't really reviewed PSR-12 yet, but I hope to do so in the upcoming days.
Are there any tools like php-cs-fixer that can help us fix the current JS code to match the Airbnb style guide?
from appwrite.
Thanks for the feeback @nati-levi ! seems like airbnb is the industry favourite...
from appwrite.
Related Issues (20)
- 🐛 Bug Report: Missing scope throws Uncaught AppwriteException: Invalid redirect
- 🚀 Enhancement: Accepts Hashed Passwords in Login/Signup endpoints HOT 2
- 🐛 Bug Report: Stats shows only last 25days, end of every day, it hides 26th day. HOT 4
- 📚 Documentation: What's the realtime websocket URL? HOT 1
- AppwriteException: Database not found HOT 4
- 🐛 Bug Report: Recreate Same Name Relationship Attribute Only Self-Hosted HOT 5
- 🐛 Bug Report: No logs for failed index
- 📚 Documentation: createToken says it will create a user if they do not exist
- 🐛 Bug Report: SMS Sending via TextMagic stuck at "processing" status HOT 1
- 🐛 Bug Report: Receiving a general error for correct inputs using an email that account was previously deleted for HOT 1
- 🚀 Enhancement: Support Vonage Messages API for Messaging HOT 1
- 🐛 Bug Report:
- 🐛 Bug Report: Cannot renew domain HOT 6
- 🐛 Bug Report: querry does not work on Ios but does work on windows and android when using c# HOT 8
- 🐛 Bug Report: Expired targets not automatically deleted HOT 2
- RactNative--500 error HOT 1
- 🐛 Bug Report: Server Error using GraphQL HOT 1
- 🐛 Bug Report: Unable to get current user session on functions using jwt HOT 1
- 📚 Documentation: Support manual deployment HOT 1
- 🚀 Enhancement: Add Sign Language as a language 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 appwrite.