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)
- Add instrumentation for `fetch` API HOT 8
- RFC: Allow concurrent testing without excessive warning noise HOT 2
- Unnecessary conversion of trace context to base64 in OTLP exporters HOT 2
- Support Experimental metrics from semantic_conventions/http-metrics (1.23.1) HOT 3
- auto-instrumentation-fetch replaces headers when req.headers input is of type Map HOT 1
- otlp-transformer requires BigInt HOT 2
- OpenTelemetry prevents next.js to properly terminate its process on Windows if we choose to close the terminal directly using the mouse HOT 5
- @opentelemetry/context-zone eradicates Promise.withResolvers HOT 2
- Log Bridge API Appender packages or use current Instrumentation packages HOT 2
- [instrumentation] ESM hook not working with Node.js v18.19.0
- @opentelemetry/[email protected] : TypeError: Cannot read properties of undefined (reading 'explicitBucketBoundaries') HOT 4
- Remove unused `AsyncHooksContextManager` HOT 2
- [metrics] prototype attributes instrument advisory parameter HOT 1
- Performance slowdown using http-instrumentation HOT 2
- [Instrumentation] Cannot build web project using webpack due to reference to nodejs core package (path) HOT 3
- Create too many spans when clicking on button in React. HOT 1
- Error: @opentelemetry/api: Attempted duplicate registration of API: propagation AWS Lambda Nodejs HOT 4
- Perf: avoid internal object format transformations during export
- Allow increasing max batch size for metric exporter. HOT 2
- Provide working TypeScript / ESM examples HOT 5
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.