Comments (4)
Class and interfaces files should be UpperCamelCase.
Yes - this is the class-name rule that is already enforced in the packages via gts
Singleton files should be name like what they export (usually camelCase).
I like this though I'm not sure how to
Files with multiple exports should be kebab-case with a description of the group of exports they represent.
I'm fine with enforcing camelCase for filenames. The TS book style guide concurs and the TypeScript repo itself uses it. We can enforce that via the file-name-casing rule. Google uses snake_case.ts
internally for TS filenames and folders, which is where OpenCensus got it I believe, but snakeCase seems to be more of the community standard so we should go with that.
We should be able to use the export-name
rule to enforce this from the tslint-microsoft-contrib repo, which only enforces the rule for files with single exports, and use reviewer judgment to make sure multi-export filenames have good names.
I'm not sure what the standard is for folders, but I would use the as the above (kebab-case in this proposal).
The TypeScript repo itself seems to use camelCase for folders, which would make it consistent with file names, but I'm fine with kebab-case
for folders. I think camelCase feels a bit more Window-y and snake_case a bit more Unix-y, but modern systems can handle both.
from opentelemetry-js.
Yes - this is the class-name rule that is already enforced in the packages via gts
+1
What should be the TSLint rule for name of the test files? (either index.test.ts
or test-index.ts
or test_index.ts
)
from opentelemetry-js.
@draffensperger I'm not sure your suggestions are the same as what I described above. Let me provide a few examples of what I meant just to make sure.
Class example: Entry.ts
Singleton/function example: randomBytes.ts
Utilities example: some-util.ts
Folder example: /distributed-context/
This makes it easy to know what is the content of the file. The most important part is the files where the file name matches the export. I don't have a strong opinion for folders or utilities names. kebab-case and snake_case are easier to read, but camelCase would be more consistent.
Is this something these TSLint rules can handle? If not I'm fine to revisit this with something that can be enforced as it will make standardizing this easier.
from opentelemetry-js.
I believe our code bases are following such rules and this issue can be closed.
from opentelemetry-js.
Related Issues (20)
- [instrumentation] research adding experimental features to `Instrumentation`, `InstrumentationBase`
- Can not use ESM support in lambda environment HOT 2
- @opentelemetry/semantic-conventions out of sync. E.g. 1.25.1 `http.user_agent` does not follow semantic conventions? HOT 4
- traceparent http header field is not extracted correctly when datadog agent also inserts it HOT 2
- [instrumentation] update "Instrumentation for ES Modules" documentation HOT 1
- How to determine Parent Span from a ReadableSpan, check if Parent Span is Remote?
- Unable to access to trace information using opentelemetry-js SDK + aws lambda layer HOT 2
- `HttpInstrumentation` does not create outgoing request span for `http.get` in ESM HOT 1
- Lamda Auto Instrumentation Causes -> Internal Server Error Due To Span not Ending HOT 2
- node http integration: ignoreIncomingRequests() option does not work HOT 2
- couchbase instrumentation doesn't not support?
- Logs Stabilization Plan HOT 1
- Update Typescript HOT 1
- Unable to set object as span attribute value HOT 1
- Instrumenting node build chains
- How to add fields to a fetch request, or adding custom fields to a span.
- HTTP instrumentation metrics naming not matching OTel spec. HOT 2
- Separate publishing of semantic conventions for more control over version
- Possible to configure Multiple Exporters using NodeSDK?
- diag.error about unknown OTEL_NODE_RESOURCE_DETECTORS entry should be diag.warn
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 opentelemetry-js.