Comments (8)
@markdirish Yes, we can't break compatibility, but we can disable linting for those lines: https://eslint.org/docs/user-guide/configuring#disabling-rules-with-inline-comments
Ideally, we'd also come up with an API which is conformant and make the old APIs deprecated, but that should be a separate issue.
from nodejs-itoolkit.
We should probably get a standard one across all projects. Is the one in idb-pconnector good? There are some really famous JavaScript style guides we might follow, like the AirBNB JavaScript style guide. Might be easier to use a tried and tested one like that.
This is a great idea though.
from nodejs-itoolkit.
We should probably get a standard one across all projects
I totally agree
I enjoyed using that eslint file for idb-pconnector
project.
I'm open to looking into other style guides,
It really comes to preference when choosing from the popular style guides,
For example:
some enforce semicolons after each line while others do not.
Of course we can use their style guide as a base and tweak it to our liking.
from nodejs-itoolkit.
If we're going to switch things up and enforce a style, there's going to be a lot of changes, which will make history harder to follow (git blame
, etc). Usually when this is done, you do it in one big change that's a clear divider line between old and new, so this should be top priority.
I'd also echo @markdirish's suggestion to use a common community style. I would not customize it, but stick to the style since that would mean less friction for outside developers to contribute.
from nodejs-itoolkit.
It seems my initial sense that the airbnb style as a sort of 'gold standard' seems to be correct. I followed the instructions on this website to install eslint and airbnb style as devDependencies (which we should eventually do for all our repos). I am currently running the linter instructions from eslints website under Local Installation and Usage: Eslint Getting Started.
There are a few configurations in the style that are weird to me (100 max line length instead of 80), but I think I agree with @kadler that we shouldn't change it, and should instead adapt the way we code. That will help keep the code standardized.
I am going to lint this repo and push to a new v1.0 branch, since that is the milestone we are shooting for. We can then work on some of the other improvements/enhancements on that branch and get this repo ready for 1.0
from nodejs-itoolkit.
One issue that I've run into is the 'new-cap' rule, which says that constructors (and by extension classes) need to begin with a capital letter. Obviously this becomes an issue for our tendency to preface our class names with i, as in iPgm. If we are going to adopt this, we are going to have to change to IPgm, which I don't have a problem with, but I want to feel out how everyone feels.
from nodejs-itoolkit.
Also noticed that this guide disallows for of
which I do not totally agree with.
Some use cases where I would want for of
when iterating over a list then using await
on a method that returns a promise.
The guide recommends using for each
method which does not play nice with async and await.
see this
I could using the good old for(let i = 0; i < list.length; i++)
but the for of
statement is much cleaner imo.
from nodejs-itoolkit.
Closing this since we established common code style with AirBNB JavaScript style guide.
from nodejs-itoolkit.
Related Issues (20)
- Can DB2 transport method handle 300 to 500 requests at any given instance ? HOT 3
- SSH transport should support other use cases (validate fingerprints, keys, agents, etc.) for security HOT 4
- Return a better error when optional deps are not found HOT 1
- Investigate supporting Promises and Callbacks HOT 3
- iDataQueue - receiveFromDataQueue - I need a loop and a wait
- eslint action fails
- Update Mocha and Eslint to the latest versions HOT 1
- Update ssh2 to the latest version HOT 1
- Documentation needs to be completed - var types not defined in here. HOT 2
- *OMIT not supported HOT 28
- Change documentation to recommend a different XML parser HOT 10
- Docs Failed to build HOT 1
- Remove use of xml2js
- Handle failing integration tests
- Upgrade minimum node engine? HOT 3
- Add npm publish GitHub action
- Add changes to allow mode=OPM|ILE to be passed on to xmlservice from itoolkit HOT 1
- Fix license headers on source files
- NEW CASE FOR IBMi : *CURRENT for user profile and password is not accepted . HOT 6
- ProgramCall - Function that returns a packed variable HOT 8
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 nodejs-itoolkit.